/* =============================================================================
   home-section.css
   --------------------------------------------------------------------------
   Visual language for the home page:
     • Display serif (Playfair Display)  → section titles, category names
     • Inter                              → body, labels, eyebrows, CTAs
   --------------------------------------------------------------------------
   Sections defined here:
     27. HOME SECTION shell       (shared by both showcase styles)
     28. PRODUCT SPOTLIGHT CARD   (editorial showcase card)
     29. SHOP BY CATEGORY         (horizontal scroll-snap, mobile-first)
     30. FEATURES MARQUEE         (infinite CSS marquee for trust bar)
     31. CONTENT-VISIBILITY       (.cv-auto opt-in)
============================================================================= */


/* =============================================================================
   27. HOME SECTION — unified shell for both showcase styles
   ----------------------------------------------------------------------------
   Driven by .home-section--shop | .home-section--spotlight modifier.
   Used by components/home-product-section.blade.php (the orchestrator).
============================================================================= */

.home-section {
    position: relative;
}

/* Section rhythm — airy spotlight variant has soft tinted background */
.home-section--spotlight {
    background: linear-gradient(180deg, #fcfaf5 0%, #f6f1e7 100%);
    padding: 56px 0;
}

.home-section--spotlight__inner {
    padding: 0 12px;
}

/* ── Shared header (renders for BOTH styles — DRY) ───────────────────────── */
.home-section__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.home-section__header--centered {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 40px;
}

.home-section__heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.home-section__eyebrow {
    font-family: var(--font-body);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--brand-gold-dark, #7B5903);
    font-weight: 600;
    margin: 0;
}

.home-section__title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-text-dark);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -.5px;
}

.home-section__header--spotlight .home-section__title {
    font-size: 2.25rem;
}

/* ── View All link (shared by both styles) ───────────────────────────────── */
.home-section__view-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: .82rem;
    font-weight: 600;
    color: var(--forest);
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 50px;
    border: 1px solid var(--brand-muted-border, #c8dbd2);
    background: #fff;
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
    white-space: nowrap;
    letter-spacing: .2px;
}

.home-section__view-all:hover,
.home-section__view-all:focus {
    background: var(--forest);
    color: #fff;
    border-color: var(--forest);
    transform: translateX(2px);
}

.home-section__view-all i {
    font-size: .72rem;
    transition: transform .2s ease;
}

.home-section__view-all:hover i {
    transform: translateX(3px);
}

.home-section__header--centered .home-section__view-all {
    margin-top: 8px;
}

.home-section__grid {
    margin: 0 auto;
}


/* =============================================================================
   28. PRODUCT SPOTLIGHT CARD  —  editorial / showcase style
   ----------------------------------------------------------------------------
   Component: resources/views/components/product-spotlight-card.blade.php

   Distinct from .product-card (the commerce card):
     • 1:1 square image inside an editorial frame (vs shop card's plain 1:1)
     • Dark caption footer with subcategory eyebrow + title + "Explore Now" CTA
     • No price / cart / wishlist / stars — the whole card is the CTA
     • "Just Arrived" tag (top-left)
   Designed for curation / lookbook / featured-collection use cases.
============================================================================= */

.product-spotlight-card {
    position: relative;
    display: block;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    height: 100%;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    isolation: isolate;
}

.product-spotlight-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0, 104, 55, 0.18);
}

/* Tag (top-left) */
.product-spotlight-card__tag {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    background: var(--brand-gold, #C19A6B);
    color: #1a1a1a;
    font-family: var(--font-body);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 4px;
}

/* Image — 1:1 square (matches shop card ratio for visual consistency,
   but presented inside the spotlight's editorial frame) */
.product-spotlight-card__media {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f6f1e7;
}

.product-spotlight-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-spotlight-card:hover .product-spotlight-card__media img {
    transform: scale(1.06);
}

/* Caption — dark footer with eyebrow + title + Explore Now CTA */
.product-spotlight-card__caption {
    background: linear-gradient(135deg, var(--forest) 0%, var(--forest-900) 100%);
    color: #fff;
    padding: 16px 18px 18px;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
}

.product-spotlight-card__eyebrow {
    font-family: var(--font-body);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 600;
    margin: 0 0 2px;
}

.product-spotlight-card__title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: #fff;
    line-height: 1.3;
    /* Clamp to 2 lines so all caption footers stay aligned */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* "Explore Now →" CTA — visual cue. The entire card is wrapped in <a>
   so the CTA doesn't need its own href; it's just a styled affordance. */
.product-spotlight-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .3px;
    color: #fff;
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    transition: gap .2s ease;
}

