/*!
 * Tuyé du Papy Gaby — Mode Noël
 * Tout est préfixé .noel-… et rattaché à body.noel-mode : rien ne fuit sur le site classique.
 */

@font-face {
    font-family: "Tuye Noel Script";
    src: url("fonts/mr-dafoe.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

body.noel-mode {
    --noel-red: #c4161c;
    --noel-red-dark: #8e0d12;
    --noel-gold: #ffd76a;
    --noel-green: #0f5c35;
    --noel-snow: #ffffff;
}

/* ------------------------------------------------------------------ */
/* Neige                                                              */
/* ------------------------------------------------------------------ */

.noel-snow {
    position: fixed;
    inset: 0;
    z-index: 60;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Bandeau des fêtes                                                  */
/* ------------------------------------------------------------------ */

.noel-banner {
    position: relative;
    z-index: 31;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: .55rem 3rem .75rem;
    color: #fff7e0;
    text-align: center;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
    background:
        radial-gradient(circle at 12% 30%, rgba(255, 215, 106, .25) 0 2px, transparent 3px) 0 0 / 46px 38px,
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, .22) 0 1.5px, transparent 2.5px) 0 0 / 31px 29px,
        linear-gradient(180deg, #d41f26 0%, var(--noel-red) 55%, var(--noel-red-dark) 100%);
    box-shadow: inset 0 -1px 0 rgba(255, 215, 106, .6);
}

.noel-banner::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 5px;
    background: repeating-linear-gradient(135deg, #fff 0 8px, var(--noel-red) 8px 16px);
}

.noel-banner__script {
    font-family: "Tuye Noel Script", cursive;
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1;
    color: var(--noel-gold);
    text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
    white-space: nowrap;
}

.noel-banner__star {
    color: var(--noel-gold);
    animation: noel-star-pulse 1.8s ease-in-out infinite;
    will-change: transform, opacity;
}

.noel-banner__star:last-of-type {
    animation-delay: .9s;
}

.noel-banner__close {
    position: absolute;
    top: 50%;
    right: .75rem;
    width: 1.75rem;
    height: 1.75rem;
    margin-top: -.9rem;
    border: 1px solid rgba(255, 247, 224, .5);
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.noel-banner__close:hover,
.noel-banner__close:focus-visible {
    background: rgba(255, 255, 255, .15);
    outline: 2px solid var(--noel-gold);
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .noel-banner {
        flex-wrap: wrap;
        gap: .1rem .5rem;
        padding: .5rem 2.75rem .7rem;
        font-size: 1rem; /* lisibilité mobile : 16 px minimum */
    }

    .noel-banner__star {
        display: none;
    }

    .noel-banner__script {
        font-size: 1.35rem;
    }
}

/* ------------------------------------------------------------------ */
/* Guirlande                                                          */
/* ------------------------------------------------------------------ */

.noel-garland-host {
    position: relative;
}

.noel-garland {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    right: 0;
    z-index: 31;
    height: 66px;
    overflow: visible;
    pointer-events: none;
}

.noel-garland.is-fixed {
    position: fixed;
    top: 0;
}

.noel-garland svg {
    display: block;
    overflow: visible;
}

.noel-bulb__glass {
    fill: var(--c);
    stroke: rgba(0, 0, 0, .18);
    stroke-width: .8;
    animation: noel-bulb-glass 2.4s ease-in-out var(--d, 0s) infinite;
}

.noel-bulb__glow {
    fill: var(--c);
    opacity: 0;
    animation: noel-bulb-glow 2.4s ease-in-out var(--d, 0s) infinite;
}

@keyframes noel-bulb-glass {
    0%, 100% { fill-opacity: .55; }
    45%, 60% { fill-opacity: 1; }
}

@keyframes noel-bulb-glow {
    0%, 100% { opacity: 0; }
    45%, 60% { opacity: .45; }
}

/* ------------------------------------------------------------------ */
/* Décor : bonnet, neige sur les boutons, congère                     */
/* ------------------------------------------------------------------ */

.noel-hat-host {
    position: relative;
    overflow: visible !important;
}

.noel-hat {
    position: absolute;
    top: -24%;
    right: -16%;
    z-index: 5;
    width: 62%;
    pointer-events: none;
    transform: rotate(16deg);
    transform-origin: 30% 80%;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .25));
    animation: noel-hat-wiggle 6s ease-in-out infinite;
    will-change: transform;
}

.noel-hat svg {
    display: block;
    width: 100%;
    height: auto;
}

@keyframes noel-hat-wiggle {
    0%, 86%, 100% { transform: rotate(16deg); }
    90% { transform: rotate(10deg); }
    94% { transform: rotate(20deg); }
}

.noel-capped {
    position: relative;
}

.noel-capped::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 8%;
    right: 8%;
    z-index: 2;
    height: 13px;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14' preserveAspectRatio='none'%3E%3Cpath d='M2 12 C2 4 10 3 16 5 C20 0 30 0 34 5 C40 1 50 2 52 7 C58 1 70 1 74 6 C80 1 92 2 94 6 C100 1 112 2 114 7 C120 8 120 13 112 13 L8 13 C3 13 2 13 2 12 Z' fill='%23fff' stroke='%23d6e2ec' stroke-width='1'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    filter: drop-shadow(0 1px 1px rgba(0, 40, 80, .2));
}

