/* Baita Checkout — B2B variable product grid */

.bc-product-grid {
    margin: 0 0 16px;
    width: 100%;
    position: relative;
}

.bc-product-grid__scroll-hint {
    display: none;
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.bc-product-grid__scroll {
    position: relative;
    overflow-x: scroll;
    overflow-y: auto;
    max-height: min(280px, 40vh);
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    /* Force a visible gutter for the horizontal bar */
    padding-bottom: 2px;
    scrollbar-gutter: stable;
    scrollbar-width: auto;
    scrollbar-color: var(--bc-accent, #10B981) #e2e8f0;
}

/* WebKit / Blink / mobile Chrome — thick, always-painted scrollbar */
.bc-product-grid__scroll::-webkit-scrollbar {
    height: 10px;
    width: 10px;
    -webkit-appearance: none;
    display: block;
}

.bc-product-grid__scroll::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 0 0 10px 10px;
}

.bc-product-grid__scroll::-webkit-scrollbar-thumb {
    background: var(--bc-accent, #10B981);
    border-radius: 999px;
    border: 2px solid #e2e8f0;
    min-width: 40px;
}

.bc-product-grid__scroll::-webkit-scrollbar-thumb:hover {
    background: var(--bc-primary, #0f172a);
}

/* Fade on the right edge = “tem mais conteúdo” */
.bc-product-grid__scroll-wrap {
    position: relative;
}

.bc-product-grid__scroll-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 10px;
    width: 28px;
    pointer-events: none;
    border-radius: 0 10px 0 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(15, 23, 42, 0.12));
    opacity: 1;
    transition: opacity .2s ease;
    z-index: 2;
}

.bc-product-grid__scroll-wrap.is-scrolled-end::after {
    opacity: 0;
}

.bc-product-grid__table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 1.25;
    color: #1e293b;
}

.bc-product-grid__table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 6px 10px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.bc-product-grid__table tbody td {
    padding: 3px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    height: auto;
}

.bc-product-grid__table tbody tr:last-child td {
    border-bottom: 0;
}

.bc-product-grid__table tbody tr:hover {
    background: #fafbfc;
}

.bc-product-grid__table tbody tr.is-unavailable {
    opacity: 0.55;
}

/* Kill Woodmart / theme capitalize on everything inside the grid */
.bc-product-grid,
.bc-product-grid *,
.bc-product-grid .button,
.bc-product-grid button,
.bc-product-grid .bc-product-grid__submit,
.bc-product-grid .bc-waitlist__toggle,
.bc-product-grid .bc-waitlist__submit,
.bc-product-grid .bc-product-grid__attr-label {
    text-transform: none !important;
    letter-spacing: normal !important;
}

.bc-product-grid__table thead th {
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
}

.bc-product-grid__attr-inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.bc-product-grid__swatch {
    flex: 0 0 auto;
    width: 14px !important;
    height: 14px !important;
    min-width: 14px;
    min-height: 14px;
    border-radius: 50% !important;
    display: inline-block !important;
    border: 1px solid rgba(15, 23, 42, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    background-clip: padding-box;
    box-sizing: border-box;
}

.bc-product-grid__attr-label {
    min-width: 0;
    word-break: break-word;
    font-size: 12px;
    line-height: 1.2;
}

.bc-product-grid__sku {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    color: #475569;
    white-space: nowrap;
}

.bc-product-grid__price {
    white-space: nowrap;
    font-weight: 600;
    font-size: 12px;
}

.bc-product-grid__price .amount,
.bc-product-grid__price .woocommerce-Price-amount {
    font-size: 12px !important;
}

.bc-product-grid__stock-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    line-height: 1.2;
    white-space: nowrap;
    text-transform: none !important;
}

.bc-product-grid__stock-label.bc-stock-in-stock {
    background: #ecfdf5;
    color: #047857;
}

.bc-product-grid__stock-label.bc-stock-low-stock {
    background: #fffbeb;
    color: #b45309;
}

.bc-product-grid__stock-label.bc-stock-out-of-stock {
    background: #fef2f2;
    color: #b91c1c;
}

.bc-product-grid__stock-label.bc-stock-on-backorder {
    background: #eff6ff;
    color: #1d4ed8;
}

.bc-product-grid__qty-cell {
    width: 72px;
}

.bc-product-grid input.bc-product-grid__qty,
.bc-product-grid .bc-product-grid__qty.input-text,
.bc-product-grid .bc-product-grid__qty.qty,
.bc-product-grid .bc-product-grid__qty {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    margin: 0 !important;
    padding: 0 6px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    text-align: center !important;
    box-sizing: border-box !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 28px !important;
    color: #0f172a !important;
    background: #fff !important;
    box-shadow: none !important;
    vertical-align: middle !important;
    -moz-appearance: textfield;
    appearance: textfield;
}

