/* ========================================
   B2B Catalog Table — Tienda Zacarias
   ======================================== */

/* ----------------------------------------
   CSS Custom Properties (local overrides)
   ---------------------------------------- */
:root {
    --b2b-navy:      #1C1C1C;
    --b2b-gold:      #C5A059;
    --b2b-gold-light: #B08D4B;
    --b2b-gray-50:   #F8F9FA;
    --b2b-gray-100:  #E0E0E0;
    --b2b-gray-600:  #757575;   
    --b2b-text:      #333333;
    --b2b-success:   #28A745;
    --b2b-danger:    #DC3545;
    --radius-sm:     2px;
}

/* ----------------------------------------
   1. Catalog page & layout
   ---------------------------------------- */
.catalog-page {
    background: var(--b2b-gray-50);
    min-height: 100vh;
    font-family: 'DM Sans', sans-serif;
}

.catalog-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    box-sizing: border-box;
}

.catalog-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

/* ----------------------------------------
   1b. Hero / catalog header
   ---------------------------------------- */
.catalog-hero {
    margin: 0 0 1.75rem;
    padding: 3.5rem 2rem 3rem;
    background:
        radial-gradient(1200px 400px at 50% -10%, rgba(197, 160, 89, 0.09), transparent 60%),
        linear-gradient(180deg, #FFFFFF 0%, #FAF7F1 100%);
    border: 1px solid var(--b2b-gray-100);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 0 0 1px rgba(0, 0, 0, 0.04);
    text-align: center;
}

.catalog-hero__inner {
    max-width: 860px;
    margin: 0 auto;
}

.catalog-hero__title {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(1.75rem, 2.5vw + 1rem, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--b2b-navy);
    margin: 0 0 0.5rem;
}

.catalog-hero__title::after {
    content: '';
    display: block;
    width: 56px;
    height: 2px;
    margin: 0.875rem auto 0;
    background: var(--b2b-gold);
    border-radius: 2px;
}

.catalog-hero__subtitle {
    font-size: clamp(1rem, 0.5vw + 0.9rem, 1.1875rem);
    font-weight: 500;
    color: var(--b2b-gold);
    letter-spacing: 0.03em;
    margin: 1.25rem 0 1rem;
}

.catalog-hero__lede {
    font-size: 0.9375rem;
    line-height: 1.75;
    color: var(--b2b-gray-600);
    max-width: 760px;
    margin: 0 auto 1rem;
}

.catalog-hero__tagline {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--b2b-navy);
    margin: 0.5rem 0 0;
}

/* Safety net: hide any WC default header if a plugin re-injects it */
.b2b-main-content .woocommerce-products-header,
.b2b-main-content .woocommerce-products-header__title {
    display: none !important;
}

/* ----------------------------------------
   2. Sidebar & Filters
   ---------------------------------------- */
.filters-sidebar {
    width: 250px;
    flex-shrink: 0;
    font-family: 'DM Sans', sans-serif;
}

.filters-panel {
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.06);
    padding: 1.25rem;
    position: sticky;
    top: 1.5rem;
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--b2b-gray-100);
}

.filters-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--b2b-navy);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    font-family: 'DM Sans', sans-serif;
}

.filters-reset {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.75rem;
    color: var(--b2b-gray-600);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    text-decoration: underline;
    transition: color 0.15s;
}

.filters-reset:hover {
    color: var(--b2b-danger);
}

.filter-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--b2b-gray-100);
}

.filter-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-section-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--b2b-navy);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.625rem 0;
    font-family: 'DM Sans', sans-serif;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-options.scrollable {
    max-height: 192px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.filter-options.scrollable::-webkit-scrollbar {
    width: 4px;
}

.filter-options.scrollable::-webkit-scrollbar-track {
    background: var(--b2b-gray-50);
    border-radius: 2px;
}

.filter-options.scrollable::-webkit-scrollbar-thumb {
    background: var(--b2b-gray-100);
    border-radius: 2px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--b2b-text);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    line-height: 1.3;
}

.filter-option input[type="checkbox"] {
    accent-color: var(--b2b-navy);
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.filter-option span {
    flex: 1;
}

.filter-option .filter-count {
    color: var(--b2b-gray-600);
    font-size: 0.75rem;
    font-weight: 400;
}

/* --- Category hierarchy --- */
.filter-option--parent span {
    font-weight: 600;
}

.filter-children {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding-left: 1.25rem;
    margin-left: 0.25rem;
    border-left: 2px solid var(--b2b-gray-100);
}

.filter-option--child span {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--b2b-gray-600);
}

