/*
 * Shop hero carousel.
 *
 * Hand-written rather than Tailwind utilities, for the same reason css/hub.css
 * is: css/app.css is a compiled build containing only the classes that existed
 * when it was generated, so anything new would render unstyled until somebody
 * re-ran the build. It uses the CMS custom properties, so a palette change in
 * Appearance applies here without a rebuild either.
 *
 * The layout is a two-column hero: copy on the left, product on the right,
 * stacking on narrow screens. Only the slide contents change between slides —
 * the frame does not move, so nothing reflows as the carousel runs.
 */

.shop-hero {
    position: relative;
    overflow: hidden;
    padding-top: var(--hero-top-gap, 3rem);
    padding-bottom: var(--section-gap, 4rem);
}

/* Tighter on a phone, where every 40px of hero is 40px of catalogue nobody
   scrolls to. */
@media (max-width: 639px) {
    .shop-hero {
        padding-top: 2rem;
        padding-bottom: 2.25rem;
    }
}

/* The soft corner wash the previous hero had, kept and made calmer. */
.shop-hero::before {
    content: "";
    position: absolute;
    top: -20%;
    right: -10%;
    width: min(640px, 70vw);
    height: min(640px, 70vw);
    background: var(--color-secondary-bg, #F3E9DA);
    border-radius: 50%;
    filter: blur(8px);
    opacity: .55;
    z-index: 0;
    pointer-events: none;
}

.shop-hero__inner {
    position: relative;
    z-index: 1;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .shop-hero__inner { padding: 0 2rem; }
}

/* ----------------------------------------------------------------- viewport */
/*
 * Every slide occupies the same grid cell, stacked. The track has no width or
 * transform of its own, which is what keeps a fade and a slide transition
 * sharing one layout: only opacity and a small translate differ between them.
 */
.shop-hero__track {
    display: grid;
}

.shop-hero__slide {
    grid-area: 1 / 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .55s ease, transform .55s ease;
    /* Inert slides must not be tabbable or read out; JS also sets aria-hidden. */
    pointer-events: none;
}

.shop-hero__slide[data-active="true"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

/* Slide transition: the outgoing panel drifts out, the incoming drifts in. */
.shop-hero[data-transition="slide"] .shop-hero__slide { transform: translateX(2.5rem); }
.shop-hero[data-transition="slide"] .shop-hero__slide[data-active="true"] { transform: translateX(0); }
.shop-hero[data-transition="slide"] .shop-hero__slide[data-leaving="true"] { transform: translateX(-2.5rem); }

@media (min-width: 1024px) {
    .shop-hero__slide {
        grid-template-columns: 1.05fr 1fr;
        gap: 3.5rem;
    }
}

/*
 * Before JS runs, the first slide is visible and the rest are not — so a
 * visitor with JavaScript blocked, or on the half-second before it executes,
 * sees a finished hero rather than an empty box or all eight slides at once.
 */
.shop-hero:not([data-ready="true"]) .shop-hero__slide:first-child {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* -------------------------------------------------------------------- copy */

.shop-hero__copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.15rem;
}

@media (min-width: 1024px) {
    .shop-hero__copy { align-items: flex-start; text-align: left; }
}

.shop-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    border-radius: 999px;
    background: var(--color-card-surface, #FFFDF9);
    border: 1px solid var(--color-soft-border, #DED5C9);
    box-shadow: 0 1px 2px rgba(7, 27, 69, .04);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--color-secondary-accent, #6F829B);
}

.shop-hero__pip {
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: var(--color-primary-cta, #C47B55);
    flex: none;
}

.shop-hero__headline {
    margin: 0;
    font-family: var(--font-heading, Georgia, serif);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.02em;
    color: var(--color-primary-navy, #071B45);
    /* Scales with the viewport instead of stepping at breakpoints, so a long
       title never collides with the product panel at an in-between width. */
    font-size: clamp(2rem, 1.35rem + 2.6vw, 3.5rem);
    text-wrap: balance;
}

.shop-hero__description {
    margin: 0;
    max-width: 34rem;
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--color-secondary-text, #5F6978);
}

.shop-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    justify-content: center;
    padding-top: .35rem;
}

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

.shop-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .9rem 1.75rem;
    border-radius: 999px;
    background: var(--color-primary-cta, #C47B55);
    color: #FFFDF9;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(196, 123, 85, .25);
    transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.shop-hero__cta:hover {
    background: var(--color-cta-hover, #AD6745);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(196, 123, 85, .3);
}

.shop-hero__price {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-primary-navy, #071B45);
}

/* ------------------------------------------------------------------ product */

.shop-hero__panel {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 26rem;
    background: var(--color-card-surface, #FFFDF9);
    border: 1px solid var(--color-soft-border, #DED5C9);
    border-radius: 1.75rem;
    padding: 1.25rem;
    box-shadow: 0 20px 50px rgba(7, 27, 69, .10);
}

@media (min-width: 1024px) {
    .shop-hero__panel { justify-self: end; }
}

.shop-hero__badge {
    position: absolute;
    top: -.85rem;
    left: -.5rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border-radius: 999px;
    background: var(--color-primary-navy, #071B45);
    color: #FFFDF9;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    box-shadow: 0 8px 18px rgba(7, 27, 69, .22);
}

.shop-hero__media {
    display: block;
    position: relative;
    /* A fixed ratio reserves the space before the image loads, so the hero does
       not jump — the single worst thing a carousel can do on a slow connection. */
    aspect-ratio: 4 / 3;
    border-radius: 1.25rem;
    overflow: hidden;
    background: var(--color-secondary-bg, #F3E9DA);
}

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

.shop-hero__panel:hover .shop-hero__media img { transform: scale(1.03); }

.shop-hero__media--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-muted-text, #858B94);
    font-size: .8rem;
}

.shop-hero__panel-body { padding: 1.15rem .35rem .35rem; }

/*
 * On a stacked layout the panel sits directly under the copy, which has
 * already given the title, the price and the button — so repeating them is
 * both duplication and about 120px of height on a screen where the hero was
 * already taller than the viewport and pushing the product grid out of sight.
 *
 * The image stays: it is the reason the panel is there.
 */
@media (max-width: 1023px) {
    .shop-hero__panel-body { display: none; }

    .shop-hero__panel {
        max-width: 22rem;
        padding: .85rem;
    }

    .shop-hero__media { aspect-ratio: 16 / 10; }
}

.shop-hero__panel-title {
    margin: 0 0 .35rem;
    font-family: var(--font-heading, Georgia, serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary-navy, #071B45);
    text-decoration: none;
    display: block;
}

.shop-hero__panel-title:hover { color: var(--color-primary-cta, #C47B55); }

.shop-hero__panel-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: .9rem;
    padding-top: .9rem;
    border-top: 1px solid var(--color-soft-border, #DED5C9);
}

/* ----------------------------------------------------------------- controls */

.shop-hero__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-top: 2rem;
}

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

.shop-hero__btn {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--color-soft-border, #DED5C9);
    background: var(--color-card-surface, #FFFDF9);
    color: var(--color-primary-navy, #071B45);
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.shop-hero__btn:hover {
    border-color: var(--color-primary-cta, #C47B55);
    transform: translateY(-1px);
}

.shop-hero__btn svg { width: 1.15rem; height: 1.15rem; }

.shop-hero__dots {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 .35rem;
    padding: 0;
    list-style: none;
}

.shop-hero__dot {
    width: .55rem;
    height: .55rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: var(--color-soft-border, #DED5C9);
    cursor: pointer;
    transition: width .25s ease, background-color .25s ease;
}

.shop-hero__dot[aria-current="true"] {
    width: 1.75rem;
    background: var(--color-primary-cta, #C47B55);
}

/*
 * A visible pause control, because WCAG 2.2.2 requires that anything moving
 * automatically for more than five seconds can be stopped — and because a
 * carousel that keeps sliding while somebody is reading it is the most
 * complained-about pattern on the web.
 */
.shop-hero__btn--play { margin-left: auto; }

@media (min-width: 1024px) {
    .shop-hero__btn--play { margin-left: .5rem; }
}

/* Focus that is visible on every surface here, not just the light ones. */
.shop-hero__btn:focus-visible,
.shop-hero__dot:focus-visible,
.shop-hero__cta:focus-visible,
.shop-hero__panel-title:focus-visible {
    outline: 3px solid var(--color-primary-navy, #071B45);
    outline-offset: 3px;
}

/* --------------------------------------------------------------- dark slide */

.shop-hero__slide[data-theme="dark"] .shop-hero__headline,
.shop-hero__slide[data-theme="dark"] .shop-hero__price { color: var(--color-card-surface, #FFFDF9); }
.shop-hero__slide[data-theme="dark"] .shop-hero__description { color: rgba(255, 253, 249, .82); }
.shop-hero__slide[data-theme="dark"] .shop-hero__eyebrow {
    background: rgba(255, 253, 249, .1);
    border-color: rgba(255, 253, 249, .25);
    color: var(--color-card-surface, #FFFDF9);
}

/* ------------------------------------------------------------ reduced motion */
/*
 * No transitions and no automatic movement. The JS reads the same query and
 * does not start the timer, so this is belt and braces rather than decoration:
 * a slide that changes under someone with vestibular sensitivity is not a
 * styling problem.
 */
@media (prefers-reduced-motion: reduce) {
    .shop-hero__slide,
    .shop-hero__media img,
    .shop-hero__cta,
    .shop-hero__dot,
    .shop-hero__btn {
        transition: none !important;
    }

    .shop-hero[data-transition="slide"] .shop-hero__slide { transform: none !important; }
}