.bc-product-grid input.bc-product-grid__qty::-webkit-outer-spin-button,
.bc-product-grid input.bc-product-grid__qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bc-product-grid__qty:focus {
    outline: none !important;
    border-color: var(--bc-accent, #10B981) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bc-accent, #10B981) 22%, transparent) !important;
}

/* Compact Avise-me inside grid rows */
.bc-product-grid__waitlist {
    display: flex;
    align-items: center;
}

.bc-product-grid__waitlist .bc-waitlist {
    margin: 0;
}

.bc-product-grid__waitlist .bc-waitlist__toggle,
.bc-product-grid__waitlist .bc-waitlist__submit,
.bc-product-grid .bc-waitlist__toggle.button {
    min-height: 30px !important;
    height: 30px !important;
    line-height: 28px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    margin: 0 !important;
    white-space: nowrap;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.bc-product-grid__waitlist .bc-waitlist__form,
.bc-product-grid__waitlist .bc-waitlist__row {
    margin: 0;
    gap: 6px;
}

.bc-product-grid__waitlist .bc-waitlist__email {
    min-height: 30px;
    height: 30px;
    padding: 0 8px;
    font-size: 11px;
    line-height: 30px;
}

.bc-product-grid__actions {
    display: flex;
    align-items: stretch;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.bc-product-grid button.bc-product-grid__submit,
.bc-product-grid .bc-product-grid__submit.button,
.bc-product-grid .bc-product-grid__submit.button.alt,
.bc-product-grid .button.bc-product-grid__submit {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 12px 22px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: var(--bc-accent, #10B981) !important;
    color: #fff !important;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-shadow: none !important;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--bc-accent, #10B981) 28%, transparent) !important;
    cursor: pointer !important;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, background-color .15s ease !important;
}

.bc-product-grid button.bc-product-grid__submit:hover,
.bc-product-grid .bc-product-grid__submit.button:hover,
.bc-product-grid .bc-product-grid__submit.button.alt:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
    background: var(--bc-accent, #10B981) !important;
    color: #fff !important;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--bc-accent, #10B981) 36%, transparent) !important;
}

.bc-product-grid button.bc-product-grid__submit:disabled,
.bc-product-grid .bc-product-grid__submit:disabled {
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
}

.bc-product-grid__message {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: none !important;
}

.bc-product-grid__message.is-success {
    color: #047857;
}

.bc-product-grid__message.is-error {
    color: #b91c1c;
}

/*
 * Hide retail variation UI when the B2B grid is active.
 * Grid renders outside form.cart (before_add_to_cart_form), so body class + siblings are required.
 */
/* Hide retail ATC only when the B2B grid is actually on the page. */
body.bc-product-grid-active:has(.bc-product-grid) form.cart,
body.bc-product-grid-active:has(.bc-product-grid) form.variations_form,
body.bc-product-grid-active:has(.bc-product-grid) .variations_form,
body.bc-product-grid-active:has(.bc-product-grid) .woocommerce-variation-add-to-cart,
body.bc-product-grid-active:has(.bc-product-grid) .single_variation_wrap,
body.bc-product-grid-active:has(.bc-product-grid) .wd-swatches-product,
body.bc-product-grid-active:has(.bc-product-grid) .wd-swatches-single,
body.bc-product-grid-active:has(.bc-product-grid) .wd-buy-now-btn,
body.bc-product-grid-active:has(.bc-product-grid) .wd-buy-now-button,
body.bc-product-grid-active:has(.bc-product-grid) .wd-add-btn-replace,
body.bc-product-grid-active:has(.bc-product-grid) .cart-wrapper > .variations,
body.bc-product-grid-active:has(.bc-product-grid) .product-design-default .variations,
.bc-product-grid ~ form.cart,
.bc-product-grid ~ form.variations_form,
.bc-product-grid ~ .variations_form,
.bc-product-grid ~ .single_variation_wrap,
.bc-product-grid ~ .wd-buy-now-btn,
.bc-product-grid ~ .wd-buy-now-button {
    display: none !important;
}

@media (max-width: 768px) {
    .bc-product-grid__scroll-hint {
        display: block;
    }

    .bc-product-grid__scroll {
        max-height: min(240px, 38vh);
        /* Extra bottom space so the horizontal bar never covers the last row */
        padding-bottom: 4px;
        scrollbar-width: auto;
    }

    .bc-product-grid__scroll::-webkit-scrollbar {
        height: 12px;
        display: block !important;
        -webkit-appearance: none;
    }

    .bc-product-grid__scroll::-webkit-scrollbar-thumb {
        background: var(--bc-accent, #10B981);
        border: 2px solid #e2e8f0;
        border-radius: 999px;
        min-width: 48px;
    }

    .bc-product-grid__table {
        font-size: 11px;
        min-width: 520px;
    }

    .bc-product-grid__table thead th,
    .bc-product-grid__table tbody td {
        padding: 3px 8px;
    }
}
