/**
 * Home & Collections Page Sections
 * Premium, modern, mobile-first layouts
 * Dense Flipkart-style layout - more content above fold
 */

/* ============================================
   PREMIUM DENSE LAYOUT – Optimized space, editorial feel
   ============================================ */

/* Hero: compact, premium block with subtle separation */
.hero-text-section {
    padding: var(--space-4) 0 !important;
    background: var(--white) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

@media (min-width: 768px) {
    .hero-text-section {
        padding: var(--space-5) 0 !important;
    }
}

.hero-content {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.hero-title {
    margin-bottom: var(--space-2) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
}

.hero-description {
    margin-bottom: var(--space-4) !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    color: var(--gray-600, #4b5563) !important;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: var(--space-3) !important;
    justify-content: center;
    align-items: center;
}

@media (max-width: 640px) {
    .hero-title {
        font-size: clamp(22px, 5vw, 30px) !important;
        margin-bottom: var(--space-2) !important;
        line-height: 1.2 !important;
    }

    .hero-description {
        font-size: 14px !important;
        margin-bottom: var(--space-3) !important;
    }

    .hero-actions {
        flex-wrap: nowrap !important;
    }

    .hero-actions .btn {
        padding: 10px 16px;
        font-size: 13px;
        min-width: 0;
    }
}

@media (min-width: 768px) {
    .hero-title {
        font-size: clamp(32px, 4vw, 44px) !important;
    }

    .hero-description {
        font-size: 16px !important;
    }
}

/* Banner: minimal vertical footprint */
.banner-section {
    padding: var(--space-2) 0 !important;
}

@media (min-width: 768px) {
    .banner-section {
        padding: var(--space-3) 0 !important;
    }
}

.banner-section .container {
    max-width: 100%;
}

/* Tighter section padding – better flow between blocks */
.section {
    padding: var(--space-5) 0 !important;
}

@media (min-width: 768px) {
    .section {
        padding: var(--space-6) 0 !important;
    }
}

.section-features {
    padding: var(--space-4) 0 !important;
    background: var(--gray-50, #f9fafb);
}

@media (min-width: 768px) {
    .section-features {
        padding: var(--space-5) 0 !important;
    }
}

.section-features .features-grid {
    gap: var(--space-3);
}

@media (min-width: 768px) {
    .section-features .features-grid {
        gap: var(--space-4);
    }
}

.section-features .feature-card {
    padding: var(--space-3);
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-100, #f3f4f6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

@media (min-width: 768px) {
    .section-features .feature-card {
        padding: var(--space-4);
    }
}

@media (max-width: 768px) {
    .section-features .feature-title {
        font-size: 13px;
    }

    .section-features .feature-description {
        font-size: 11px;
    }
}

/* ============================================
   SECTION BASE & SCROLL CONTAINERS
   ============================================ */

.section-header {
    margin-bottom: var(--space-3);
}

@media (min-width: 768px) {
    .section-header {
        margin-bottom: var(--space-4);
    }
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(20px, 4vw, 26px);
    font-weight: 700;
    color: var(--black);
    margin-bottom: var(--space-1);
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: clamp(13px, 2vw, 14px);
    color: var(--gray-500);
    font-weight: 400;
}

/* Horizontal scroll with snap & fade edges */
.scroll-section {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: var(--space-4);
    margin: 0 calc(var(--container-padding) * -1);
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.scroll-section::-webkit-scrollbar {
    display: none;
}

.scroll-section-inner {
    display: flex;
    gap: var(--space-4);
    width: max-content;
    min-width: 100%;
}

/* Scroll wrapper: no gradient smudge on mobile; subtle edge hint on desktop only */
.scroll-section-wrapper {
    position: relative;
}

.scroll-section-wrapper::before,
.scroll-section-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: var(--space-4);
    width: 24px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity var(--transition-base);
}

/* Hide side gradients on mobile to avoid smudge; cards have crisp edges instead */
@media (max-width: 1023px) {
    .scroll-section-wrapper::before,
    .scroll-section-wrapper::after {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .scroll-section-wrapper::before {
        left: 0;
        background: linear-gradient(to right, var(--white) 50%, transparent);
    }

    .scroll-section-wrapper::after {
        right: 0;
        background: linear-gradient(to left, var(--white) 50%, transparent);
    }

    .scroll-section-wrapper.has-scroll-left::before,
    .scroll-section-wrapper.has-scroll-right::after {
        opacity: 1;
    }

    .section-recently-viewed .scroll-section-wrapper::before {
        background: linear-gradient(to right, var(--gray-50) 50%, transparent);
    }

    .section-recently-viewed .scroll-section-wrapper::after {
        background: linear-gradient(to left, var(--gray-50) 50%, transparent);
    }

    .section-featured .scroll-section-wrapper::before {
        background: linear-gradient(to right, rgba(233, 30, 99, 0.98) 50%, transparent);
    }

    .section-featured .scroll-section-wrapper::after {
        background: linear-gradient(to left, rgba(233, 30, 99, 0.98) 50%, transparent);
    }
}

/* ============================================
   1. OUR PRODUCTS (Categories)
   Grid layout - all categories visible on single screen, no horizontal scroll
   ============================================ */

.section-categories {
    position: relative;
    background: var(--white);
    overflow: hidden;
    padding-top: var(--space-4) !important;
    padding-bottom: var(--space-5) !important;
}

@media (min-width: 768px) {
    .section-categories {
        background: linear-gradient(180deg, var(--cream) 0%, var(--white) 100%);
        padding-top: var(--space-5) !important;
        padding-bottom: var(--space-6) !important;
    }

    .section-categories::before {
        content: '';
        position: absolute;
        top: -10%;
        right: -5%;
        width: 40%;
        height: 60%;
        background: radial-gradient(ellipse, rgba(233, 30, 99, 0.05) 0%, transparent 70%);
        pointer-events: none;
    }
}

.section-categories .section-header {
    margin-bottom: var(--space-3);
}

/* Grid: 4 cols mobile; 6 tablet; 8 desktop – consistent gaps */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    width: 100%;
}

@media (min-width: 480px) {
    .categories-grid {
        gap: var(--space-3);
    }
}

@media (min-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: var(--space-4);
    }
}

@media (min-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: var(--space-4);
    }
}

/* Category card – premium, minimal shadow, clear hover */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-100, #f3f4f6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-card:hover {
    border-color: var(--gray-200, #e5e7eb);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.category-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-width: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--beige) 0%, var(--cream) 100%);
}

@media (min-width: 480px) {
    .category-image {
        max-width: 80px;
    }
}

@media (min-width: 768px) {
    .category-image {
        max-width: 100px;
        border-radius: var(--radius-md);
    }
}

@media (min-width: 1024px) {
    .category-image {
        max-width: 120px;
        border-radius: var(--radius-lg);
    }
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.category-card:hover .category-image img {
    transform: scale(1.06);
}

.category-card h3 {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    color: var(--black);
    text-align: center;
    line-height: 1.2;
}

@media (min-width: 480px) {
    .category-card h3 {
        font-size: 11px;
    }
}

@media (min-width: 768px) {
    .category-card h3 {
        font-size: 13px;
    }
}

@media (min-width: 1024px) {
    .category-card h3 {
        font-size: 14px;
    }
}

.category-card:hover h3 {
    color: var(--primary);
}

/* ============================================
   2. NEW ARRIVALS
   Tall portrait cards, large radius, horizontal scroll, slide-in animation
   ============================================ */

.section-new-arrivals {
    background: var(--white);
}

.product-card-tall {
    flex-shrink: 0;
    width: 160px;
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    position: relative;
    scroll-snap-align: start;
}

@media (min-width: 480px) {
    .product-card-tall {
        width: 180px;
    }
}

@media (min-width: 768px) {
    .product-card-tall {
        width: 200px;
    }
}

.product-card-tall:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.product-card-tall .card-image {
    position: relative;
    width: 100%;
    padding-top: 145%;
    background: var(--gray-50);
    overflow: hidden;
}

.product-card-tall .card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card-tall:hover .card-image img {
    transform: scale(1.05);
}

.product-card-tall .card-info {
    padding: var(--space-3);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-tall .card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--black);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-tall .card-price {
    margin-top: auto;
    padding-top: var(--space-2);
}

/* New Arrivals: vertical grid – 2 per row on mobile, 4–6 on larger screens */
.section-new-arrivals .new-arrivals-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.section-new-arrivals .product-card-tall {
    width: 100%;
}

@media (min-width: 768px) {
    .section-new-arrivals .new-arrivals-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .section-new-arrivals .new-arrivals-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1440px) {
    .section-new-arrivals .new-arrivals-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.new-arrivals-cta-row {
    margin-top: var(--space-5);
    display: flex;
    justify-content: center;
}

.new-arrivals-see-more {
    min-width: 160px;
}

/* ============================================
   3. TOP SELLING
   Compact cards, Popular badge, horizontal scroll on mobile, 2-3 col grid on desktop
   ============================================ */

.section-top-selling {
    background: var(--gray-50);
}

.product-card-compact {
    flex-shrink: 0;
    width: 150px;
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    position: relative;
    scroll-snap-align: start;
}

@media (min-width: 480px) {
    .product-card-compact {
        width: 170px;
    }
}

.product-card-compact:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.product-card-compact .card-image {
    position: relative;
    width: 100%;
    padding-top: 115%;
    background: var(--gray-50);
}

.product-card-compact .card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-popular {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    padding: 4px 8px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.product-card-compact .card-info {
    padding: var(--space-2) var(--space-3);
}

.product-card-compact .card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--black);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-compact .card-price {
    margin-top: var(--space-1);
}

.product-card-compact .current-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
}

.product-card-compact .original-price {
    font-size: 12px;
    color: var(--gray-400);
    text-decoration: line-through;
    margin-left: var(--space-1);
}

/* Desktop: 2-3 col grid */
@media (min-width: 1024px) {
    .section-top-selling .scroll-section {
        overflow: visible;
        margin: 0;
        padding: 0;
        scroll-snap-type: none;
    }

    .section-top-selling .scroll-section-inner {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
    }

    .product-card-compact {
        width: 100%;
    }

    .section-top-selling .scroll-section-wrapper::before,
    .section-top-selling .scroll-section-wrapper::after {
        display: none;
    }
}

/* ============================================
   4. RECENTLY VIEWED
   Smaller cards, minimal info, horizontal scroll only, auto-hide if no data
   Soft background strip
   ============================================ */

.section-recently-viewed {
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
}

/* Hide any home section that has no data (AJAX sections get is-empty when empty) */
.section-new-arrivals.is-empty,
.section-top-selling.is-empty,
.section-recently-viewed.is-empty,
.section-you-may-like.is-empty {
    display: none !important;
}

.product-card-mini {
    flex-shrink: 0;
    width: 110px;
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
    scroll-snap-align: start;
}

.product-card-mini:hover {
    box-shadow: var(--shadow-sm);
}

.product-card-mini .card-image {
    position: relative;
    width: 100%;
    padding-top: 120%;
    background: var(--gray-50);
}

.product-card-mini .card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-mini .card-info {
    padding: var(--space-2);
}

.product-card-mini .card-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--black);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-mini .card-price .current-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
}

/* Variant rows: two stacked horizontal strips inside scroll-section-inner */
.variant-row {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

@media (min-width: 1024px) {
    .variant-row {
        justify-content: flex-start;
    }
}

/* You May Like: soft gradient strip */
.section-you-may-like {
    background: linear-gradient(135deg, #fff7fb 0%, #f3e8ff 40%, #e0f2fe 100%);
}

/* Cart preview: elevated block */
.section-cart-preview {
    background: var(--white);
}

.cart-preview-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    padding: var(--space-4);
    max-width: 480px;
    margin: 0 auto;
}

.cart-preview-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-height: 280px;
    overflow-y: auto;
}

.cart-preview-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: inherit;
}

.cart-preview-thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gray-50);
    flex-shrink: 0;
}

