/*
 * Layer modernisation boutique — esprit "dossier d'enquête vintage moderne".
 * Active via classes parentes `.shop-modern` posées sur les sections.
 * Cohabite avec page-shop.css. Utilise tokens.css.
 */

/* ========== Hygiène ========== */
.shop-modern,
.shop-modern *,
.shop-modern *::before,
.shop-modern *::after { box-sizing: border-box; min-width: 0; }

.shop-modern img,
.shop-modern svg,
.shop-modern video { max-width: 100%; height: auto; display: block; }

/* ========== HERO archive (page-banner) ========== */
.shop-modern.page-banner {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: clamp(360px, 56vh, 560px);
    padding-top: calc(var(--header-offset, 0px) + clamp(2.5rem, 6vw, 5rem));
    padding-bottom: clamp(2rem, 5vw, 4rem);
}

.shop-modern .archive-banner-media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.shop-modern .archive-banner-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.05);
    animation: em-shop-hero-zoom 28s ease-in-out infinite alternate;
}

@keyframes em-shop-hero-zoom {
    from { transform: scale(1.05) translateY(0); }
    to   { transform: scale(1.12) translateY(-2%); }
}

.shop-modern.page-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(216, 161, 90, 0.12), transparent 55%),
        linear-gradient(180deg, rgba(15, 12, 10, 0.55) 0%, rgba(15, 12, 10, 0.85) 100%);
    pointer-events: none;
}

/* Texture parchemin SVG */
.shop-modern.page-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.85   0 0 0 0 0.7   0 0 0 0 0.45  0 0 0 0.07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    background-size: 300px 300px;
    mix-blend-mode: overlay;
    opacity: 0.45;
    pointer-events: none;
}

.shop-modern.page-banner .archive-banner-grid {
    position: relative;
    z-index: 2;
}

.shop-modern .archive-hero-copy {
    color: var(--em-text);
    text-align: center;
    max-width: 52rem;
    margin: 0 auto;
    display: grid;
    gap: 1rem;
}

.shop-modern .archive-hero-copy .eyebrow {
    color: var(--em-amber-500);
    font-family: var(--em-font-sans);
    font-size: var(--em-fz-xs);
    font-weight: 700;
    letter-spacing: var(--em-ls-wide);
    text-transform: uppercase;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
}

.shop-modern .archive-hero-copy .eyebrow::before,
.shop-modern .archive-hero-copy .eyebrow::after {
    content: "";
    width: clamp(28px, 5vw, 56px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--em-amber-500), transparent);
}

.shop-modern .archive-hero-copy h1 {
    font-family: var(--em-font-serif);
    font-size: var(--em-fz-4xl);
    line-height: var(--em-lh-tight);
    margin: 0;
    color: var(--em-text);
    overflow-wrap: anywhere;
}

.shop-modern .archive-hero-intro {
    font-family: var(--em-font-serif);
    font-style: italic;
    font-size: var(--em-fz-lg);
    color: var(--em-paper-100);
    max-width: 36rem;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .shop-modern.page-banner {
        min-height: clamp(330px, 62vh, 460px);
        padding-top: calc(var(--header-offset, 0px) + 2.6rem);
        padding-bottom: 2.1rem;
    }

    .shop-modern.page-banner .archive-banner-grid {
        width: min(100%, calc(100vw - 2rem));
    }

    .shop-modern .archive-hero-copy {
        width: min(100%, calc(100vw - 2rem));
        max-width: 100%;
        gap: 0.8rem;
        padding-inline: 0.15rem;
        justify-items: center;
        overflow: hidden;
    }

    .shop-modern .archive-hero-copy h1 {
        max-width: 100%;
        font-size: clamp(1.9rem, 10.2vw, 2.55rem);
        line-height: 0.98;
        overflow-wrap: break-word;
        text-wrap: balance;
    }

    .shop-modern .archive-hero-intro {
        max-width: min(24ch, calc(100vw - 3.25rem));
        font-size: clamp(0.98rem, 4.4vw, 1.08rem);
        line-height: 1.45;
        overflow-wrap: break-word;
        text-wrap: pretty;
    }

    .shop-modern .archive-hero-intro span {
        display: block;
    }
}