/* ----------------------------------------
   3. Toolbar
   ---------------------------------------- */
.toolbar {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 560px) 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid var(--b2b-gray-100);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.toolbar-count {
    margin: 0;
    font-size: 0.875rem;
    color: var(--b2b-gray-600);
    font-family: 'DM Sans', sans-serif;
    white-space: nowrap;
    justify-self: start;
}

.toolbar-count .b2b-product-count {
    font-weight: 700;
    color: var(--b2b-navy);
}

/* Legacy: .toolbar-count strong for any inline bold */
.toolbar-count strong {
    color: var(--b2b-navy);
    font-weight: 600;
}

.search-wrapper {
    position: relative;
    justify-self: stretch;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--b2b-gray-600);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--b2b-gray-100);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--b2b-navy);
    background: var(--b2b-gray-50);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--b2b-gold);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.18);
}

.search-input::placeholder {
    color: var(--b2b-gray-600);
    font-size: 0.875rem;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    background: #fff;
    border: 1px solid var(--b2b-gray-100);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: var(--b2b-navy);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    justify-self: end;
}

.btn-export:hover {
    background: var(--b2b-gray-50);
    border-color: var(--b2b-gold);
    color: var(--b2b-navy);
    text-decoration: none;
}

/* ----------------------------------------
   4. Products table
   ---------------------------------------- */
.products-table-wrapper {
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.06);
    border: 1px solid #E5E7EB;
    overflow: hidden;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    font-family: 'DM Sans', sans-serif;
    line-height: 1.4;
    color: var(--b2b-text);
    table-layout: fixed;
}

.products-table .col-img     { width: 64px; }
.products-table .col-details { width: auto; }
.products-table .col-ean     { width: 120px; }
.products-table .col-gender  { width: 80px; }
.products-table .col-volume  { width: 80px; }
.products-table .col-price   { width: 110px; }
.products-table .col-stock   { width: 70px; }
.products-table .col-qty     { width: 120px; }
.products-table .col-total   { width: 110px; white-space: nowrap; }

.products-table .b2b-line-total,
.products-table .price-discounted,
.products-table .price-original,
.products-table .price-regular {
    font-variant-numeric: tabular-nums;
}

.products-table thead {
    background: linear-gradient(180deg, #1C1C1C 0%, #2A2A2A 100%);
}

.products-table thead th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #F5EFE0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    white-space: nowrap;
    border-bottom: 2px solid var(--b2b-gold);
    position: relative;
}

.products-table thead th + th {
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.04);
}

.products-table tbody tr {
    border-top: 1px solid #EDEAE3;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.products-table tbody tr:first-child {
    border-top: none;
}

.products-table tbody tr:nth-child(odd) {
    background-color: #FDFBF7;
}

.products-table tbody tr:hover {
    background-color: #FAF3E3;
    box-shadow: inset 3px 0 0 var(--b2b-gold);
}

.products-table td {
    padding: 14px 16px;
    vertical-align: middle;
}

/* Text alignment helpers */
.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

/* ----------------------------------------
   5. Product cells
   ---------------------------------------- */

/* Product image */
.product-image {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    display: block;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #E8E3D8;
    padding: 3px;
    box-sizing: content-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
}

/* Product type / concentration pill (e.g. "EDP", "EDT") */
.product-type {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1;
    padding: 0.2rem 0.45rem;
    margin-bottom: 0.3rem;
    border-radius: 3px;
    background: rgba(197, 160, 89, 0.12);
    color: #8A6820;
    border: 1px solid rgba(197, 160, 89, 0.25);
}

/* Brand name */
.product-brand {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--b2b-navy);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
    line-height: 1.3;
}

/* Product name */
.product-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #2D2D2D;
    display: block;
    line-height: 1.35;
    margin-top: 0.1rem;
}

.product-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.product-name a:hover {
    color: var(--b2b-gold);
}

/* =============================================================
   PRODUCT BADGES — shown at top of col-details (Catalog table)
   Priority: Oferta > Best Seller > Nuevo (only one per product)
   ============================================================= */
.product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.35rem;
}

.product-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.625rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.06em;
    border-radius: 5px;
    white-space: nowrap;
}

.product-badge--oferta {
    background-color: #DC143C;
    color: #FFFFFF;
}

.product-badge--best-seller {
    background-color: #FFC107;
    color: #000000;
}

