/* ============================================
   BESTSELLERS - Premium Redesign
   Desktop: 4x2 open layout (no card containers)
   Mobile: Horizontal swipe carousel
   ============================================ */

.bestsellers-section {
    padding: 80px 0;
    background-color: #F5F3EF;
}

/* ---- Header ---- */
.bestsellers-header {
    text-align: center;
    margin-bottom: 48px;
}

.bestsellers-eyebrow {
    display: block;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 8px;
}

.bestsellers-header h2 {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: 3.2rem;
    font-weight: 400;
    color: #2c2c2c;
    margin: 0;
    line-height: 1.1;
}

/* ---- Carousel wrapper (desktop: horizontal scroll + arrows) ---- */
.bestsellers-carousel {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

/* Arrows hidden by default; shown only on desktop (1025px+) */
.bestsellers-arrow {
    display: none;
}

/* ---- Grid Layout (default + tablet; web 1025px+ uses horizontal scroll) ---- */
.bestsellers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ---- Card (no container bg — open layout) ---- */
.bestseller-card {
    display: flex;
    flex-direction: column;
    position: relative;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    transition: transform 0.3s ease;
}

.bestseller-card:hover {
    transform: translateY(-3px);
}

/* ---- Image ---- */
.bestseller-image-wrapper {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: block;
    border-radius: 16px;
    background-color: #e8e5e0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin-bottom: 14px;
}

.bestseller-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.bestseller-card:hover .bestseller-image-wrapper img {
    transform: scale(1.03);
}

/* ---- Badge ---- */
.badge-small-batch {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #555;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 6px;
    z-index: 2;
}

/* ---- Product Details ---- */
.bestseller-details {
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.bestseller-title {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: 1.3rem;
    font-weight: 500;
    color: #2c2c2c;
    margin: 0 0 4px;
    line-height: 1.25;
}

.bestseller-price {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.85rem;
    color: #888;
    margin: 0 0 14px;
    font-weight: 400;
}

/* ---- Actions ---- */
.bestseller-actions {
    display: flex;
    margin-top: auto;
}

/* Add to Cart — full-width sage/olive pill */
.btn-add-to-cart {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #7C8B6F;
    color: #fff;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 11px 16px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

.btn-add-to-cart:hover {
    background-color: #6a7a5e;
}

/* Arrows: hidden on tablet and mobile; only shown on web (1025px+) */
@media (max-width: 1024px) {
    .bestsellers-arrow {
        display: none !important;
    }
}

/* Tablet (769px – 1024px): 2-column grid, no horizontal scroll, no arrows */
@media (min-width: 769px) and (max-width: 1024px) {
    .bestsellers-section {
        padding: 60px 0;
    }

    .bestsellers-header {
        margin-bottom: 36px;
    }

    .bestsellers-header h2 {
        font-size: 2.6rem;
    }

    .bestsellers-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        padding: 0 28px;
        overflow: visible;
    }

    .bestsellers-grid .ou-product-card {
        min-width: 0;
        max-width: none;
    }
}

@media (max-width: 1024px) {
    .bestsellers-section {
        padding: 60px 0;
    }

    .bestsellers-header {
        margin-bottom: 36px;
    }

    .bestsellers-header h2 {
        font-size: 2.6rem;
    }
}

/* ===========================================
   WEB ONLY (1025px+) — Horizontal scroll, 4 visible, rest scroll; arrows
   No second line; 5th product and beyond scroll horizontally
   =========================================== */
@media (min-width: 1025px) {
    .bestsellers-carousel {
        padding: 0 48px;
    }

    .bestsellers-carousel::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 84px;
        height: 100%;
        pointer-events: none;
        background: linear-gradient(90deg, rgba(245, 243, 239, 0) 0%, rgba(245, 243, 239, 0.7) 65%, rgba(245, 243, 239, 1) 100%);
        z-index: 1;
    }

    .bestsellers-grid {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        gap: 24px;
        padding: 8px 0 16px;
        margin: 0 -8px;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
        scroll-behavior: smooth;
    }

    .bestsellers-grid::-webkit-scrollbar {
        height: 6px;
    }

    .bestsellers-grid::-webkit-scrollbar-track {
        background: transparent;
    }

    .bestsellers-grid::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 3px;
    }

    .bestsellers-grid .ou-product-card {
        flex: 0 0 260px;
        min-width: 260px;
        max-width: 260px;
        scroll-snap-align: start;
    }

    .bestsellers-arrow {
        display: flex;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
        width: 28px;
        height: 28px;
        border: 1px solid rgba(44, 44, 44, 0.12);
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.85);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        color: #555;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
        opacity: 0.85;
    }

    .bestsellers-arrow svg {
        width: 14px;
        height: 14px;
    }

    .bestsellers-arrow:hover {
        background: #fff;
        color: #2c2c2c;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
        opacity: 1;
    }

    .bestsellers-arrow:active {
        transform: translateY(-50%) scale(0.96);
    }

    .bestsellers-arrow-prev {
        left: 4px;
    }

    .bestsellers-arrow-next {
        right: 4px;
    }
}

/* ===========================================
   RESPONSIVE - Mobile (≤ 600px)
   Horizontal swipe carousel — CSS-only snap
   =========================================== */
@media (max-width: 600px) {
    .bestsellers-section {
        padding: 48px 0 56px;
        overflow: hidden;
    }

    .bestsellers-header {
        margin-bottom: 24px;
    }

    .bestsellers-eyebrow {
        font-size: 0.65rem;
        margin-bottom: 6px;
    }

    .bestsellers-header h2 {
        font-size: 2rem;
    }

    /* Switch from grid to horizontal scroll */
    .bestsellers-grid {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 16px;
        padding: 0 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .bestsellers-grid::-webkit-scrollbar {
        display: none;
    }

    /* Each card = ~78% of viewport width, shows ~1.2 cards */
    .bestsellers-grid .ou-product-card {
        flex: 0 0 66%;
        min-width: 66%;
        max-width: 66%;
        scroll-snap-align: center;
        /* Reset margin/gap handling if needed */
        margin: 0;
    }

    .bestseller-image-wrapper {
        aspect-ratio: 4 / 3;
        border-radius: 14px;
    }

    .bestseller-title {
        font-size: 1.1rem;
    }

    .bestseller-price {
        font-size: 0.82rem;
        margin-bottom: 12px;
    }

    .btn-add-to-cart {
        padding: 11px 16px;
        font-size: 0.8rem;
    }
}