.product-spotlight-card__cta i {
    font-size: .72rem;
    transition: transform .2s ease;
}

.product-spotlight-card:hover .product-spotlight-card__cta {
    gap: 12px;
}

.product-spotlight-card:hover .product-spotlight-card__cta i {
    transform: translateX(2px);
}

/* Responsive — spotlight grid tweaks */
@media (max-width: 576px) {
    .home-section--spotlight { padding: 36px 0; }
    .home-section__title     { font-size: 1.5rem; }
    .home-section__header--spotlight .home-section__title { font-size: 1.7rem; }
    .product-spotlight-card__title    { font-size: .95rem; }
    .product-spotlight-card__caption  { min-height: 110px; padding: 12px 14px 14px; }
}


/* =============================================================================
   29. SHOP BY CATEGORY — horizontal scroll-snap, mobile-first
   ----------------------------------------------------------------------------
   Markup lives in index.blade.php.
   Design:
     • Mobile-first: cards are 110px on mobile, scale up at breakpoints.
     • Horizontal scroll on EVERY viewport (touch / wheel / trackpad).
     • Scroll-snap: each card snaps to center as you scroll.
     • CENTERING TRICK → `margin: auto` on first/last child:
         - When items fit inside the viewport, auto margins expand and
           push the row to the horizontal center. Looks balanced with
           1, 2, 3, 4, or 5 cards.
         - When items overflow the viewport, auto margins collapse to 0
           and the row scrolls naturally from the left edge.
         - Cross-browser, no `safe-center` quirks, works everywhere.
     • Scrollbar hidden for a clean boutique look.
     • NOT marked cv-auto — section is near the top of the page, often
       above the fold. cv-auto would skip its initial render.
============================================================================= */

.shop-by-category {
    background: linear-gradient(180deg, #FAF8F3 0%, #f3faf6 100%);
    padding: 60px 0 50px;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.shop-by-category__header {
    text-align: center;
    margin-bottom: 36px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px;
}

.shop-by-category__eyebrow {
    font-family: var(--font-body);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--brand-gold-dark, #7B5903);
    margin: 0 0 8px;
}

.shop-by-category__title {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--brand-text-dark);
    margin: 0 0 10px;
    line-height: 1.15;
    letter-spacing: -.5px;
}

.shop-by-category__subtitle {
    font-family: var(--font-body);
    font-size: .95rem;
    color: var(--brand-text-mid, #4A4A4A);
    line-height: 1.55;
    margin: 0;
}

/* ── Horizontal scroll track (mobile-first) ────────────────────────────────
   Default = mobile. Cards 110px wide, gap 16px. Touch-friendly.
   NO `justify-content: safe-center` here — that's unreliable.
   Instead we use `margin: auto` on first/last child (see below).
*/
.shop-by-category__scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    /* Native scroll-snap: cards snap to center as you flick */
    scroll-snap-type: x mandatory;
    scroll-padding-left: 16px;
    /* iOS smooth scrolling */
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar (clean boutique look) — Firefox + WebKit */
    scrollbar-width: none;
    padding: 8px 16px 20px;
    gap: 16px;
    /* DO NOT use justify-content here — it breaks scrolling when content
       overflows. Centering is handled by first/last child margin:auto. */
}
.shop-by-category__scroll::-webkit-scrollbar { display: none; }

/* ── THE CENTERING TRICK ────────────────────────────────────────────────────
   margin:auto on a flex item absorbs ALL leftover free space along the
   main axis. On the FIRST child, `margin-left:auto` pushes everything
   right; on the LAST child, `margin-right:auto` pushes everything left.
   Combined, they split the free space → row is centered.

   When items overflow (no free space), auto margins compute to 0 and
   the row scrolls naturally from the left edge. Bulletproof.
*/
.shop-by-category__card:first-child {
    margin-left: auto;
}
.shop-by-category__card:last-child {
    margin-right: auto;
}

/* ── Card (mobile-first default) ───────────────────────────────────────────
   Fixed width so scroll-snap has predictable targets.
*/
.shop-by-category__card {
    /* Mobile default — overridden at breakpoints */
    flex: 0 0 110px;
    width: 110px;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform .25s ease;
}

.shop-by-category__card:hover {
    transform: translateY(-3px);
}

/* Circular image mask — fills card width */
.shop-by-category__media {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 5%;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 104, 55, 0.08);
    border: 1px solid rgba(0, 104, 55, 0.08);
    transition: box-shadow .3s ease, transform .3s ease;
}