.product-badge--nuevo {
    background-color: #1E6FEB;
    color: #FFFFFF;
}

/* EAN / barcode — DM Sans con dígitos tabulares para alineación de columna */
.product-ean {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--b2b-gray-600);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

/* Product attributes (size, gender, etc.) */
.product-attrs {
    font-size: 0.6875rem;
    color: var(--b2b-gray-600);
    line-height: 1.4;
    margin-top: 0.125rem;
}

/* Gender / volume cells — subtle capsule */
td.col-gender,
td.col-volume {
    font-size: 0.8125rem;
    color: var(--b2b-gray-600);
    white-space: nowrap;
}

td.col-gender:not(:empty)::after,
td.col-volume:not(:empty)::after {
    content: '';
}

/* Price: original (crossed out) */
.price-original {
    font-size: 0.75rem;
    color: #A0A0A0;
    text-decoration: line-through;
    text-align: right;
    display: block;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

/* Price: discounted / sale price */
.price-discounted {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #166534;
    text-align: right;
    display: block;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

/* Price: regular (no discount) */
.price-regular,
td.col-price .price-discounted:only-child {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--b2b-navy);
    text-align: right;
    display: block;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

/* Stock badges */
.stock-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    font-family: 'DM Sans', sans-serif;
}

.stock-badge.stock-high {
    background: #DCFCE7;
    color: #166534;
}

.stock-badge.stock-low {
    background: #FEF9C3;
    color: #854D0E;
}

.stock-badge.stock-out {
    background: #FEE2E2;
    color: #991B1B;
}

.stock-badge.stock-plus {
    background: #FFC107;
    color: #1B2A4A;
}

/* Quantity control */
.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #D4CEBC;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.qty-btn {
    width: 28px;
    height: 32px;
    border: none;
    background: #F5F0E8;
    color: var(--b2b-navy);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    font-family: 'DM Sans', sans-serif;
}

.qty-btn:hover {
    background: var(--b2b-gold);
    color: #fff;
}

.qty-btn:active {
    background: var(--b2b-gold-light);
    color: #fff;
}

