/* ── Offer / Buy Page ────────────────────────────────────────────────────── */

.bb-offer-page {
    min-height: 60vh;
}

.bb-offer-error {
    color: #888;
    padding: 40px 0;
}

.bb-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 0;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.bb-cart-btn svg {
    vertical-align: middle;
}

.bb-cart-count {
    background: #fff;
    color: var(--brand-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-align: center;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */

.bb-offer-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: start;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.bb-offer-sidebar {
    position: sticky;
    top: 24px;
}

.bb-offer-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bb-offer-nav-btn {
    background: none;
    border: none;
    border-left: 3px solid transparent;
    padding: 10px 14px;
    text-align: left;
    font-size: 14px;
    color: var(--grey-color);
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    border-radius: 0 4px 4px 0;
}

.bb-offer-nav-btn:hover {
    color: #25282a;
    background: #f8f8f8;
}

.bb-offer-nav-btn.active {
    border-left-color: var(--brand-color);
    color: #25282a;
    font-weight: 600;
    background: #f0fafa;
}

/* ── Sections & Products ─────────────────────────────────────────────────── */

.bb-offer-section {
    margin-bottom: 40px;
}

.bb-offer-section-title {
    font-weight: normal;
}

.bb-product-card {
    border: 1px solid #fff;
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .15s;
    background: #fff;
}

.bb-product-card.bb-promoted {
    border-color: var(--brand-color);
}

.bb-product-banner {
    background: var(--brand-color);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 6px 24px;
}

.bb-product-body {
    padding: 24px;
}

.bb-product-name {
    font-weight: 600;
    color: #000;
    margin-bottom: 16px;
}

.bb-product-price {
    margin-bottom: 16px;
}

.bb-price-amount {
    color: #000;
    font-size: 32px;
    line-height: 1.06;
}

.bb-product-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bb-price-qty,
.bb-price-interval,
.bb-product-desc,
.bb-out-of-stock {
    font-size: 14px;
    color: #6C7277;
}

.bb-price-interval {
    font-weight: normal;
}

.bb-out-of-stock {
    font-style: italic;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */

.bb-modal-header {
    background: var(--brand-color);
    color: #fff;
    padding: 24px 48px 24px 24px;
    border-radius: 10px 10px 0 0;
}

.bb-modal-title {
    margin-bottom: 4px;
}

.bb-modal-price {
    font-weight: 400;
}

.bb-modal-body {
    padding: 24px;
}

.bb-modal-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    font-size: 16px;
    gap: 16px 40px;
}

.bb-modal-detail {
    display: flex;
    flex-direction: column;
}

.bb-modal-val {
    font-size: 0.95rem;
    color: #6C7277;
}

.bb-modal-detail-full {
    grid-column: 1 / -1;
}

.bb-modal-detail-full strong {
    display: block;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.bb-modal-detail-full p {
    font-size: 16px;
    margin: 0;
}

.bb-modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
}

/* ── Gift Card Fields ────────────────────────────────────────────────────── */

.bb-gift-card-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 24px;
}

.bb-gift-card-note {
    font-size: 16px;
    color: #000;
    margin-bottom: 0;
}

.bb-modal-field-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ── Modal inline error ──────────────────────────────────────────────────── */

.bb-modal-error {
    margin-top: 14px;
    padding: 10px 14px;
    background: #fff5f5;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c0392b;
    font-size: 0.8rem;
    line-height: 1.5;
}

/* ── Cart Drawer ─────────────────────────────────────────────────────────── */

.bb-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 9998;
}

.bb-cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 360px;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    box-shadow: -4px 0 20px rgba(0,0,0,.15);
    display: flex;
    flex-direction: column;
    transition: right .3s ease;
}

.bb-cart-drawer.open {
    right: 0;
}

.bb-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    gap: 24px;
    border-bottom: 1px solid #f4f4f4;
}

.bb-cart-header h3 {
    margin: 0;
}

.bb-cart-close {
    flex-shrink: 0;
}

.bb-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.bb-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f4f4f4;
    gap: 12px;
}

.bb-cart-item-name {
    font-size: 16px;
    flex: 1;
}

.bb-cart-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.bb-cart-item-price {
    font-weight: 700;
    font-size: 16px;
}

.bb-cart-remove {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--grey-color);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-family: inherit;
}

.bb-cart-remove:hover { color: var(--brand-color); }

.bb-cart-footer {
    padding: 16px 24px;
    border-top: 1px solid #f4f4f4;
}

.bb-cart-total {
    margin-bottom: 14px;
}

