/*
 * Thème "christmas" : "Les 24 Portes" sous un ciel de "Nuit d'Aurore" — la
 * grille de portes interactive de la fiche produit (voir plus bas), posée
 * sur un fond de nuit étoilée fixe et animé (aurores qui respirent, étoiles
 * qui scintillent, neige qui tombe, sapin, guirlandes et traîneau du lutin)
 * visible sur toutes les pages du thème.
 */
:root {
    --color-primary: #F4C95D;
    --color-primary-contrast: #1A1530;
    --color-accent: #7FE7D3;
    --color-background: #060A1C;
    --color-text: #F5F3FF;
    --color-border: #232C5C;
    --color-header: rgba(4, 7, 16, .65);
    --color-header-contrast: #FFFFFF;
    --color-door: #11173A;
    --color-muted: #B9C2E6;
    --font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-family-heading: 'Fredoka', var(--font-family);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-family);
    color: var(--color-text);
    background-color: var(--color-background);
}

/* ---- Ciel animé : fixe derrière tout le contenu, sur toutes les pages ---- */

.christmas-sky {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.christmas-sky__aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    animation: aurora-breathe 12s ease-in-out infinite;
}

.christmas-sky__star {
    position: absolute;
    border-radius: 50%;
    background: #FFFFFF;
    animation: star-twinkle 2.4s ease-in-out infinite;
}

.christmas-sky__flake {
    position: absolute;
    top: -6vh;
    border-radius: 50%;
    background: radial-gradient(circle, #ffffff 40%, transparent 72%);
    animation: flake-fall linear infinite;
}

.christmas-sky__flake--far {
    width: 4px;
    height: 4px;
    opacity: .45;
}

.christmas-sky__flake--mid {
    width: 7px;
    height: 7px;
    opacity: .7;
}

.christmas-sky__flake--near {
    width: 13px;
    height: 13px;
    opacity: .9;
}

@media (max-width: 599.98px) {
    .christmas-sky__flake--desktop-only,
    .christmas-sky__ornament--desktop-only {
        display: none;
    }
}

/* Boules de Noël qui tombent du ciel (distinctes des guirlandes suspendues,
   statiques, plus haut dans ce fichier). Deux transforms séparés sur deux
   éléments : le parent tombe (translate), l'enfant se balance (rotate). */
.christmas-sky__ornament {
    position: absolute;
    top: -6vh;
    animation: ornament-fall linear infinite;
}

.christmas-sky__ornament-ball {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #ffffff 0 15%, var(--c, #F4C95D) 45%, var(--cd, #a8781f) 100%);
    transform-box: fill-box;
    transform-origin: 50% -4px;
    animation: ornament-swing 3s ease-in-out infinite alternate;
}

.christmas-sky__ornament-ball::before {
    content: "";
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 4px;
    border-radius: 2px;
    background: #F4C95D;
}

.christmas-sky__ornament-ball--sm { width: 16px; height: 16px; top: -8px; left: -8px; }
.christmas-sky__ornament-ball--md { width: 22px; height: 22px; top: -11px; left: -11px; }
.christmas-sky__ornament-ball--lg { width: 28px; height: 28px; top: -14px; left: -14px; }

/* Sapin posé dans le coin bas-droit, derrière tout le contenu (toujours sous
   les cartes opaques, donc jamais gênant même si le tronc "touche" le texte). */
.christmas-sky__tree {
    position: absolute;
    right: -6vw;
    bottom: 0;
    width: clamp(130px, 34vw, 260px);
    height: auto;
}

.christmas-sky__light,
.christmas-sky__star-halo {
    transform-box: fill-box;
    transform-origin: center;
}

.christmas-sky__light {
    animation: star-twinkle 1.6s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * -0.25s);
}

.christmas-sky__star-halo {
    animation: halo-pulse 3s ease-in-out infinite;
}

/* Guirlandes de boules suspendues en haut d'écran, dans les marges (jamais
   au centre, pour ne pas recouvrir la marque ou le titre). */
.christmas-sky__garland {
    position: absolute;
    top: 0;
    display: flex;
    gap: 26px;
}

.christmas-sky__garland--left {
    left: 4%;
}

.christmas-sky__garland--right {
    right: 4%;
}