.qty-input {
    width: 44px;
    height: 32px;
    border: none;
    border-left: 1px solid #D4CEBC;
    border-right: 1px solid #D4CEBC;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    font-variant-numeric: tabular-nums;
    color: var(--b2b-navy);
    -moz-appearance: textfield;
    padding: 0;
    background: #fff;
    transition: background 0.15s;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input:focus {
    outline: none;
    background: #FFFBF2;
}

/* --- Stock cap feedback ------------------------------------------------- */

.qty-control {
    position: relative;
}

.qty-cap-hint {
    position: absolute;
    left: 50%;
    top: calc(100% + 4px);
    transform: translate(-50%, -4px);
    background: var(--b2b-navy);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    padding: 4px 8px;
    border-radius: var(--radius-sm, 4px);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 5;
}

.qty-cap-hint.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.b2b-catalog-row.is-capped .qty-control,
tr.is-capped .qty-control {
    box-shadow: 0 0 0 2px var(--b2b-danger, #dc3545);
    transition: box-shadow 0.2s;
}

/* Per-row inline error returned by the batch add-to-cart endpoint */
.b2b-row-error {
    margin-top: 6px;
    padding: 4px 8px;
    background: #FDECEC;
    border-left: 3px solid var(--b2b-danger, #dc3545);
    color: var(--b2b-danger, #dc3545);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.35;
    border-radius: 2px;
    text-align: left;
    white-space: normal;
}

.b2b-catalog-row.has-error,
tr.has-error {
    background-color: rgba(220, 53, 69, 0.04);
}

/* Cart button error state (network failure) */
.btn-add-cart.has-error {
    background: var(--b2b-danger, #dc3545) !important;
    color: #fff !important;
}

@media (prefers-reduced-motion: reduce) {
    .qty-cap-hint {
        transition: none;
    }
    .b2b-catalog-row.is-capped .qty-control,
    tr.is-capped .qty-control {
        transition: none;
    }
}

/* Row total */
.row-total {
    font-size: 0.9375rem;
    font-weight: 700;
    text-align: right;
    color: var(--b2b-navy);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ----------------------------------------
   6. Request banner
   ---------------------------------------- */
.request-banner {
    background: linear-gradient(to right, #FDFBF7, #F9F4E8);
    border: 1px solid #E8D8B0;
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.request-banner-text {
    font-size: 0.875rem;
    color: var(--b2b-text);
    font-family: 'DM Sans', sans-serif;
    line-height: 1.4;
}

.request-banner-text strong {
    color: var(--b2b-navy);
    font-weight: 600;
}

.btn-request {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid var(--b2b-gold);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: var(--b2b-gold-light);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.btn-request:hover {
    background: var(--b2b-gold);
    color: #fff;
    text-decoration: none;
}

/* ----------------------------------------
   7. Floating cart bar
   ---------------------------------------- */
.floating-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--b2b-navy);
    color: #fff;
    z-index: 50;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    font-family: 'DM Sans', sans-serif;
}

.floating-cart.is-visible {
    display: block;
}

.floating-cart-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.floating-cart-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.floating-cart-count {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.floating-cart-count strong {
    color: var(--b2b-gold);
    font-weight: 700;
}

.floating-cart-total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--b2b-gold);
}

.floating-cart-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.25rem;
}

.floating-cart-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-add-cart {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1.25rem;
    background: var(--b2b-gold);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    color: var(--b2b-navy);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
}

.btn-add-cart:hover {
    background: var(--b2b-gold-light);
}

.btn-add-cart:active {
    transform: scale(0.98);
}

.btn-add-cart .btn-icon {
    color: var(--b2b-navy);
    display: flex;
    align-items: center;
}

.btn-add-cart:disabled,
.btn-add-cart.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.floating-cart-view-link {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'DM Sans', sans-serif;
    transition: color 0.15s;
}

.floating-cart-view-link:hover {
    color: #fff;
}

/* ----------------------------------------
   8. Mobile filter toggle
   ---------------------------------------- */
.mobile-filter-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: #fff;
    border: 1px solid var(--b2b-gray-100);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: var(--b2b-navy);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: background 0.15s;
}

.mobile-filter-toggle:hover {
    background: var(--b2b-gray-50);
}

/* ----------------------------------------
   10. B2B main content area
   ---------------------------------------- */
.b2b-main-content {
    width: 100%;
    padding: 1rem 2rem;
    box-sizing: border-box;
    font-family: 'DM Sans', sans-serif;
}

/* Legacy classes kept for backward compatibility */
.b2b-catalog-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.b2b-catalog-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.b2b-catalog-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.b2b-catalog-main {
    flex: 1;
    min-width: 0;
}

/* ----------------------------------------
   9. Responsive — max-width: 1023px
   ---------------------------------------- */
@media (max-width: 1023px) {
    .catalog-layout,
    .b2b-catalog-layout {
        flex-direction: column;
    }

    .filters-sidebar,
    .b2b-catalog-sidebar {
        width: 100%;
        display: none;
    }

    .filters-sidebar.show,
    .b2b-catalog-sidebar.show {
        display: block;
    }

    .mobile-filter-toggle {
        display: inline-flex;
    }

    .catalog-hero {
        padding: 2.25rem 1.25rem 2rem;
    }

    .catalog-hero__title {
        font-size: 1.75rem;
    }

    .toolbar {
        grid-template-columns: 1fr;
        row-gap: 0.75rem;
        padding: 0.875rem 1rem;
    }

    .toolbar-count {
        justify-self: stretch;
    }

    .search-wrapper {
        width: 100%;
        justify-self: stretch;
    }

    .btn-export {
        justify-self: stretch;
    }

    .filters-panel {
        position: static;
    }
}

/* ----------------------------------------
   Responsive — max-width: 768px
   ---------------------------------------- */
@media (max-width: 768px) {
    .b2b-main-content {
        padding: 0.75rem 0.5rem;
    }

    .catalog-container {
        padding: 0.75rem 0.5rem;
    }

    .products-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Let table fit screen width — no min-width forcing horizontal scroll */
    .products-table {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
    }

    /* Hide less critical columns on small screens */
    .col-ean,
    .col-gender,
    .col-volume,
    .col-total {
        display: none !important;
    }

    /* Hide "Imagen" header label — column stays, just no text */
    .products-table thead th.col-img {
        font-size: 0 !important;
        padding: 4px !important;
    }

    /* Compact image */
    .col-img {
        width: 40px;
        padding: 4px 8px 4px 4px !important;
    }

    .col-img .product-image {
        width: 36px;
        height: 36px;
    }

    /* Details takes most space */
    .col-details {
        width: auto;
        padding: 6px 4px 6px 6px !important;
    }

    .col-details .product-name {
        font-size: 0.8rem;
    }

    .col-details .product-brand,
    .col-details .product-type {
        font-size: 0.7rem;
    }

    /* Price compact */
    .col-price {
        width: 65px;
        padding: 6px 2px !important;
        font-size: 0.8rem;
    }

    /* Stock compact */
    .col-stock {
        width: 40px;
        padding: 6px 2px !important;
    }

    /* Qty compact */
    .col-qty {
        width: 100px;
        padding: 6px 2px !important;
    }

    .col-qty .qty-control {
        max-width: 100%;
        justify-content: center;
    }

    .col-qty .qty-btn {
        width: 24px;
        height: 28px;
    }

    .col-qty .qty-input,
    .col-qty .b2b-qty-input {
        width: 36px;
        height: 28px;
    }

    .floating-cart-inner {
        padding: 0.625rem 1rem;
        flex-wrap: wrap;
    }

    .floating-cart-info {
        gap: 1rem;
    }

    .request-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .btn-export {
        width: 100%;
        justify-content: center;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .col-stock {
        display: none !important;
    }

    .col-qty {
        width: 88px;
    }

    .col-price {
        width: 55px;
        font-size: 0.75rem;
    }
}

/* ----------------------------------------
   Quantity input — legacy class aliases
   ---------------------------------------- */
.b2b-qty-wrapper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--b2b-gray-100);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
}

.b2b-qty-btn {
    width: 28px;
    height: 30px;
    border: none;
    background: var(--b2b-gray-50);
    color: var(--b2b-navy);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
    font-family: 'DM Sans', sans-serif;
}

.b2b-qty-btn:hover {
    background: var(--b2b-gray-100);
}

.b2b-qty-input {
    width: 40px;
    height: 30px;
    border: none;
    border-left: 1px solid var(--b2b-gray-100);
    border-right: 1px solid var(--b2b-gray-100);
    text-align: center;
    font-size: 0.8125rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--b2b-navy);
    -moz-appearance: textfield;
    padding: 0;
    background: #fff;
}

.b2b-qty-input::-webkit-inner-spin-button,
.b2b-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add-to-cart buttons (legacy) */
.b2b-add-to-cart {
    background: var(--b2b-gold) !important;
    border-color: var(--b2b-gold) !important;
    color: var(--b2b-navy) !important;
    transition: background 0.15s;
}

.b2b-add-to-cart:hover {
    background: var(--b2b-gold-light) !important;
    border-color: var(--b2b-gold-light) !important;
}

.b2b-add-to-cart.added {
    background: var(--b2b-success) !important;
    border-color: var(--b2b-success) !important;
    color: #fff !important;
}

/* Line total */
.b2b-line-total {
    font-weight: 700;
    white-space: nowrap;
    text-align: right;
    color: var(--b2b-navy);
}

/* Stock badge legacy aliases */
.stock-badge.in-stock {
    background: #DCFCE7;
    color: #166534;
}

.stock-badge.on-backorder {
    background: #FEF9C3;
    color: #854D0E;
}

.stock-badge.out-of-stock {
    background: #FEE2E2;
    color: #991B1B;
}

/* Spin animation for loading states */
@keyframes b2b-spin {
    to { transform: rotate(360deg); }
}

.b2b-add-to-cart.loading::after,
.btn-add-cart.loading::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 0.4em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: b2b-spin 0.5s linear infinite;
    vertical-align: middle;
}

/* ========================================
   Hello Elementor reset.css overrides

   The parent theme's reset.css applies aggressive
   styles to bare elements (button, table td/th, input).
   We use body.b2b prefix for specificity boost.
   ======================================== */

/* --- Table cells: remove reset.css borders & padding --- */
body.b2b .products-table td,
body.b2b .products-table th {
    border: none;
    padding: 12px 16px;
    vertical-align: middle;
    line-height: 1.5;
    background-color: transparent;
}

body.b2b .products-table thead th {
    background: transparent;  /* hereda el gradiente del thead */
    font-size: 0.6875rem;
    font-weight: 700;
    color: #F5EFE0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    white-space: nowrap;
    border-bottom: 2px solid var(--b2b-gold);
    padding: 0.875rem 1rem;
}

body.b2b .products-table tbody tr {
    border-top: 1px solid #EDEAE3;
}

/* --- Buttons: override reset.css #c36 border/color --- */
body.b2b .qty-btn {
    background: #F5F0E8;
    border: none;
    color: var(--b2b-navy);
    padding: 0;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
}

body.b2b .qty-btn:hover,
body.b2b .qty-btn:focus {
    background: var(--b2b-gold);
    color: #fff;
}

body.b2b .filters-reset {
    background: transparent;
    border: 1px solid #D1D5DB;
    color: var(--b2b-text);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

body.b2b .filters-reset:hover,
body.b2b .filters-reset:focus {
    background-color: var(--b2b-gray-50);
    color: var(--b2b-text);
}

body.b2b .btn-export {
    background: #fff;
    border: 1px solid #D1D5DB;
    color: #374151;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

body.b2b .btn-export:hover,
body.b2b .btn-export:focus {
    background-color: var(--b2b-gray-50);
    color: #374151;
}

body.b2b .btn-request {
    background: #fff;
    border: 1px solid var(--b2b-gold);
    color: var(--b2b-navy);
    padding: 8px 24px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
}

body.b2b .btn-request:hover,
body.b2b .btn-request:focus {
    background-color: var(--b2b-gold);
    color: #fff;
}

body.b2b .btn-add-cart {
    background-color: var(--b2b-gold);
    color: var(--b2b-navy);
    border: none;
    padding: 10px 32px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

body.b2b .btn-add-cart:hover,
body.b2b .btn-add-cart:focus {
    background-color: #fff;
    color: var(--b2b-navy);
}

body.b2b .mobile-filter-toggle {
    background: #fff;
    border: 1px solid #E5E7EB;
    color: #374151;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-weight: 500;
    font-size: 0.875rem;
}

body.b2b .mobile-filter-toggle:hover,
body.b2b .mobile-filter-toggle:focus {
    background-color: var(--b2b-gray-50);
    color: #374151;
}

/* --- Inputs: override reset.css width:100%, borders --- */
body.b2b .search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--b2b-gray-100);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9375rem;
    background: var(--b2b-gray-50);
    color: var(--b2b-navy);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

body.b2b .search-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--b2b-gold);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.18);
}