.shop-by-category__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.shop-by-category__card:hover .shop-by-category__media {
    box-shadow: 0 8px 22px rgba(0, 104, 55, 0.18);
}

.shop-by-category__card:hover .shop-by-category__media img {
    transform: scale(1.08);
}

/* Category name — Playfair Display, wraps to 2 lines max */
.shop-by-category__name {
    font-family: var(--font-display);
    font-size: .92rem;
    font-weight: 700;
    color: var(--brand-text-dark);
    margin: 12px 0 4px;
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
}

/* "Shop now →" hint — Inter */
.shop-by-category__hint {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-body);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .3px;
    color: var(--brand-primary, var(--forest));
    text-transform: uppercase;
    transition: gap .2s ease;
}

.shop-by-category__hint i {
    font-size: .58rem;
    transition: transform .2s ease;
}

.shop-by-category__card:hover .shop-by-category__hint {
    gap: 8px;
}

.shop-by-category__card:hover .shop-by-category__hint i {
    transform: translateX(2px);
}

/* ── Responsive: scale up cards at each breakpoint ───────────────────────── */
@media (min-width: 576px) {
    .shop-by-category__card { flex: 0 0 130px; width: 130px; }
    .shop-by-category__name { font-size: 1rem; }
    .shop-by-category__scroll { gap: 20px; }
}

@media (min-width: 768px) {
    .shop-by-category { padding: 30px 0 20px; }
    .shop-by-category__title { font-size: 2rem; }
    .shop-by-category__card { flex: 0 0 150px; width: 150px; }
    .shop-by-category__name { font-size: 1.05rem; }
    .shop-by-category__hint { font-size: .72rem; }
    .shop-by-category__scroll { gap: 24px; padding: 8px 24px 24px; }
}

@media (min-width: 992px) {
    .shop-by-category__card { flex: 0 0 200px; width: 200px; }
    .shop-by-category__name { font-size: 1.1rem; }
    .shop-by-category__scroll { gap: 32px; }
}

/* ── Large screens: enlarged cards, always horizontal scroll ────────────────
   Cards are sized so exactly 4 fill the viewport width. If there are 1–4
   categories the first/last child margin:auto trick centres them. If there
   are 5+ they overflow and scroll horizontally — same UX as mobile.
   justify-content:center only fires when there IS free space (≤4 items),
   so it never breaks scrolling when content overflows.
*/
@media (min-width: 1200px) {
    .shop-by-category__scroll {
        /* Stay as a horizontal flex scroll — no grid */
        justify-content: center;
        gap: 40px;
        padding: 8px 0 28px;
    }

    /* Each card ~22% of 1200px container = ~264px. Keeps 4 on screen,
       5th card is half-visible → clear affordance to scroll. */
    .shop-by-category__card {
        flex: 0 0 calc(20vw - 30px);
        width: calc(25% - 30px);
    }

    .shop-by-category__name { font-size: 1.2rem; }
}


