.bodega-web-wrapper {
    width: 100%;
    margin: 1.5rem 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.bodega-web-card {
    border: 1px solid #d7dee6;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef3f8 100%);
    padding: 1.25rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.bodega-web-title {
    margin: 0 0 0.35rem;
    color: #0f172a;
    font-size: 1.4rem;
    line-height: 1.2;
}

.bodega-web-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: nowrap;
    width: 100%;
}

.bodega-web-title-row .bodega-web-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.bodega-web-title-row [data-bw-new-btn] {
    background: #4b7c88;
    border-color: #4b7c88;
    color: #ffffff;
    flex: 0 0 auto;
    width: auto;
    max-width: max-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.bodega-web-title-row .bodega-web-btn-new-icon {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 999px;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.bodega-web-subtitle {
    margin: 0;
    color: #334155;
    font-size: 0.98rem;
}

.bodega-web-content {
    margin-top: 1rem;
    color: #1e293b;
}

.bodega-web-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 0.7rem;
}

.bodega-web-form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bodega-web-table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
    border: 1px solid #d7dee6;
    border-radius: 10px;
    background: #ffffff;
}

.bodega-web-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.bodega-web-table th,
.bodega-web-table td {
    padding: 0.7rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
    font-size: 0.92rem;
}

.bodega-web-table th {
    background: #eaf1f8;
    font-weight: 600;
    color: #1e293b;
}

.bodega-web-table tbody tr:nth-child(even) {
    background: #f8fbff;
}

.bodega-web-table tbody tr {
    transition: background-color 0.16s ease;
}

.bodega-web-table tbody tr:hover {
    background: #fff3c4;
}

.bodega-web-table tbody tr.bodega-web-row-active {
    background: #ffe8a3;
}

.bodega-web-empty {
    margin-top: 1rem;
    color: #334155;
}

.bodega-web-alert {
    margin-top: 1rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    font-size: 0.92rem;
}

.bodega-web-alert-error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.bodega-web-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}

