/* ═══════════════════════════════════════════════════════════════
   Thème de Noël — chargé uniquement quand NOEL_ACTIF est vrai
   (voir config.php). Tout est scopé sous body.noel.
   ═══════════════════════════════════════════════════════════════ */

/* ── Neige (canvas plein écran, ne capte aucun clic) ── */
#noel-neige {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9980; /* sous le bouton d'appel (9990) et les cookies (9998+) */
}

/* ── Bonnet sur le bouton « Commander en ligne » (header desktop) ── */
body.noel header nav[aria-label="Navigation principale"] .btn-primary-rouge {
    position: relative;
    overflow: visible;
}

body.noel header nav[aria-label="Navigation principale"] .btn-primary-rouge::before {
    content: "";
    position: absolute;
    left: -12px;
    top: -20px;
    width: 38px;
    aspect-ratio: 100 / 84;
    background: url("/img/noel/bonnet.svg") no-repeat center / contain;
    transform: rotate(-20deg);
    transform-origin: 50% 90%;
    pointer-events: none;
    animation: noel-bonnet 4.5s ease-in-out infinite;
}

@keyframes noel-bonnet {
    0%, 100% { transform: rotate(-20deg); }
    50%      { transform: rotate(-14deg); }
}

/* ── Bonnet sur le bouton « Appeler » (mobile) ── */
body.noel #float-call-toggle {
    position: relative;
    overflow: visible;
}

body.noel #float-call-toggle::before {
    content: "";
    position: absolute;
    left: -10px;
    top: -19px;
    width: 34px;
    aspect-ratio: 100 / 84;
    background: url("/img/noel/bonnet.svg") no-repeat center / contain;
    transform: rotate(-22deg);
    pointer-events: none;
}

/* ── Couche de neige + stalactites sur le haut du footer ──
   Le motif (240×84) se répète horizontalement : le bord du footer
   est à 24px du haut du motif, les stalactites descendent dedans. */
body.noel footer.bg-charcoal {
    position: relative;
    padding-top: 32px; /* laisse la place aux stalactites */
}

body.noel footer.bg-charcoal::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -24px;
    height: 84px;
    background: url("/img/noel/congere.svg") repeat-x left top / 240px 84px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25));
    pointer-events: none;
    z-index: 1;
}

/* ── Bouton pour couper / relancer la neige (accessibilité WCAG 2.2.2) ── */
#noel-toggle {
    position: fixed;
    left: 1rem;
    bottom: 1.25rem;
    z-index: 9990;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: 1px solid rgba(26, 26, 26, .12);
    background: rgba(255, 255, 255, .92);
    color: #5f7aa0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
    cursor: pointer;
    transition: transform .2s ease, color .2s ease, opacity .2s ease;
}

#noel-toggle:hover { transform: scale(1.06); }
#noel-toggle:focus-visible { outline: 2px solid #c9002e; outline-offset: 3px; }
#noel-toggle svg { width: 1.25rem; height: 1.25rem; }

/* Neige coupée : flocon barré + atténué */
#noel-toggle[aria-pressed="false"] { color: #9ca3af; }
#noel-toggle .noel-toggle__barre { display: none; }
#noel-toggle[aria-pressed="false"] .noel-toggle__barre { display: inline; }

@media (prefers-reduced-motion: reduce) {
    body.noel header .btn-primary-rouge::before { animation: none; }
}

@media print {
    #noel-neige, #noel-toggle { display: none !important; }
}