body.noel-mode a[aria-controls="eshop-menu"] {
    background: linear-gradient(180deg, #e0262d, var(--noel-red));
    box-shadow: 0 0 0 2px rgba(255, 215, 106, .7), 0 6px 16px -6px rgba(196, 22, 28, .6);
}

body.noel-mode .main-menu > li > :is(a, button) {
    text-decoration-color: #e0262d;
}

.noel-drift-host {
    position: relative;
}

/* Neige posée sur le bord « papier déchiré » du pied de page. */
.noel-footer-snow {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.noel-footer-snow__layer {
    filter: drop-shadow(0 -1px 0 rgba(93, 47, 36, .12));
}

/* Repli si le thème n'a pas de bord déchiré. */
.noel-drift {
    position: absolute;
    top: -50px;
    left: 0;
    right: 0;
    z-index: 6;
    height: 52px;
    pointer-events: none;
}

.noel-drift__snow {
    display: block;
    width: 100%;
    height: 100%;
}

.noel-snowman {
    position: absolute;
    top: -80px;
    right: 12px;
    z-index: 6;
    width: 58px;
    pointer-events: none;
    transform-origin: 50% 100%;
    animation: noel-snowman 5s ease-in-out infinite;
    will-change: transform;
}

.noel-snowman[style*="left"] {
    right: auto;
}

.noel-snowman svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    filter: drop-shadow(0 4px 4px rgba(61, 31, 24, .18));
}

@keyframes noel-snowman {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

@media (min-width: 1024px) {
    .noel-drift {
        top: -134px;
        height: 70px;
    }

    .noel-snowman {
        width: 84px;
    }
}

/* ------------------------------------------------------------------ */
/* Traîneau                                                           */
/* ------------------------------------------------------------------ */

.noel-flight {
    position: fixed;
    top: var(--fly-top, 14vh);
    left: 0;
    z-index: 70;
    pointer-events: none;
    animation: noel-fly var(--fly-duration, 16s) linear forwards;
    will-change: transform;
}

@keyframes noel-fly {
    from { transform: translate3d(-110%, 0, 0); }
    to { transform: translate3d(calc(100vw + 10px), 0, 0); }
}

.noel-flight__bob {
    display: flex;
    align-items: center;
    animation: noel-bob 2.4s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes noel-bob {
    from { transform: translateY(-10px) rotate(-2deg); }
    to { transform: translateY(10px) rotate(2deg); }
}

.noel-banner-tow {
    position: relative;
    margin-right: 46px;
    padding: .3rem 1.4rem .45rem;
    border: 2px solid var(--noel-gold);
    border-radius: 6px;
    background: linear-gradient(180deg, #e0262d, var(--noel-red-dark));
    box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .45);
    transform-origin: 100% 50%;
    animation: noel-tow 1.2s ease-in-out infinite alternate;
}

.noel-banner-tow::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -48px;
    width: 48px;
    border-top: 2px solid #7a4b23;
}

.noel-banner-tow span {
    display: block;
    font-family: "Tuye Noel Script", cursive;
    font-size: 2.1rem;
    line-height: 1.1;
    color: var(--noel-gold);
    white-space: nowrap;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}

@keyframes noel-tow {
    from { transform: skewY(-2deg) rotate(-1.5deg); }
    to { transform: skewY(2deg) rotate(1.5deg); }
}

.noel-sleigh {
    display: block;
    width: 380px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    pointer-events: auto;
}

.noel-sleigh:focus-visible {
    outline: 3px solid var(--noel-gold);
    outline-offset: 4px;
    border-radius: 12px;
}

.noel-sleigh__svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.noel-sleigh .leg {
    fill: none;
    stroke: #6b4423;
    stroke-width: 4;
    stroke-linecap: round;
    transform-box: fill-box;
    transform-origin: 50% 0;
}

.noel-sleigh .leg--a {
    animation: noel-gallop .45s ease-in-out infinite alternate;
}

.noel-sleigh .leg--b {
    animation: noel-gallop .45s ease-in-out infinite alternate-reverse;
}

@keyframes noel-gallop {
    from { transform: rotate(-22deg); }
    to { transform: rotate(22deg); }
}

.noel-deer__nose {
    filter: drop-shadow(0 0 6px #ff2b2b);
    animation: noel-nose 1s ease-in-out infinite alternate;
}

@keyframes noel-nose {
    from { opacity: .75; }
    to { opacity: 1; }
}

.noel-santa__arm {
    transform-box: fill-box;
    transform-origin: 0% 100%;
    animation: noel-wave .6s ease-in-out infinite alternate;
}

@keyframes noel-wave {
    from { transform: rotate(-14deg); }
    to { transform: rotate(16deg); }
}

.noel-spark {
    position: fixed;
    z-index: 69;
    font-size: 15px;
    line-height: 1;
    pointer-events: none;
    text-shadow: 0 0 8px currentColor;
    animation: noel-spark 1.3s ease-out forwards;
}

@keyframes noel-spark {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(36px) scale(.3) rotate(90deg); }
}

.noel-gift {
    position: fixed;
    z-index: 71;
    width: 38px;
    pointer-events: none;
    animation: noel-gift-fall 1.9s cubic-bezier(.45, 0, .8, .4) both;
}

.noel-gift svg {
    display: block;
    width: 100%;
}

@keyframes noel-gift-fall {
    0% { opacity: 0; transform: translateY(-10px) rotate(0); }
    10% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; transform: translateY(var(--fall, 80vh)) rotate(var(--spin, 180deg)); }
}

.noel-hoho {
    position: fixed;
    z-index: 72;
    padding: .2rem .9rem .35rem;
    border: 2px solid var(--noel-red);
    border-radius: 999px;
    background: #fff;
    color: var(--noel-red);
    font-family: "Tuye Noel Script", cursive;
    font-size: 1.9rem;
    line-height: 1.1;
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
    animation: noel-pop 1.8s ease-out forwards;
}

@keyframes noel-pop {
    0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); }
    15% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
    25% { transform: translate(-50%, 0) scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -24px); }
}