.cart-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-preview-info {
    flex: 1;
}

.cart-preview-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.cart-preview-variant,
.cart-preview-qty {
    font-size: 12px;
    color: var(--gray-500);
}

.cart-preview-price {
    font-size: 13px;
    font-weight: 700;
}

.cart-preview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.cart-preview-checkout-btn {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .cart-preview-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .cart-preview-checkout-btn {
        position: sticky;
        bottom: 0;
        width: 100%;
    }
}

/* Wishlist strip: minimal clean style */
.section-home-wishlist {
    background: var(--white);
}

/* ============================================
   5. DEAL OF THE DAY
   Full-width highlight, asymmetrical background, countdown timer, strong CTA
   ============================================ */

.section-featured {
    position: relative;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 40%, var(--secondary) 100%);
    padding: var(--space-8) 0;
    overflow: hidden;
}

.section-featured::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 50%;
    height: 120%;
    background: rgba(255, 255, 255, 0.06);
    transform: skewY(-12deg);
    pointer-events: none;
}

.section-featured::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -15%;
    width: 40%;
    height: 80%;
    background: rgba(255, 255, 255, 0.04);
    transform: skewY(8deg);
    pointer-events: none;
}

.section-featured .section-header {
    position: relative;
    z-index: 1;
}

.section-featured .section-title {
    color: var(--white);
}