body.b2b .qty-input {
    width: 44px;
    border: none;
    border-left: 1px solid #D4CEBC;
    border-right: 1px solid #D4CEBC;
    border-radius: 0;
    padding: 0;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    outline: none;
    height: 32px;
    background: #fff;
    transition: background 0.15s;
}

body.b2b .qty-input:focus {
    background: #FFFBF2;
    box-shadow: none;
}

/* --- Links inside catalog table --- */
body.b2b .products-table a {
    color: var(--b2b-navy);
    text-decoration: none;
}

body.b2b .products-table a:hover,
body.b2b .products-table a:active {
    color: var(--b2b-gold);
}

body.b2b .products-table .b2b-view-link {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #D1D5DB;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    background: #fff;
    transition: background-color 0.2s, color 0.2s;
}

body.b2b .products-table .b2b-view-link:hover {
    background-color: var(--b2b-gray-50);
    color: var(--b2b-navy);
}

/* --- Checkboxes --- */
body.b2b .filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--b2b-navy);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* ----------------------------------------
   Pagination
   ---------------------------------------- */
body.b2b .woocommerce-pagination {
    margin: 1.5rem 0 0.5rem;
    text-align: center;
}

body.b2b .woocommerce-pagination ul {
    display: inline-flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    border: none;
}

body.b2b .woocommerce-pagination ul li {
    margin: 0;
    padding: 0;
}

body.b2b .woocommerce-pagination ul li a,
body.b2b .woocommerce-pagination ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--b2b-gray-100, #E0E0E0);
    border-radius: var(--radius-sm, 6px);
    background: #fff;
    color: var(--b2b-text, #333);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    cursor: pointer;
}

body.b2b .woocommerce-pagination ul li a:hover {
    background: var(--b2b-gray-50, #F8F9FA);
    border-color: var(--b2b-navy, #1B2A4A);
    color: var(--b2b-navy, #1B2A4A);
}

/* Current / active page */
body.b2b .woocommerce-pagination ul li span.current {
    background: var(--b2b-navy, #1B2A4A);
    border-color: var(--b2b-navy, #1B2A4A);
    color: #fff;
    cursor: default;
}

/* Prev / Next arrows */
body.b2b .woocommerce-pagination ul li a.prev,
body.b2b .woocommerce-pagination ul li a.next {
    font-size: 1rem;
}

/* Dots */
body.b2b .woocommerce-pagination ul li span.dots {
    border: none;
    background: none;
    color: var(--b2b-gray-600, #757575);
    cursor: default;
    min-width: 24px;
    padding: 0;
}