@media (max-width: 767px) {
    .noel-sleigh {
        width: 230px;
    }

    .noel-banner-tow {
        margin-right: 30px;
        padding: .2rem .9rem .3rem;
    }

    .noel-banner-tow::after {
        right: -32px;
        width: 32px;
    }

    .noel-banner-tow span {
        font-size: 1.5rem;
    }
}

/* ------------------------------------------------------------------ */
/* Badge : compte à rebours + mode classique                          */
/* ------------------------------------------------------------------ */

.noel-badge,
.noel-on-pill {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 65;
}

.noel-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.noel-badge__count {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem 1rem .6rem .7rem;
    border: 2px solid var(--noel-gold);
    border-radius: 18px;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .2) 0 1.5px, transparent 2.5px) 0 0 / 22px 22px,
        linear-gradient(160deg, #e0262d, var(--noel-red-dark));
    color: #fff;
    box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .5);
    animation: noel-badge-in .6s cubic-bezier(.2, 1.4, .4, 1) both;
}

.noel-badge__tree {
    font-size: 1.7rem;
    line-height: 1;
    animation: noel-tree 2.6s ease-in-out infinite;
    will-change: transform;
}

@keyframes noel-tree {
    0%, 100% { transform: rotate(-6deg); }
    50% { transform: rotate(6deg); }
}

.noel-badge__count strong {
    display: block;
    font-family: "Old Standard TT", serif;
    font-size: 1.35rem;
    line-height: 1.05;
    color: var(--noel-gold);
}

.noel-badge__count small {
    display: block;
    max-width: 14rem;
    font-size: .72rem;
    line-height: 1.25;
}