.section-featured .section-subtitle {
    color: rgba(255, 255, 255, 0.85);
}

.deal-scroll-wrapper {
    position: relative;
    z-index: 1;
}

.deal-products-scroll {
    display: flex;
    gap: var(--space-5);
}

.deal-product-card {
    flex-shrink: 0;
    width: 260px;
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    position: relative;
    scroll-snap-align: start;
}

@media (min-width: 480px) {
    .deal-product-card {
        width: 280px;
    }
}

.deal-product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Countdown timer */
.deal-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3);
    margin-bottom: var(--space-4);
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.deal-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
}

.deal-countdown-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
}

.deal-countdown-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

.deal-countdown-sep {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
}

.deal-cta-row {
    display: flex;
    justify-content: center;
    margin-top: var(--space-5);
}

.deal-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    background: var(--white);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all var(--transition-base);
}

.deal-cta-btn:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-xl);
}

/* Deal card uses featured-product-card structure - crisp edges */
.section-featured .featured-product-card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-lg);
    height: 100%;
}

/* Align card content and CTA at bottom when card heights vary */
.section-featured .featured-product-card .featured-product-link {
    min-height: 0;
}

.section-featured .featured-product-card .featured-add-to-cart {
    flex-shrink: 0;
    margin-top: auto;
}