/* =============================================================================
   30. FEATURES MARQUEE — infinite CSS marquee for the trust bar
   ----------------------------------------------------------------------------
   Markup lives in index.blade.php.
   Track holds 2 copies of the items. Animation slides left by exactly
   50% (one full set) then loops — visually seamless.

   Performance:
     • `transform: translateX()` only — GPU-composited, no main-thread cost
     • Animation pauses on hover (accessibility + readability)
     • `prefers-reduced-motion: reduce` → animation disabled, items wrap
       naturally as a static centered row
============================================================================= */

.features-marquee {
    background: var(--brand-darker);
    color: #fff;
    padding: 14px 0;
    overflow: hidden;
}

.features-marquee__viewport {
    overflow: hidden;
    max-width: 100%;
    position: relative;
}

/* The track — flex row, no wrap.
   We use `width: max-content; min-width: 100%` so:
     - Track is at least as wide as the viewport (no empty space if items
       are narrow)
     - Track grows to fit ALL items (both copies) when they're wider than
       the viewport
   `flex-shrink: 0` on items guarantees they keep their measured width
   and don't get squished by the flex algorithm.
*/
.features-marquee__track {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    width: max-content;
    min-width: 100%;
    /* The animation. 28s for one full cycle — slow enough to read. */
    animation: features-marquee-scroll 28s linear infinite;
    /* Hint to the compositor — promotes the track to its own GPU layer
       so the animation doesn't trigger layout/paint on the main thread. */
    will-change: transform;
}

/* Pause on hover — lets users read a specific item */
.features-marquee:hover .features-marquee__track,
.features-marquee:focus-within .features-marquee__track {
    animation-play-state: paused;
}

/* One item: icon + text (title + sub) */
.features-marquee__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 28px;
    flex-shrink: 0;
    /* Separator dot between items — pure CSS, no extra markup */
    position: relative;
}

.features-marquee__item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
}

.features-marquee__item:last-child::after { display: none; }

.features-marquee__icon {
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
    line-height: 1;
}

.features-marquee__text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.features-marquee__text strong {
    font-family: var(--font-body);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .4px;
    color: #fff;
}

.features-marquee__text em {
    font-family: var(--font-body);
    font-style: normal;
    font-size: .72rem;
    color: rgba(255, 255, 255, 0.78);
    margin-top: 2px;
}

/* The actual animation. -50% because the track holds 2 identical copies.
   The loop point is invisible because the second copy is identical to
   the first — when -50% is reached, the visible area shows exactly what
   it showed at 0%, so snapping back to 0 is undetectable. */
@keyframes features-marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ── Accessibility: reduced motion ─────────────────────────────────────────
   When the user prefers reduced motion, disable the animation and lay
   the items out as a centered, wrapping row. Still readable, just static.
*/
@media (prefers-reduced-motion: reduce) {
    .features-marquee__track {
        animation: none;
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px 0;
    }
    .features-marquee__item::after { display: none; }
}

/* ── Responsive: tighter padding + smaller text on mobile ────────────────── */
@media (max-width: 768px) {
    .features-marquee { padding: 10px 0; }
    .features-marquee__item { padding: 0 18px; gap: 9px; }
    .features-marquee__icon { font-size: 1.25rem; }
    .features-marquee__text strong { font-size: .75rem; }
    .features-marquee__text em { font-size: .66rem; }
    /* Slightly faster on mobile so all items pass by in a reasonable time */
    .features-marquee__track { animation-duration: 22s; }
}


/* =============================================================================
   31. CONTENT-VISIBILITY — skip rendering of below-the-fold sections
   ----------------------------------------------------------------------------
   .cv-auto opt-in class used by index.blade.php on every section that's
   below the first viewport. Browser skips their layout/paint until they're
   scrolled near, then renders them on demand. Massive win for initial FCP.

   We provide a default `contain-intrinsic-size` so the scrollbar doesn't
   jump around as sections get rendered.
============================================================================= */

.cv-auto {
    content-visibility: auto;
    contain-intrinsic-size: 1px 400px;
}

@supports not (content-visibility: auto) {
    .cv-auto { content-visibility: visible; }
}