.noel-badge__off,
.noel-on-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    border: 1px solid rgba(15, 92, 53, .35);
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: var(--noel-green, #0f5c35);
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .35);
}

.noel-on-pill {
    color: #0f5c35;
}

.noel-badge__off:hover,
.noel-badge__off:focus-visible,
.noel-on-pill:hover,
.noel-on-pill:focus-visible {
    background: #fff;
    outline: 2px solid #0f5c35;
    outline-offset: 2px;
}

.noel-badge__preview {
    padding: .1rem .5rem;
    border-radius: 999px;
    background: #ffb347;
    color: #3d2400;
    font-size: .65rem;
    font-weight: 700;
}

@keyframes noel-badge-in {
    from { opacity: 0; transform: translateY(16px) scale(.9); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 1023px) {
    .noel-badge,
    .noel-on-pill {
        right: 10px;
        bottom: calc(4.5rem + env(safe-area-inset-bottom) + 10px);
    }

    .noel-badge__off,
    .noel-on-pill,
    .noel-badge__preview {
        font-size: 1rem; /* lisibilité mobile : 16 px minimum */
    }

    .noel-badge__count {
        padding: .4rem .8rem .45rem .55rem;
    }

    .noel-badge__count strong {
        font-size: 1.1rem;
    }

    .noel-badge__count small {
        max-width: 11rem;
        font-size: 1rem; /* lisibilité mobile : 16 px minimum */
    }

    .noel-badge__off-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

/* ------------------------------------------------------------------ */
/* « Ho ho ho ! » à l'ajout au panier                                 */
/* ------------------------------------------------------------------ */

.noel-cheer {
    position: fixed;
    left: 50%;
    bottom: 96px;
    z-index: 75;
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .7rem 1.4rem .7rem .8rem;
    border: 3px solid var(--noel-red, #c4161c);
    border-radius: 999px;
    background: #fff;
    color: #3b1d16;
    font-size: 1rem;
    box-shadow: 0 18px 36px -16px rgba(0, 0, 0, .5);
    transform: translateX(-50%);
    animation: noel-cheer-in .55s cubic-bezier(.2, 1.5, .4, 1) both;
}

.noel-cheer.is-leaving {
    animation: noel-cheer-out .5s ease-in forwards;
}

.noel-cheer strong {
    font-family: "Tuye Noel Script", cursive;
    font-size: 1.9rem;
    font-weight: 400;
    color: var(--noel-red, #c4161c);
    margin-right: .25rem;
}

.noel-cheer__gift {
    width: 42px;
    animation: noel-gift-bounce .6s ease-in-out infinite alternate;
}

.noel-cheer__gift svg {
    display: block;
    width: 100%;
}

.noel-confetti {
    position: absolute;
    left: 50%;
    top: 50%;
    font-size: 16px;
    pointer-events: none;
    animation: noel-confetti 1.1s ease-out both;
}

@keyframes noel-confetti {
    from { opacity: 1; transform: translate(-50%, -50%) scale(.4); }
    to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1) rotate(160deg); }
}

@keyframes noel-gift-bounce {
    from { transform: translateY(0) rotate(-6deg); }
    to { transform: translateY(-6px) rotate(6deg); }
}

@keyframes noel-cheer-in {
    from { opacity: 0; transform: translate(-50%, 30px) scale(.8); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes noel-cheer-out {
    to { opacity: 0; transform: translate(-50%, 20px) scale(.9); }
}

@media (max-width: 1023px) {
    .noel-cheer {
        bottom: calc(4.5rem + env(safe-area-inset-bottom) + 70px);
        max-width: calc(100vw - 2rem);
        font-size: 1rem; /* lisibilité mobile : 16 px minimum */
    }
}

@keyframes noel-star-pulse {
    0%, 100% { opacity: .5; transform: scale(.85); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* ------------------------------------------------------------------ */
/* Moins d'animations demandées par le visiteur                       */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    .noel-banner__star,
    .noel-bulb__glass,
    .noel-bulb__glow,
    .noel-hat,
    .noel-snowman,
    .noel-badge__count,
    .noel-badge__tree,
    .noel-cheer,
    .noel-cheer__gift,
    .noel-confetti {
        animation: none !important;
    }

    .noel-bulb__glass {
        fill-opacity: 1;
    }
}