/* Deal products: standard card size, horizontal scroll left/right on all breakpoints */
.deal-products-inner {
    display: flex;
    gap: var(--space-5);
    width: max-content;
}

/* Standard card width for Deal Of The Day – scrollable row */
.section-featured .deal-products-inner .featured-product-card {
    flex-shrink: 0;
    width: 280px;
    scroll-snap-align: start;
}

.section-featured .deal-products-scroll {
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Slightly wider cards on larger screens, still scrollable */
@media (min-width: 640px) {
    .section-featured .deal-products-inner .featured-product-card {
        width: 300px;
    }
}

@media (min-width: 1024px) {
    .section-featured .deal-products-inner .featured-product-card {
        width: 320px;
    }
    /* Keep scroll shadows visible on desktop for deal section */
}

/* ============================================
   6. BESTSELLERS
   Masonry-style on desktop, horizontal scroll on mobile, rank badge
   ============================================ */

.section-bestsellers {
    background: var(--white);
}

.bestsellers-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: var(--space-4);
    margin: 0 calc(var(--container-padding) * -1);
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.bestsellers-scroll-container::-webkit-scrollbar {
    display: none;
}

.bestsellers-grid {
    display: flex;
    gap: var(--space-5);
    width: max-content;
}

.bestseller-card {
    flex-shrink: 0;
    width: 220px;
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    position: relative;
    scroll-snap-align: start;
}

@media (min-width: 480px) {
    .bestseller-card {
        width: 250px;
    }
}

.bestseller-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.bestseller-rank {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    width: 40px;
    height: 40px;
    background: var(--primary-dark);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: var(--white);
    z-index: 2;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bestseller-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--gray-50);
}

.home-ref-card .home-ref-image.bestseller-image {
    aspect-ratio: auto;
    padding-top: 125%;
}

.bestseller-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.bestseller-card:hover .bestseller-image img {
    transform: scale(1.05);
}

