/* ==========================================================================
   pvnksea — promotions (bandeau, prix barrés, pastille)
   Tout vient des variables du thème actif (themes.css) : couleurs, motifs,
   ombres. Aucune couleur n'est écrite en dur, le bandeau suit chaque thème.
   ========================================================================== */

:root {
    /* rosace festonnée du sceau (18 festons autour d'un disque) */
    --promo-rosette: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='42'/%3E%3Cg%3E%3Ccircle cx='50' cy='9' r='8.4'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(20 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(40 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(60 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(80 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(100 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(120 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(140 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(160 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(180 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(200 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(220 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(240 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(260 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(280 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(300 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(320 50 50)'/%3E%3Ccircle cx='50' cy='9' r='8.4' transform='rotate(340 50 50)'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Bandeau ---------- */
.promo {
    position: relative;
    z-index: 1;
    /* sous la guirlande du thème (Noël, Saint-Valentin…) qui déborde du menu */
    margin-top: calc(var(--garland-h) * .62 + clamp(12px, 2.4vw, 22px));
}
.promo.is-hidden { display: none; }
/* le bandeau occupe déjà l'espace prévu pour la guirlande en haut de page */
.promo:not(.is-hidden) ~ main .page-top { padding-top: clamp(30px, 6vw, 64px); }
.promo:not(.is-hidden) ~ main .hero { padding-top: clamp(26px, 5vw, 56px); }

.promo-card {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "seal copy" "side side";
    align-items: center;
    gap: 14px 16px;
    padding: 18px 46px 18px 18px;
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: 24px;
    background:
        radial-gradient(28rem 14rem at 0% 0%, var(--accent-soft), transparent 70%),
        radial-gradient(22rem 12rem at 100% 100%, var(--glow-2), transparent 70%),
        linear-gradient(120deg, var(--accent-wash), var(--surface) 55%, var(--paper-2));
    box-shadow: var(--shadow-2), inset 0 1px 0 color-mix(in srgb, var(--surface) 70%, transparent);
    animation: promo-enter .8s var(--ease) .12s both;
}
.promo.is-instant .promo-card,
.promo.is-instant .promo-seal { animation: none; }
.promo.is-leaving .promo-card { animation: promo-leave .45s var(--ease) both; }

/* fin liseré pointillé, comme une étiquette cousue */
.promo-card::before {
    content: "";
    position: absolute;
    inset: 6px;
    z-index: -1;
    border: 1.5px dashed color-mix(in srgb, var(--accent) 28%, transparent);
    border-radius: 19px;
    pointer-events: none;
}

/* reflet qui traverse le bandeau */
.promo-shine {
    position: absolute;
    inset: -40% auto -40% 0;
    z-index: -1;
    width: 34%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
    mix-blend-mode: soft-light;
    transform: translateX(-160%) skewX(-18deg);
    animation: promo-shine 7s ease-in-out 1.4s infinite;
    pointer-events: none;
}

/* motifs du thème qui flottent dans le bandeau */
.promo-motifs { position: absolute; inset: 0; z-index: -1; color: var(--accent); pointer-events: none; }
.promo-motifs .glyph {
    position: absolute;
    opacity: .16;
    animation: promo-float 8s ease-in-out infinite alternate;
}
.promo-motifs .glyph:nth-child(1) { top: 10%; left: 34%; font-size: 18px; }
.promo-motifs .glyph:nth-child(2) { top: 64%; left: 46%; font-size: 12px; animation-delay: -2s; animation-duration: 9s; }
.promo-motifs .glyph:nth-child(3) { top: 18%; left: 62%; font-size: 14px; animation-delay: -4s; }
.promo-motifs .glyph:nth-child(4) { top: 70%; left: 78%; font-size: 22px; animation-delay: -1s; animation-duration: 10s; }
.promo-motifs .glyph:nth-child(5) { top: 6%; left: 90%; font-size: 11px; animation-delay: -5s; }
.promo-motifs .glyph:nth-child(6) { top: 76%; left: 16%; font-size: 15px; animation-delay: -3s; animation-duration: 11s; }

/* sceau festonné avec la réduction */
.promo-seal {
    grid-area: seal;
    position: relative;
    display: grid;
    place-items: center;
    width: 68px;
    aspect-ratio: 1;
    color: var(--accent-ink);
    animation: promo-seal-in 1s cubic-bezier(.3, 1.5, .5, 1) .35s both;
}
.promo-seal-edge {
    position: absolute;
    inset: 0;
    background: var(--accent);
    -webkit-mask: var(--promo-rosette) center / contain no-repeat;
    mask: var(--promo-rosette) center / contain no-repeat;
    filter: drop-shadow(0 8px 10px rgba(var(--shadow-rgb), .22));
    animation: promo-spin 36s linear infinite;
}
.promo-seal-edge::after {
    content: "";
    position: absolute;
    inset: 16%;
    border: 1.5px dashed color-mix(in srgb, var(--accent-ink) 55%, transparent);
    border-radius: 50%;
}
.promo-seal strong {
    position: relative;
    max-width: 78%;
    font: 700 1.12rem/1 var(--serif);
    letter-spacing: -.01em;
    text-align: center;
    overflow-wrap: anywhere;
    font-variant-numeric: lining-nums;
}
.promo-seal.is-long strong { font: 800 .62rem/1.1 var(--sans); letter-spacing: .02em; }

.promo-copy { grid-area: copy; min-width: 0; }
.promo-kicker {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 10px;
    margin: 0 0 2px 2px;
    color: var(--accent-text);
    font: 400 1.6rem/1 var(--script);
    -webkit-text-stroke: .3px currentColor;
    transform: rotate(-2.5deg);
    transform-origin: left bottom;
}
.promo-preview-tag {
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--ink-2);
    background: var(--surface);
    border: 1px dashed var(--line-2);
    font: 800 .66rem/1.2 var(--sans);
    letter-spacing: .03em;
    -webkit-text-stroke: 0;
}
.promo-title {
    color: var(--ink);
    font: 600 clamp(1.32rem, 3.8vw, 1.95rem)/1.08 var(--serif);
    letter-spacing: -.012em;
    text-wrap: balance;
}
.promo-title em { color: var(--accent-text); font-style: italic; font-weight: 500; }
.promo-text {
    margin-top: 5px;
    color: var(--ink-2);
    font-size: .93rem;
    line-height: 1.5;
    text-wrap: pretty;
}
.promo-until {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 11px;
    border-radius: 999px;
    color: var(--accent-text);
    background: var(--surface);
    font: 800 .76rem/1.4 var(--sans);
}

.promo-side {
    grid-area: side;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
}

/* compte à rebours */
.promo-countdown { display: grid; gap: 5px; }
.promo-countdown-label {
    color: var(--ink-3);
    font: 800 .66rem/1 var(--sans);
    letter-spacing: .14em;
    text-transform: uppercase;
}
.promo-tiles { display: flex; gap: 6px; }
.promo-tile {
    display: grid;
    justify-items: center;
    min-width: 48px;
    padding: 7px 6px 5px;
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: inset 0 -2px 0 rgba(var(--shadow-rgb), .05), 0 6px 12px -10px rgba(var(--shadow-rgb), .5);
}
.promo-tile b {
    display: block;
    color: var(--accent-text);
    font: 600 1.42rem/1 var(--serif);
    font-variant-numeric: tabular-nums lining-nums;
}
.promo-tile b.is-tick { animation: promo-tick .42s var(--ease); }
.promo-tile small {
    margin-top: 2px;
    color: var(--ink-3);
    font: 800 .62rem/1 var(--sans);
    letter-spacing: .06em;
    text-transform: uppercase;
}
.promo-tile.is-zero { display: none; }
.promo.is-ended .promo-countdown { opacity: .45; }

.promo-cta { min-height: 46px; padding: 10px 20px; }

.promo-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    color: var(--ink-2);
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    transition: color .2s ease, background-color .2s ease, transform .3s var(--ease);
}
.promo-close .icon { width: 15px; height: 15px; }
@media (hover: hover) {
    .promo-close:hover { color: var(--accent-text); background: var(--surface); transform: rotate(90deg); }
    .promo-card:hover .promo-seal-edge { animation-duration: 9s; }
    .promo-cta:hover .icon-go { transform: translateX(3px); }
}

@media (min-width: 760px) {
    .promo-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "seal copy side";
        gap: 16px 26px;
        padding: 22px 58px 22px 24px;
        border-radius: 28px;
    }
    .promo-card::before { border-radius: 23px; }
    .promo-seal { width: 94px; }
    .promo-seal strong { font-size: 1.5rem; }
    .promo-seal.is-long strong { font-size: .74rem; }
    .promo-side { flex-wrap: nowrap; justify-content: flex-end; }
    .promo-tile { min-width: 54px; }
    .promo-tile b { font-size: 1.62rem; }
}
/* mobile : bandeau compact, compte à rebours et bouton sur une seule ligne */
@media (max-width: 759px) {
    .promo { margin-top: calc(var(--garland-h) * .62 + 26px); }
    .promo-card { gap: 10px 13px; padding: 14px 42px 14px 14px; border-radius: 20px; }
    .promo-card::before { inset: 5px; border-radius: 16px; }
    .promo-seal { width: 60px; }
    .promo-seal strong { font-size: 1rem; }
    .promo-kicker { font-size: 1.32rem; }
    .promo-title { font-size: 1.28rem; }
    .promo-text { margin-top: 3px; font-size: .84rem; line-height: 1.45; }
    .promo-close { top: 8px; right: 8px; width: 28px; height: 28px; }
    .promo-side { flex-wrap: nowrap; align-items: flex-end; gap: 10px; }
    .promo-countdown { flex: 1; min-width: 0; gap: 4px; }
    .promo-countdown-label { font-size: .6rem; }
    .promo-tiles { gap: 5px; }
    .promo-tile { flex: 1; min-width: 0; padding: 5px 2px 4px; border-radius: 11px; }
    .promo-tile b { font-size: 1.18rem; }
    .promo-tile small { font-size: .56rem; }
    /* à côté du compte à rebours, le bouton devient une pastille fléchée */
    .promo-countdown + .promo-cta { flex: none; width: 46px; min-height: 46px; height: 46px; padding: 0; border-radius: 50%; }
    .promo-countdown + .promo-cta .promo-cta-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .promo-cta:only-child { width: 100%; min-height: 42px; }
}

/* ---------- Pastille (bandeau masqué) ---------- */
.promo-pill {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 16px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 15px 5px 5px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow-2);
    font: 800 .84rem/1 var(--sans);
    animation: promo-pill-in .7s cubic-bezier(.3, 1.5, .5, 1) both;
    transition: transform .25s var(--ease), box-shadow .25s ease;
}
.promo-pill-seal {
    display: grid;
    place-items: center;
    min-width: 40px;
    height: 40px;
    padding: 0 9px;
    border-radius: 999px;
    color: var(--accent-ink);
    background: var(--accent);
    font: 700 .95rem/1 var(--serif);
    white-space: nowrap;
}
@media (hover: hover) { .promo-pill:hover { transform: translateY(-3px); } }

/* ---------- Page des tarifs ---------- */
/* La pastille partage la case de la vignette (grille), sans position absolue :
   un élément absolu dans la liste en deux colonnes la ramène à une seule colonne dans Chrome. */
.offer.is-promo > .offer-thumb { grid-column: 1; grid-row: 1; }
.offer.is-promo > div { grid-column: 2; grid-row: 1; }
.promo-sticker {
    position: relative;
    z-index: 2;
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    justify-self: start;
    translate: -12px -11px;
    max-width: 10em;
    padding: 4px 10px;
    overflow: hidden;
    border-radius: 999px;
    color: var(--accent-ink);
    background: var(--accent);
    box-shadow: 0 8px 14px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .3);
    font: 800 .72rem/1.25 var(--sans);
    letter-spacing: .02em;
    text-overflow: ellipsis;
    white-space: nowrap;
    rotate: -10deg;
    animation: promo-sticker-in .8s cubic-bezier(.3, 1.6, .5, 1) .25s both;
    pointer-events: none;
}
.offer-priority .promo-sticker { translate: -8px -12px; }
.offer.has-discount .offer-thumb { box-shadow: 0 0 0 2px var(--accent-soft), 0 10px 18px -12px var(--accent); }

.price-was {
    position: relative;
    display: inline-block;
    margin-right: .3em;
    color: var(--ink-3);
    font-size: .6em;
    font-weight: 500;
    text-decoration: none;
    vertical-align: .2em;
}
.price-was::after {
    content: "";
    position: absolute;
    top: 52%;
    right: -8%;
    left: -8%;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    /* trait visible par défaut ; l'animation le dessine de gauche à droite */
    transform: rotate(-10deg);
    transform-origin: left center;
    animation: promo-strike .6s var(--ease) .45s both;
}
.price-now {
    display: inline-block;
    color: var(--accent-text);
    animation: promo-pop .7s cubic-bezier(.3, 1.5, .5, 1) .7s both;
}
.addons b .price-was { font-size: .86em; font-weight: 700; vertical-align: 0; }
.addons b .price-was::after { height: 1.5px; opacity: .8; }
.addons b.has-discount .price-now { color: var(--accent-text); }

/* ---------- Animations ---------- */
@keyframes promo-enter { from { transform: translateY(-14px) scale(.985); } to { transform: none; } }
@keyframes promo-leave { to { opacity: 0; transform: translateY(-10px) scale(.97); } }
@keyframes promo-seal-in { 0% { transform: scale(.4) rotate(-40deg); } 100% { transform: none; } }
@keyframes promo-spin { to { transform: rotate(360deg); } }
@keyframes promo-shine { 0% { transform: translateX(-160%) skewX(-18deg); } 38%, 100% { transform: translateX(420%) skewX(-18deg); } }
@keyframes promo-float { from { transform: translateY(0) rotate(0deg); } to { transform: translateY(-9px) rotate(24deg); } }
@keyframes promo-tick { from { transform: translateY(-40%); } to { transform: none; } }
@keyframes promo-pill-in { from { transform: translateY(24px) scale(.8); } to { transform: none; } }
@keyframes promo-sticker-in { from { transform: scale(.3); } to { transform: none; } }
@keyframes promo-strike { from { transform: rotate(-10deg) scaleX(0); } to { transform: rotate(-10deg) scaleX(1); } }
@keyframes promo-pop { 0% { transform: translateY(6px) scale(.8); } 100% { transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .promo-card, .promo-seal, .promo-seal-edge, .promo-shine, .promo-motifs .glyph,
    .promo-tile b.is-tick, .promo-pill, .promo-sticker, .price-now, .price-was::after { animation: none !important; }
    .promo-shine { display: none; }
    .price-was::after { transform: rotate(-10deg); }
}