.christmas-sky__bauble {
    position: relative;
    display: block;
    margin-top: 34px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .85), var(--hue, #F4C95D));
    transform-origin: top center;
    animation: bauble-swing 5s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

.christmas-sky__bauble::before {
    content: "";
    position: absolute;
    top: -34px;
    left: 50%;
    width: 1px;
    height: 34px;
    background: rgba(245, 243, 255, .35);
}

.christmas-sky__bauble::after {
    content: "";
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 4px;
    border-radius: 2px;
    background: #B9C2E6;
}

/* Le lutin, à califourchon sur une étoile filante : traverse le ciel très
   au-dessus du contenu, en boucle lente et espacée pour rester un clin
   d'œil et ne jamais devenir agaçant. Deux niveaux d'animation séparés :
   le conteneur traverse l'écran (translateX), le groupe intérieur flotte
   (translateY + rotate) — voir .christmas-sky__elf-body plus bas. */
.christmas-sky__elf {
    position: absolute;
    top: 16vh;
    left: 0;
    width: 56px;
    height: 56px;
    opacity: 0;
    animation: elf-cross 45s linear infinite;
    animation-delay: 6s;
    will-change: transform;
}

@media (min-width: 768px) {
    .christmas-sky__elf {
        width: 72px;
        height: 72px;
    }
}

.christmas-sky__elf-body,
.christmas-sky__elf-leg,
.christmas-sky__elf-arm,
.christmas-sky__elf-pompon {
    transform-box: fill-box;
}

.christmas-sky__elf-body {
    transform-origin: center;
    animation: elf-float 2.4s ease-in-out infinite;
}

.christmas-sky__elf-leg {
    transform-origin: 50% 0%;
    animation: elf-leg-swing .8s ease-in-out infinite alternate;
}

.christmas-sky__elf-leg--right {
    animation-delay: .4s;
}

.christmas-sky__elf-arm {
    transform-origin: 50% 100%;
    animation: elf-wave 1s ease-in-out infinite;
}

.christmas-sky__elf-pompon {
    transform-origin: 50% 100%;
    animation: elf-pompon 1.2s ease-in-out infinite;
}

@keyframes aurora-breathe {
    0%, 100% { opacity: .35; transform: scale(1); }
    50% { opacity: .55; transform: scale(1.08); }
}

@keyframes star-twinkle {
    0%, 100% { opacity: .2; }
    50% { opacity: 1; }
}

@keyframes flake-fall {
    0% { transform: translate(0, 0); opacity: 0; }
    8% { opacity: 1; }
    92% { opacity: 1; }
    100% { transform: translate(var(--dx, 20px), 112vh); opacity: 0; }
}

@keyframes ornament-fall {
    0% { transform: translate(0, 0); opacity: 0; }
    6% { opacity: .95; }
    92% { opacity: .95; }
    100% { transform: translate(var(--dx, 24px), 114vh); opacity: 0; }
}

@keyframes ornament-swing {
    0% { transform: rotate(-12deg); }
    100% { transform: rotate(12deg); }
}

@keyframes halo-pulse {
    0%, 100% { opacity: .15; transform: scale(.9); }
    50% { opacity: .35; transform: scale(1.1); }
}

@keyframes bauble-swing {
    0%, 100% { transform: rotate(-4deg); }
    50% { transform: rotate(4deg); }
}

@keyframes elf-cross {
    0% { transform: translateX(-20vw); opacity: 0; }
    4% { opacity: 1; }
    27% { opacity: 1; }
    31%, 100% { transform: translateX(120vw); opacity: 0; }
}

@keyframes elf-float {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-6px) rotate(4deg); }
}

@keyframes elf-leg-swing {
    from { transform: rotate(-15deg); }
    to { transform: rotate(15deg); }
}

@keyframes elf-wave {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(20deg); }
}

@keyframes elf-pompon {
    0%, 100% { transform: rotate(-8deg); }
    50% { transform: rotate(8deg); }
}

@media (min-width: 600px) {
    .christmas-sky__garland {
        gap: 34px;
    }
}