/* Desktop: masonry-style grid */
@media (min-width: 1024px) {
    .bestsellers-scroll-container {
        overflow: visible;
        margin: 0;
        padding: 0;
        scroll-snap-type: none;
    }

    .bestsellers-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        width: 100%;
        gap: var(--space-6);
    }

    .bestseller-card {
        width: 100%;
    }

    /* Masonry-ish: vary heights slightly */
    .bestsellers-grid .bestseller-card:nth-child(4n + 2) .bestseller-image {
        aspect-ratio: 0.95;
    }

    .bestsellers-grid .bestseller-card:nth-child(4n + 4) .bestseller-image {
        aspect-ratio: 1.08;
    }
}

/* ============================================
   HOME REFERENCE-STYLE PRODUCT CARDS
   (Rating on image, brand, ↓N%, prices – exact like reference)
   ============================================ */

.home-ref-card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
    display: flex;
    flex-direction: column;
    position: relative;
}

.home-ref-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}

.home-ref-card .home-ref-image {
    position: relative;
    width: 100%;
    padding-top: 125%;
    aspect-ratio: auto;
    background: var(--gray-50);
    overflow: hidden;
}

.home-ref-card .home-ref-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.home-ref-card:hover .home-ref-image img {
    transform: scale(1.04);
}

/* Rating strip on image – bottom-left, dark box, white text */
.home-card-rating {
    position: absolute;
    bottom: var(--space-2);
    left: var(--space-2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(44, 44, 44, 0.85);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    color: var(--white);
    z-index: 2;
}

.home-card-rating .rating-star {
    color: #facc15;
    display: inline-flex;
}

.home-card-rating .rating-sep {
    opacity: 0.7;
    margin: 0 2px;
}

/* Badge on image top-left: BESTSELLER (green) or ↓N% */
.home-card-badge {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: var(--radius-sm);
    z-index: 2;
}

.home-card-badge.is-bestseller {
    background: #16a34a;
    color: var(--white);
}

.home-card-badge.is-discount {
    background: rgba(44, 44, 44, 0.9);
    color: var(--white);
}

/* Wishlist on image – top-right, white circle */
.home-ref-card .product-card-wishlist {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    z-index: 2;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: var(--white);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-ref-card .product-card-wishlist .wishlist-heart {
    width: 18px;
    height: 18px;
}

/* Info below image */
.home-ref-info {
    padding: var(--space-3);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.home-card-brand {
    font-size: 11px;
    font-weight: 700;
    color: var(--black);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 4px;
    line-height: 1.2;
}

.home-card-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
    line-height: 1.35;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-card-discount {
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
    margin: 0 0 4px;
}

.home-ref-prices {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.home-ref-prices .current-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--black);
}

.home-ref-prices .original-price {
    font-size: 13px;
    color: var(--gray-400);
    text-decoration: line-through;
}

.home-card-tag {
    font-size: 11px;
    font-weight: 600;
    color: #16a34a;
    margin-top: 4px;
}

/* ============================================
   CARD BADGES & WISHLIST (shared)
   ============================================ */

.product-card-wishlist {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    z-index: 3;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: var(--white);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.product-card-wishlist .wishlist-heart {
    width: 18px;
    height: 18px;
}

.featured-product-badge,
.discount-badge {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    padding: 4px 10px;
    background: var(--primary-dark);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    z-index: 2;
}

/* ============================================
   ANIMATIONS - Subtle slide-in on scroll
   ============================================ */

@keyframes sectionFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: sectionFadeIn 0.5s ease-out;
}

/* ============================================
   COLLECTIONS PAGE - Product Grid
   ============================================ */

.collection-product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

@media (min-width: 640px) {
    .collection-product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .collection-product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-6);
    }
}

.collection-product-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-base);
}

.collection-product-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.collection-product-card .product-image {
    aspect-ratio: 1;
    background: var(--gray-50);
}

.collection-product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   HOME PAGE: Crisp card edges (stories, testimonials, CTA)
   ============================================ */

.section-stories .story-card {
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.section-testimonials .testimonial-card {
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.cta-section .cta-card {
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .scroll-section,
    .bestsellers-scroll-container {
        scroll-behavior: auto;
    }

    .section {
        animation: none;
    }

    .category-card:hover,
    .product-card-tall:hover,
    .product-card-compact:hover,
    .bestseller-card:hover,
    .deal-product-card:hover {
        transform: none;
    }
}