.bodega-web-search {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.bodega-web-input {
    flex: 1;
    width: 100%;
    min-width: 0;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    font-size: 0.95rem;
}

.bodega-web-btn {
    border: 1px solid #0f766e;
    background: #0f766e;
    color: #ffffff;
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-block;
}

.bodega-web-btn-small {
    font-size: 0.82rem;
    padding: 0.35rem 0.6rem;
}

.bodega-web-btn-icon {
    width: 32px;
    min-width: 32px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.bodega-web-action-group {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.bodega-web-btn-edit {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.bodega-web-modal[hidden] {
    display: none;
}

.bodega-web-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bodega-web-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.bodega-web-modal-card {
    position: relative;
    width: min(560px, 92vw);
    max-height: 88vh;
    overflow: auto;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #d7dee6;
    padding: 1rem;
}

.bodega-web-modal-title {
    margin: 0 0 0.8rem;
    color: #0f172a;
}

.bodega-web-label {
    display: block;
    margin: 0.6rem 0 0.25rem;
    color: #334155;
    font-size: 0.88rem;
}

.bodega-web-modal-actions {
    margin-top: 0.9rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
}

.bodega-web-station-actions {
    margin-top: 0.9rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bodega-web-station-actions .bodega-web-btn {
    flex: 1 1 140px;
}

.bodega-web-btn-cancel {
    background: #64748b;
    border-color: #64748b;
}

.bodega-web-link-btn {
    border: none;
    background: transparent;
    color: #1d4ed8;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 700;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.bodega-web-price-btn {
    border: none;
    border-radius: 0;
    background: transparent;
    color: #1d4ed8;
    cursor: pointer;
    padding: 0;
    font-weight: 700;
    text-decoration: underline;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.bodega-web-detail-wrap {
    margin-top: 0.9rem;
}

.bodega-web-subsection-title {
    margin: 0.2rem 0 0.6rem;
    color: #0f172a;
    font-size: 1.05rem;
}

.bodega-web-collapsible {
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #f8fafc;
    padding: 0.75rem;
}

.bodega-web-collapsible-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0;
    text-align: left;
    font: inherit;
}

.bodega-web-collapsible-toggle .bodega-web-subsection-title {
    margin: 0;
}

.bodega-web-collapsible-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    color: #334155;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    transform-origin: center;
    transition: transform 0.16s ease;
}

.bodega-web-collapsible-toggle[aria-expanded="true"] .bodega-web-collapsible-arrow {
    transform: rotate(90deg);
}

.bodega-web-collapsible-body {
    margin-top: 0.75rem;
}

.bodega-web-price-row {
    margin-top: 0.9rem;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.7rem;
}

.bodega-web-price-row > div {
    flex: 1 1 0;
    min-width: 0;
}

.bodega-web-price-row .bodega-web-price-row-btn {
    flex: 0 0 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.bodega-web-price-row .bodega-web-price-row-btn .bodega-web-btn {
    width: 100%;
}

@media (max-width: 1024px) {
    .bodega-web-title-row {
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
    }

    .bodega-web-title-row .bodega-web-title {
        font-size: 1.05rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .bodega-web-title-row [data-bw-new-btn] {
        width: auto;
        min-width: auto;
        flex: 0 0 auto;
    }

    .bodega-web-title-row .bodega-web-btn-new-icon {
        width: 36px;
        min-width: 36px;
        height: 36px;
        font-size: 1.4rem;
    }

    .bodega-web-search {
        flex-direction: column;
    }

    [data-bw-cliente] .bodega-web-form-grid,
    [data-bw-cliente] .bodega-web-form-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    [data-bw-cliente] .bodega-web-form-grid-3 > div:last-child {
        grid-column: 1 / -1;
    }

    .bodega-web-station-actions .bodega-web-btn {
        flex: 1 1 100%;
    }

    [data-bw-cliente] .bodega-web-price-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
    }

    [data-bw-cliente] .bodega-web-price-row > div {
        min-width: 0;
    }

    [data-bw-cliente] .bodega-web-price-row .bodega-web-price-row-btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    [data-bw-cliente] .bodega-web-price-row .bodega-web-price-row-btn .bodega-web-btn {
        width: 100%;
    }

    [data-bw-cliente] .bodega-web-budget-actions .bodega-web-btn {
        flex: 1 1 calc(50% - 0.45rem);
    }
}

@media (max-width: 560px) {
    [data-bw-cliente] .bodega-web-form-grid,
    [data-bw-cliente] .bodega-web-form-grid-3,
    [data-bw-cliente] .bodega-web-price-row {
        grid-template-columns: 1fr;
    }

    [data-bw-cliente] .bodega-web-form-grid-3 > div:last-child {
        grid-column: auto;
    }

    [data-bw-cliente] .bodega-web-budget-actions .bodega-web-btn {
        flex: 1 1 100%;
    }
}

.bodega-web-subsection-head { display:flex; align-items:center; justify-content:space-between; gap:0.6rem; }

.bodega-web-budget-actions {
    margin-top: 0.7rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.bodega-web-budget-actions .bodega-web-btn {
    flex: 0 0 auto;
}

.bodega-web-budget-actions [data-bw-budget-action="crear_cabecera"] {
    background: #1e3a8a;
    border-color: #1e3a8a;
}

.bodega-web-budget-actions [data-bw-budget-action="crear_excel"] {
    background: #15803d;
    border-color: #15803d;
}

.bodega-web-budget-actions [data-bw-budget-action="crear_pdf"] {
    background: #b91c1c;
    border-color: #b91c1c;
}

.bodega-web-budget-actions [data-bw-budget-action="registrar_venta"] {
    background: tomato;
    border-color: tomato;
}

.bodega-web-budget-actions [data-bw-budget-action="crar_xml"] {
    background: #7c3aed;
    border-color: #7c3aed;
}

.bodega-web-budget-actions [data-bw-budget-action="recuperar_pedido_woo"] {
    background: #8b5a2b;
    border-color: #8b5a2b;
}

/* Resaltado visual de campos clave en bw_cliente para uso rapido en movil */
[data-bw-cliente] label.bodega-web-label[for="bw-producto-search"] {
    color: #7a1f1f;
    font-weight: 700;
}

[data-bw-cliente] #bw-producto-search {
    color: #7a1f1f;
    background: #fffbe8;
    border-color: #e8d7a6;
    font-size: 1.02rem;
    font-weight: 600;
}

[data-bw-cliente] label.bodega-web-label[for="bw-precio-elegido"] {
    color: #1d4ed8;
    font-weight: 700;
}

[data-bw-cliente] #bw-precio-elegido {
    color: #1d4ed8;
    background: #eef4ff;
    border-color: #bfd3ff;
    font-size: 1.06rem;
    font-weight: 700;
}

[data-bw-cliente] label.bodega-web-label[for="bw-precio-final"] {
    color: #7a1f1f;
    font-weight: 700;
}

[data-bw-cliente] #bw-precio-final {
    color: #7a1f1f;
    background: #fff1f5;
    border-color: #f3bfd0;
    font-size: 1.06rem;
    font-weight: 700;
}

[data-bw-cliente] label.bodega-web-label[for="bw-cantidad-producto"] {
    color: #5b3a29;
    font-weight: 700;
}

[data-bw-cliente] #bw-cantidad-producto {
    color: #5b3a29;
    background: #fff0ea;
    border-color: #f1c7b9;
    font-size: 1.04rem;
    font-weight: 700;
}

[data-bw-cliente] #bw-producto-search:focus,
[data-bw-cliente] #bw-precio-elegido:focus,
[data-bw-cliente] #bw-precio-final:focus,
[data-bw-cliente] #bw-cantidad-producto:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

[data-bw-cliente] #bw-producto-search:focus {
    border-color: #cfb46b;
}

[data-bw-cliente] #bw-precio-elegido:focus {
    border-color: #7ea7ff;
}

[data-bw-cliente] #bw-precio-final:focus {
    border-color: #e88eac;
}

[data-bw-cliente] #bw-cantidad-producto:focus {
    border-color: #df9b84;
}

[data-bw-float-top].bodega-web-float-top {
    position: fixed;
    right: 14px;
    bottom: 18px;
    z-index: 9998;
    border: 1px solid #0f766e;
    background: #0f766e;
    color: #ffffff;
    border-radius: 999px;
    padding: 0.55rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

[data-bw-float-top].bodega-web-float-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

[data-bw-float-top] .bodega-web-float-top-arrow {
    font-size: 1.05em;
    line-height: 1;
}

@media (max-width: 768px) {
    [data-bw-float-top].bodega-web-float-top {
        position: fixed !important;
        z-index: 99999 !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        right: 12px;
        bottom: 14px;
        padding: 0.5rem 0.62rem;
        font-size: 1.05rem;
        border-radius: 999px;
        min-width: 42px;
        min-height: 42px;
    }

    [data-bw-float-top] .bodega-web-float-top-arrow {
        font-size: 1.2em;
    }

    [data-bw-float-top] .bodega-web-float-top-text {
        display: none;
    }
}