/* ========== CATALOGUE GRID ========== */
.shop-modern.catalog-page-shell .section-container-surface,
.shop-modern .section-container-surface {
    padding: clamp(1.6rem, 3vw, 2.8rem);
}

.shop-modern .catalogue-heading-shop {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
    margin-bottom: clamp(1.4rem, 3vw, 2.4rem);
    padding-bottom: 1.2rem;
    border-bottom: 1px dashed rgba(208, 169, 109, 0.35);
}

.shop-modern .catalogue-heading-shop .eyebrow {
    color: var(--em-amber-700);
    font-family: var(--em-font-sans);
    font-size: var(--em-fz-xs);
    font-weight: 700;
    letter-spacing: var(--em-ls-wide);
    text-transform: uppercase;
    margin: 0 0 0.4rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.shop-modern .catalogue-heading-shop .eyebrow::before {
    content: "❖";
    color: var(--em-amber-500);
    font-size: 0.9em;
}

.shop-modern .catalogue-heading-shop h2 {
    font-family: var(--em-font-serif);
    font-size: var(--em-fz-3xl);
    line-height: var(--em-lh-tight);
    color: var(--em-ink-700);
    margin: 0;
}

.shop-modern .catalogue-heading-note {
    font-family: var(--em-font-serif);
    font-style: italic;
    color: var(--em-ink-500);
    font-size: var(--em-fz-md);
    margin: 0;
    max-width: 38rem;
}

@media (min-width: 720px) {
    .shop-modern .catalogue-heading-shop {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        align-items: end;
        gap: 1.4rem;
    }

    .shop-modern .catalogue-heading-note {
        text-align: right;
        justify-self: end;
    }
}

/* ========== CARDS produit ========== */
.shop-modern .card-grid-catalog {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.4rem;
}

@media (min-width: 640px) {
    .shop-modern .card-grid-catalog {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.6rem;
    }
}

@media (min-width: 1100px) {
    .shop-modern .card-grid-catalog {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.8rem;
    }
}

.shop-modern .product-card-catalog {
    position: relative;
    background: var(--em-paper-50);
    border: 1px solid rgba(154, 90, 0, 0.14);
    border-radius: var(--em-radius-lg);
    overflow: hidden;
    box-shadow: var(--em-shadow-sm);
    transition:
        transform var(--em-duration-base) var(--em-ease-out),
        box-shadow var(--em-duration-base) var(--em-ease-out),
        border-color var(--em-duration-base) var(--em-ease-out);
    isolation: isolate;
}

/* Filet doré supérieur */
.shop-modern .product-card-catalog::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--em-amber-500), transparent);
    z-index: 2;
    opacity: 0.6;
    transition: opacity var(--em-duration-base) var(--em-ease-out);
}

.shop-modern .product-card-catalog:hover {
    transform: translateY(-4px);
    box-shadow: var(--em-shadow-lg);
    border-color: rgba(154, 90, 0, 0.3);
}

.shop-modern .product-card-catalog:hover::before {
    opacity: 1;
}

.shop-modern .catalog-product-card {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 0;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Tête de carte */
.shop-modern .catalog-product-head {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.1rem 0.8rem;
    border-bottom: 1px dashed rgba(208, 169, 109, 0.35);
}

.shop-modern .catalog-product-kicker {
    font-family: var(--em-font-sans);
    font-size: var(--em-fz-xs);
    font-weight: 700;
    letter-spacing: var(--em-ls-wide);
    text-transform: uppercase;
    color: var(--em-amber-700);
    margin: 0;
}

.shop-modern .catalog-product-head-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.shop-modern .catalog-product-availability {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--em-font-sans);
    font-size: var(--em-fz-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: var(--em-radius-pill);
    background: rgba(31, 107, 50, 0.1);
    color: var(--em-forest-700);
    border: 1px solid rgba(31, 107, 50, 0.25);
}

.shop-modern .catalog-product-availability::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--em-forest-700);
    box-shadow: 0 0 0 2px rgba(31, 107, 50, 0.18);
}

.shop-modern .catalog-product-availability.is-unavailable {
    background: rgba(163, 32, 32, 0.08);
    color: var(--em-crimson-700);
    border-color: rgba(163, 32, 32, 0.25);
}