@media (max-width: 419.98px) {
    .christmas-sky__garland .christmas-sky__bauble:nth-child(3) {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .christmas-sky__aurora,
    .christmas-sky__star,
    .christmas-sky__flake,
    .christmas-sky__light,
    .christmas-sky__star-halo,
    .christmas-sky__bauble,
    .christmas-sky__ornament,
    .christmas-sky__ornament-ball,
    .christmas-sky__elf,
    .christmas-sky__elf-body,
    .christmas-sky__elf-leg,
    .christmas-sky__elf-arm,
    .christmas-sky__elf-pompon {
        animation: none !important;
    }

    .christmas-sky__elf {
        display: none;
    }
}

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-header {
    padding: 1rem 1.5rem;
    background-color: var(--color-header);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
}

.site-header__brand {
    color: var(--color-primary);
    font-family: var(--font-family-heading);
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.site-main {
    flex: 1;
    padding: 1.5rem;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.site-footer {
    padding: 1.5rem;
    background-color: var(--color-header);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--color-header-contrast);
    font-size: 0.875rem;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
}

.site-footer__links a {
    color: var(--color-header-contrast);
    opacity: .9;
}

.site-footer__links a:hover {
    opacity: 1;
}

.site-footer__copyright {
    margin: .75rem 0 0;
    opacity: .75;
}

.flash {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    background-color: rgba(127, 231, 211, .12);
    border: 1px solid rgba(127, 231, 211, .4);
}

.flash--error {
    background-color: rgba(255, 159, 178, .15);
    border-color: rgba(255, 159, 178, .5);
}

.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
}

.alert--warning {
    background-color: rgba(244, 201, 93, .15);
    border: 1px solid var(--color-primary);
}

.product__description {
    white-space: pre-line;
    line-height: 1.6;
}

.variant-choices {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.variant-choice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-door);
    box-shadow: inset 0 0 20px rgba(244, 201, 93, .08);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.variant-choice:hover {
    border-color: var(--color-primary);
}

.variant-choice:has(input:checked) {
    border-color: var(--color-primary);
    box-shadow: inset 0 0 20px rgba(244, 201, 93, .08), 0 0 0 2px rgba(244, 201, 93, .3);
}

.variant-choice__price {
    margin-left: auto;
    text-align: right;
}

.variant-choice__regular-price {
    color: var(--color-muted);
    margin-right: 0.5rem;
    text-decoration: line-through;
}

.variant-choice__final-price {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.variant-choice__promo-label {
    display: block;
    color: var(--color-muted);
    font-size: .8rem;
}

.child-info {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-door);
    padding: 1rem;
    margin: 1.5rem 0;
}

.child-info__title {
    font-weight: 700;
    color: var(--color-primary);
    padding: 0;
}

.child-info__intro {
    margin: 0.25rem 0 1rem;
    color: var(--color-muted);
    font-size: .9rem;
}

.child-info__gender-choices {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.child-info__gender-choice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.product__submit,
.download__button,
.download-recovery__submit {
    background-color: var(--color-primary);
    color: var(--color-primary-contrast);
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.product__submit:hover,
.download__button:hover,
.download-recovery__submit:hover {
    filter: brightness(.92);
}

/* ---- Hero + grille des 24 portes (fiche produit) ---- */

.christmas-hero {
    text-align: center;
    margin-bottom: 1.5rem;
}

.christmas-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--color-door);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: .35rem .9rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: .5rem;
}

.door-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin: 1.25rem 0;
}

@media (min-width: 600px) {
    .door-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

.door {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    background: var(--color-door);
    border: 1px solid var(--color-border);
    box-shadow: inset 0 0 14px rgba(244, 201, 93, .08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-primary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    animation: door-in .4s ease-out backwards;
}

.door:nth-child(1) { animation-delay: .03s; }
.door:nth-child(2) { animation-delay: .06s; }
.door:nth-child(3) { animation-delay: .09s; }
.door:nth-child(4) { animation-delay: .12s; }
.door:nth-child(5) { animation-delay: .15s; }
.door:nth-child(6) { animation-delay: .18s; }
.door:nth-child(7) { animation-delay: .21s; }
.door:nth-child(8) { animation-delay: .24s; }

.door--featured {
    animation: door-in .4s ease-out backwards, door-wiggle 4s ease-in-out .6s infinite;
    box-shadow: 0 0 0 2px var(--color-primary) inset, 0 2px 14px rgba(244, 201, 93, .45);
}

.door--locked {
    color: var(--color-muted);
}

.door--open .door__face {
    display: none;
}

.door__reveal {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    font-size: .65rem;
    font-weight: 600;
    line-height: 1.15;
    padding: 0 .2rem;
    text-align: center;
}

.door--open .door__reveal {
    display: flex;
}

.door--shake {
    animation: door-shake .4s ease-in-out;
}

.door-grid__hint {
    text-align: center;
    font-size: .8rem;
    color: var(--color-muted);
    margin: 0 0 1.25rem;
}

/* Bouton de commande collé en bas d'écran : une seule fois le vrai bouton du
   formulaire (pas de doublon), juste repositionné en CSS. ":has()" compense
   l'espace réservé uniquement sur les pages qui ont cette barre ; sans
   support du sélecteur, le seul effet de bord est un bas de page légèrement
   masqué par la barre, sans rien casser. */
.christmas-sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    background: var(--color-header);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: .85rem 1.25rem calc(.85rem + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .25);
}

.christmas-sticky-cta .product__submit {
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
}

/* Reflet doré qui balaie le bouton : le même bouton réel, juste un ::after
   décoratif (aucun élément dupliqué, aucune incidence sur la soumission). */
.christmas-sticky-cta .product__submit::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 40%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .55), transparent);
    animation: cta-shimmer 4s ease-in-out infinite;
}