/* ── Loading small ───────────────────────────────────────────────────────── */

.bb-loading-sm {
    color: #aaa;
    font-size: 0.875rem;
    padding: 8px 0;
}

body.bb-modal-open,
body.bb-cart-open {
    overflow: hidden;
}

/* ── Studio switcher (offer page) ─────────────────────────────────────────── */

/* Header row (holds the switcher) must outrank the sidebar's stacking context. */
.bb-offer-page .lead.lead--row {
    position: relative;
    z-index: 900;
}

/* Keep the sidebar/layout below the switcher so the dropdown paints on top. */
.bb-offer-page .bb-offer-layout { position: relative; z-index: 1; }
.bb-offer-page .bb-offer-sidebar { position: relative; z-index: 1; }

.bb-region-switcher {
    position: relative;
    display: inline-block;
    z-index: 10;
}

.bb-region-switcher__toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    font-family: inherit;
}
.bb-region-switcher__toggle .title-m,
.bb-region-switcher__title { margin: 0; }

.bb-region-switcher__arrow {
    font-size: 1.4rem;
    line-height: 1;
    color: var(--brand-color, #5cbcb6);
}

.bb-region-switcher__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    min-width: 300px;
    max-width: 340px;
    z-index: 1000;
    overflow: hidden;
}

.bb-region-panel { padding: 18px; }

.bb-region-panel__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.bb-region-panel__label {
    display: block;
    width: 100%;
    font-size: .8rem;
    color: #888;
    margin-bottom: 2px;
}
.bb-region-panel__name { font-size: 1.05rem; font-weight: 700; color: #111; }
.bb-region-panel__change {
    background: none;
    border: none;
    color: var(--brand-color, #5cbcb6);
    font-size: .85rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    white-space: nowrap;
}
.bb-region-panel__back {
    background: none;
    border: none;
    color: var(--brand-color, #5cbcb6);
    font-size: .9rem;
    cursor: pointer;
    padding: 0 0 12px;
}

.bb-region-panel__locations,
.bb-region-panel__regions { display: flex; flex-direction: column; }

.bb-region-location-item,
.bb-region-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    color: #222;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    font-size: .95rem;
    cursor: pointer;
}
.bb-region-location-item:last-child,
.bb-region-item:last-child { border-bottom: none; }
.bb-region-location-item:hover,
.bb-region-item:hover { color: var(--brand-color, #5cbcb6); }

.bb-region-location-item.is-current { font-weight: 700; }
.bb-region-location-current {
    font-size: .75rem;
    color: var(--brand-color, #5cbcb6);
    font-weight: 600;
}
.bb-region-count { color: #999; font-size: .85rem; }

.bb-loading-sm { padding: 12px 4px; color: #999; font-size: .9rem; }

/* ── Buy-page loading state (studio switch + initial load) ───────────────── */
.bb-offer-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 200px;
    color: #555;
    font-size: 15px;
}
.bb-offer-loading-text { font-weight: 500; }

/* Spinner (shared look with the checkout spinner). */
.bb-offer-loading .bb-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: bb-spin 0.6s linear infinite;
}
@keyframes bb-spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .bb-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1023px) {

    .bb-price-amount {
        font-size: 24px;
        line-height: 1.3;
    }
    .bb-product-card {
        border-radius: 16px;
    }
    .bb-offer-label {
        margin-bottom: 8px;
    }
    .bb-offer-layout {
        grid-template-columns: 1fr;
    }

    .bb-offer-sidebar {
        position: static;
    }

    .bb-offer-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .bb-offer-nav-btn {
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: 4px;
        padding: 6px 12px;
        background: #f5f5f5;
    }

    .bb-offer-nav-btn.active {
        border-bottom-color: var(--brand-color);
        background: #f0fafa;
    }

    .bb-cart-drawer {
        width: 100%;
        right: -100%;
    }

    .bb-modal-detail-full strong {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .bb-products-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

@media (max-width: 480px) {
    .bb-modal-details {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 812px) and (max-height: 414px) and (orientation: landscape){
    .bb-cart-items,
    .bb-cart-header,
    .bb-cart-footer {
        padding-left: 50px;
        padding-right: 50px;
    }
}

/* Mobile: the dropdown and cart button share the header — force order there too. */
@media (max-width: 1024px) {
    .bb-offer-page .bb-region-switcher { z-index: 100; }
    .bb-offer-page .bb-region-switcher__dropdown { z-index: 1000 !important; }
    .bb-offer-page .bb-cart-btn,
    .bb-offer-page #bb-cart-toggle { z-index: -1 !important; }
}