.shop-modern .catalog-product-availability.is-unavailable::before {
    background: var(--em-crimson-700);
    box-shadow: 0 0 0 2px rgba(163, 32, 32, 0.18);
}

.shop-modern .catalog-product-price {
    font-family: var(--em-font-serif);
    font-size: var(--em-fz-xl);
    font-weight: 700;
    color: var(--em-amber-700);
    line-height: 1;
}

/* Média */
.shop-modern .catalog-product-media-shell {
    position: relative;
    overflow: hidden;
    background: var(--em-paper-200);
    aspect-ratio: 4 / 5;
}

.shop-modern .catalog-product-media-shell img,
.shop-modern .catalog-product-media-shell .product-media,
.shop-modern .catalog-product-media-shell picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--em-duration-slow) var(--em-ease-out);
}

.shop-modern .product-card-catalog:hover .catalog-product-media-shell img {
    transform: scale(1.05);
}

/* Voile bas pour respiration visuelle */
.shop-modern .catalog-product-media-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(31, 24, 19, 0.18) 100%);
    pointer-events: none;
}

/* Copy */
.shop-modern .catalog-product-copy {
    padding: 1rem 1.1rem 0.8rem;
    display: grid;
    gap: 0.5rem;
}

.shop-modern .catalog-product-title {
    font-family: var(--em-font-serif);
    font-size: var(--em-fz-xl);
    line-height: var(--em-lh-tight);
    color: var(--em-ink-700);
    margin: 0;
    overflow-wrap: anywhere;
}

.shop-modern .catalog-product-excerpt {
    font-family: var(--em-font-serif);
    font-style: italic;
    color: var(--em-ink-500);
    font-size: var(--em-fz-sm);
    line-height: var(--em-lh-body);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer */
.shop-modern .catalog-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.8rem 1.1rem 1rem;
    border-top: 1px dashed rgba(208, 169, 109, 0.35);
    margin-top: 0.4rem;
}

.shop-modern .catalog-product-stock {
    font-family: var(--em-font-sans);
    font-size: var(--em-fz-xs);
    color: var(--em-ink-300);
    letter-spacing: 0.02em;
}

.shop-modern .catalog-product-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--em-font-sans);
    font-size: var(--em-fz-xs);
    font-weight: 700;
    letter-spacing: var(--em-ls-wide);
    text-transform: uppercase;
    color: var(--em-amber-700);
    transition: gap var(--em-duration-base) var(--em-ease-out), color var(--em-duration-base) var(--em-ease-out);
}

.shop-modern .catalog-product-action::after {
    content: "→";
    font-size: 1.1em;
    transition: transform var(--em-duration-base) var(--em-ease-out);
}

.shop-modern .product-card-catalog:hover .catalog-product-action {
    gap: 0.7rem;
    color: var(--em-amber-900);
}

.shop-modern .product-card-catalog:hover .catalog-product-action::after {
    transform: translateX(3px);
}

/* ========== Stagger sur les cartes (cosmetique, sans JS) ========== */
.shop-modern .card-grid-catalog .product-card-catalog {
    opacity: 0;
    transform: translateY(14px);
    animation: em-shop-card-in var(--em-duration-slow) var(--em-ease-out) forwards;
}

.shop-modern .card-grid-catalog .product-card-catalog:nth-child(1)  { animation-delay: 60ms; }
.shop-modern .card-grid-catalog .product-card-catalog:nth-child(2)  { animation-delay: 120ms; }
.shop-modern .card-grid-catalog .product-card-catalog:nth-child(3)  { animation-delay: 180ms; }
.shop-modern .card-grid-catalog .product-card-catalog:nth-child(4)  { animation-delay: 240ms; }
.shop-modern .card-grid-catalog .product-card-catalog:nth-child(5)  { animation-delay: 300ms; }
.shop-modern .card-grid-catalog .product-card-catalog:nth-child(6)  { animation-delay: 360ms; }
.shop-modern .card-grid-catalog .product-card-catalog:nth-child(n+7) { animation-delay: 420ms; }

@keyframes em-shop-card-in {
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .shop-modern .archive-banner-media img { animation: none; }
    .shop-modern .card-grid-catalog .product-card-catalog {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