.christmas-sticky-cta__trust {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .75rem;
    color: var(--color-header-contrast);
    opacity: .9;
}

body:has(.christmas-sticky-cta) .site-main {
    padding-bottom: 7rem;
}

@keyframes door-in {
    from { opacity: 0; transform: scale(.85); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes door-wiggle {
    0%, 80%, 100% { transform: rotate(0); }
    85% { transform: rotate(-3deg); }
    90% { transform: rotate(3deg); }
    95% { transform: rotate(-2deg); }
}

@keyframes door-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@keyframes cta-shimmer {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(220%); }
}

/* ---- Page d'accueil ---- */

.home-hero {
    margin-bottom: 2.5rem;
}

.home-hero__subtitle {
    color: var(--color-muted);
    max-width: 38rem;
    margin: 0 auto 1.25rem;
    line-height: 1.6;
}

.home-section {
    margin: 3rem 0;
    text-align: center;
}

.home-section h2 {
    font-family: var(--font-family-heading);
    margin-bottom: 1.5rem;
}

.home-pillars {
    display: grid;
    gap: 1rem;
    text-align: left;
}

@media (min-width: 700px) {
    .home-pillars {
        grid-template-columns: repeat(3, 1fr);
    }
}

.home-pillar {
    padding: 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-door);
}

.home-pillar__icon {
    display: block;
    font-size: 1.75rem;
    margin-bottom: .5rem;
}

.home-pillar h3 {
    font-family: var(--font-family-heading);
    margin: 0 0 .5rem;
}

.home-pillar p {
    color: var(--color-muted);
    line-height: 1.6;
    margin: 0;
}

.home-steps {
    text-align: left;
    max-width: 30rem;
    margin: 0 auto;
    padding-left: 1.5rem;
    line-height: 1.8;
}

.home-final-cta {
    text-align: center;
    margin: 3rem 0 1rem;
    padding: 2rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-door);
}

.home-final-cta h2 {
    font-family: var(--font-family-heading);
    margin-top: 0;
}

.home-final-cta__trust {
    display: block;
    margin-top: .75rem;
    font-size: .8rem;
    color: var(--color-muted);
}

/* ---- Rangée de portes décoratives (accueil), animées au défilement ----
   Distinctes de ".door" (fiche produit, cliquable) : non interactives,
   elles ne s'ouvrent qu'une fois, quand la rangée entre dans le viewport
   (voir christmas_scroll_doors_controller.js qui ajoute la classe
   "teaser-doors--open"). Chaque porte empile deux SVG : l'intérieur (fixe,
   derrière) et le battant (devant, qui pivote). */
.teaser-doors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
    max-width: 32rem;
    margin: 0 auto;
    perspective: 600px;
}

@media (min-width: 600px) {
    .teaser-doors {
        grid-template-columns: repeat(6, 1fr);
    }
}

.teaser-door {
    position: relative;
    aspect-ratio: 100 / 140;
}

.teaser-door__inside,
.teaser-door__leaf {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.teaser-door__leaf {
    transform-origin: left center;
    backface-visibility: hidden;
    transition: transform .9s cubic-bezier(.3, .7, .2, 1);
    transition-delay: calc(var(--i, 0) * 140ms);
}

.teaser-doors--open .teaser-door__leaf {
    transform: rotateY(-105deg);
}

.teaser-doors--open .teaser-door__inside {
    animation: teaser-door-glow 3s ease-in-out infinite;
}

.teaser-doors--open .teaser-door__bulb {
    animation: teaser-door-bulb 2s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * -0.3s);
}

.teaser-door__number {
    font-family: var(--font-family-heading);
    font-weight: 700;
    font-size: 1.4rem;
    fill: var(--color-primary);
}

.teaser-doors__hint {
    text-align: center;
    font-size: .8rem;
    color: var(--color-muted);
    margin: 1rem 0 0;
}

@keyframes teaser-door-glow {
    0%, 100% { opacity: .6; }
    50% { opacity: 1; }
}

@keyframes teaser-door-bulb {
    0%, 100% { opacity: .5; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .door,
    .door--featured,
    .door--shake,
    .christmas-sticky-cta .product__submit::after,
    .teaser-door__leaf,
    .teaser-doors--open .teaser-door__inside,
    .teaser-doors--open .teaser-door__bulb {
        animation: none !important;
        transition: none !important;
    }
}
