/* ===== Palette ===== */
/* Relevée sur le logo : bleu électrique, halo cyan, carton jaune-orangé, ruban rouge */
:root {
    --fond: #EFF3FC;
    --surface: #FFFFFF;
    --nuit: #061660;
    --bleu-fonce: #08207A;
    --bleu: #0F3BC8;
    --bleu-vif: #1E6BFF;
    --halo: #4FC3FF;
    --carton: #FFB81F;
    --carton-clair: #FFD04F;
    --carton-fonce: #E98A00;
    --ruban: #E3241B;
    --ruban-fonce: #A8140E;
    --jaune: #FFDD1F;
    --encre: #0B1A4A;
    --encre-douce: #4E5A7A;
    --papier: #FFFEFA;
}

/* Une couleur d'étiquette par rayon : pleine, foncée et douce */
.tone-encre  { --tone: var(--bleu);  --tone-fonce: var(--bleu-fonce); --tone-doux: #E4ECFF; }
.tone-orange { --tone: #E2620E;      --tone-fonce: #A84305; --tone-doux: #FFEBDA; }
.tone-bleu   { --tone: #1E6BFF;      --tone-fonce: #1046B8; --tone-doux: #E1ECFF; }
.tone-violet { --tone: #7A3BD0;      --tone-fonce: #55229C; --tone-doux: #EEE4FB; }
.tone-vert   { --tone: #1D8A4A;      --tone-fonce: #126134; --tone-doux: #DDF2E4; }
.tone-lagon  { --tone: #0B8790;      --tone-fonce: #075F66; --tone-doux: #D8F1F2; }

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--encre);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    background-color: var(--fond);
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

:focus-visible {
    outline: 3px solid var(--bleu);
    outline-offset: 4px;
}

/* ===== En-tête : le fond bleu électrique du logo, avec ses rayons ===== */
.carton {
    position: relative;
    padding: 0 24px 170px;
    text-align: center;
    color: #fff;
    background-color: var(--bleu-fonce);
    background-image:
        repeating-conic-gradient(from 0deg at 50% 22%, rgba(120, 190, 255, 0.09) 0 5deg, transparent 5deg 12deg),
        radial-gradient(circle at 50% 22%, var(--bleu-vif) 0, var(--bleu) 30%, var(--bleu-fonce) 62%, var(--nuit) 100%);
    overflow: hidden;
}

.carton :focus-visible { outline-color: var(--jaune); }

/* Le ruban rouge qui ferme le colis */
.scotch {
    position: relative;
    margin: 0 -24px;
    padding: 9px 0;
    background: linear-gradient(180deg, #F2392E, var(--ruban) 55%, var(--ruban-fonce));
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
    white-space: nowrap;
    overflow: hidden;
}

.scotch span {
    display: inline-block;
    font-family: 'Rubik', 'Arial Black', sans-serif;
    font-weight: 900;
    font-style: italic;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--jaune);
}

.carton-inner {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding-top: 30px;
}

/* Le logo au centre, avec le halo cyan de son anneau */
.marque {
    display: inline-block;
    border-radius: 50%;
}

.marque img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: drop-shadow(0 0 26px rgba(79, 195, 255, 0.55));
}

.carton-maj {
    display: block;
    width: fit-content;
    margin: 22px auto 0;
    padding: 4px 14px;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #DCE8FF;
}

/* Le gros lettrage blanc cerné de bleu nuit, comme sur le logo */
.titre {
    margin-top: 18px;
    font-family: 'Rubik', 'Arial Black', sans-serif;
    font-weight: 900;
    font-size: clamp(2.6rem, 6.6vw, 5.2rem);
    line-height: 1;
    letter-spacing: -0.015em;
    text-wrap: balance;
    color: #fff;
    text-shadow:
        0 3px 0 var(--nuit),
        0 6px 0 rgba(6, 22, 96, 0.55),
        0 0 30px rgba(79, 195, 255, 0.35);
}

.titre-jaune {
    font-style: italic;
    color: var(--jaune);
}

.chapo {
    max-width: 50ch;
    margin: 22px auto 0;
    font-size: 1.12rem;
    color: rgba(235, 242, 255, 0.88);
}

.pictos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 26px;
    margin-top: 20px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--halo);
}

/* La pastille « Prix cassés » en étoile jaune */
.tampon {
    position: absolute;
    top: 120px;
    right: max(24px, calc(50% - 560px));
    display: grid;
    place-items: center;
    align-content: center;
    width: 150px;
    height: 150px;
    background: var(--jaune);
    color: var(--ruban);
    text-transform: uppercase;
    transform: rotate(12deg);
    clip-path: polygon(50% 0%, 59% 13%, 74% 6%, 77% 22%, 93% 22%, 88% 38%, 100% 50%, 88% 62%, 93% 78%, 77% 78%, 74% 94%, 59% 87%, 50% 100%, 41% 87%, 26% 94%, 23% 78%, 7% 78%, 12% 62%, 0% 50%, 12% 38%, 7% 22%, 23% 22%, 26% 6%, 41% 13%);
}

.tampon span {
    font-family: 'Rubik', 'Arial Black', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.tampon strong {
    font-family: 'Rubik', 'Arial Black', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    font-style: italic;
    line-height: 1;
}

/* ===== La boîte en carton : les filtres ===== */
.tri {
    position: relative;
    width: calc(100% - 32px);
    max-width: 1080px;
    margin: -110px auto 0;
    padding: 30px 32px 34px;
    text-align: center;
    border-radius: 6px;
    background: linear-gradient(180deg, var(--carton-clair), var(--carton) 45%, #F7A40E);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.45),
        inset 0 -4px 0 rgba(160, 80, 0, 0.25),
        0 30px 60px -24px rgba(6, 22, 96, 0.6);
}

/* Les deux rabats ouverts du carton, qui débordent sur le bleu */
.tri::before,
.tri::after {
    content: '';
    position: absolute;
    top: -38px;
    width: 50%;
    height: 40px;
    background: linear-gradient(180deg, var(--carton-fonce), #F49A0A);
}

.tri::before { left: 0; clip-path: polygon(0 100%, 6% 0, 96% 0, 100% 100%); transform: skewX(-8deg); transform-origin: bottom; }
.tri::after  { right: 0; clip-path: polygon(0 100%, 4% 0, 94% 0, 100% 100%); transform: skewX(8deg); transform-origin: bottom; }

.tri-tete h2 {
    font-family: 'Rubik', 'Arial Black', sans-serif;
    font-weight: 900;
    font-size: 2rem;
    line-height: 1.1;
    color: var(--nuit);
}

.tri-tete p {
    margin-top: 4px;
    font-size: 0.98rem;
    color: #5A3200;
}

.etiquettes {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
    margin-top: 26px;
}

/* Une étiquette d'expédition collée un peu de travers */
.etiquette {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 0 12px;
    border: none;
    border-radius: 4px;
    background: var(--papier);
    color: var(--encre);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transform: rotate(var(--penche, 0deg));
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 8px 16px -10px rgba(110, 55, 0, 0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.etiquette:hover { transform: rotate(0deg) translateY(-3px); }

.etiquette-bande {
    padding: 5px 12px;
    border-radius: 4px 4px 0 0;
    background: var(--tone);
    color: #fff;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.etiquette-nom {
    margin: 10px 12px 0;
    font-family: 'Rubik', 'Arial Black', sans-serif;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.15;
}

.etiquette-compte {
    margin: 2px 12px 0;
    font-size: 0.82rem;
    color: var(--encre-douce);
}

/* Le code-barres de l'étiquette */
.etiquette-code {
    height: 18px;
    margin: 10px 12px 0;
    background: repeating-linear-gradient(90deg,
        var(--encre) 0 2px, transparent 2px 4px,
        var(--encre) 4px 5px, transparent 5px 8px,
        var(--encre) 8px 11px, transparent 11px 12px);
    opacity: 0.85;
}

/* L'étiquette choisie : collée bien droite avec un morceau de ruban */
.etiquette[aria-pressed="true"] {
    transform: rotate(0deg) translateY(-3px);
    box-shadow: 0 0 0 3px var(--tone), 0 12px 20px -10px rgba(110, 55, 0, 0.9);
}

.etiquette[aria-pressed="true"]::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    width: 58px;
    height: 22px;
    background: var(--ruban);
    opacity: 0.92;
    transform: translateX(-50%) rotate(-4deg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ===== Déballage : les bons de réduction ===== */
.deballage {
    max-width: 1180px;
    margin: 0 auto;
    padding: 60px 24px 96px;
}

.grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 26px;
}

.bon {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 1px 0 rgba(11, 26, 74, 0.06), 0 16px 30px -20px rgba(6, 22, 96, 0.45);
}

.bon-image {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    min-height: 0;
    padding: 22px;
    border-radius: 16px 16px 0 0;
    background: var(--tone-doux);
}

.bon-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Fond le blanc des photos Amazon dans la couleur du rayon */
    mix-blend-mode: multiply;
    transition: transform 0.35s ease;
}

.bon:hover .bon-image img { transform: scale(1.04); }

.bon-corps {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 20px 18px;
}

.bon-rayon {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--tone);
    color: #fff;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bon-titre {
    margin: 10px 0 8px;
    font-size: 1.14rem;
    font-weight: 700;
    line-height: 1.25;
}

.bon-titre a { transition: color 0.18s; }
.bon-titre a:hover { color: var(--tone); }

.bon-desc {
    font-size: 0.93rem;
    color: var(--encre-douce);
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Le talon détachable : pointillés et encoches de chaque côté */
.bon-talon {
    position: relative;
    padding: 18px 20px 20px;
    border-top: 2px dashed rgba(11, 26, 74, 0.2);
}

.bon-talon::before,
.bon-talon::after {
    content: '';
    position: absolute;
    top: -12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--fond);
}

.bon-talon::before { left: -11px; }
.bon-talon::after  { right: -11px; }

.bon-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 20px;
    border-radius: 10px;
    background: var(--bleu);
    color: #fff;
    font-weight: 700;
    transition: background-color 0.18s ease;
}

.bon-cta::before {
    content: '✂';
    font-size: 1.05rem;
    line-height: 1;
}

.bon-cta:hover { background: var(--tone); }

/* ===== Chargement ===== */
.loading {
    padding: 40px;
    text-align: center;
    color: var(--encre-douce);
    font-weight: 600;
}

/* ===== Pied de page : le ticket de caisse ===== */
.comptoir {
    padding: 64px 16px 36px;
    background-color: var(--nuit);
    background-image: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(30, 107, 255, 0.45), transparent 70%);
    color: rgba(220, 232, 255, 0.65);
    text-align: center;
}

.ticket {
    position: relative;
    max-width: 420px;
    margin: 0 auto 30px;
    padding: 30px 28px 26px;
    background: var(--papier);
    color: var(--encre);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.86rem;
    line-height: 1.6;
    /* Bord déchiré en dents de scie en bas du ticket */
    --dent: 9px;
    -webkit-mask:
        conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--dent) * 2) var(--dent) repeat-x,
        linear-gradient(#000 0 0) top / 100% calc(100% - var(--dent)) no-repeat;
    mask:
        conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--dent) * 2) var(--dent) repeat-x,
        linear-gradient(#000 0 0) top / 100% calc(100% - var(--dent)) no-repeat;
}

.ticket :focus-visible { outline-color: var(--bleu); }

.ticket-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 10px;
    border-radius: 50%;
}

.ticket-enseigne {
    font-family: 'Rubik', 'Arial Black', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.1;
}

.ticket-adresse,
.ticket-date {
    font-size: 0.8rem;
    color: var(--encre-douce);
}

.ticket-date {
    margin-top: 10px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(11, 26, 74, 0.35);
}

.ticket-lignes {
    margin: 12px 0;
    text-align: left;
}

/* Libellé, points de conduite, montant */
.ticket-lignes div {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.ticket-lignes div::after {
    content: '';
    order: 1;
    flex: 1;
    border-bottom: 1px dotted rgba(11, 26, 74, 0.45);
}

.ticket-lignes dd {
    order: 2;
    font-weight: 600;
}

.ticket-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 2px solid var(--encre);
    border-bottom: 2px solid var(--encre);
    font-weight: 600;
    text-transform: uppercase;
    text-align: right;
}

.disclaimer {
    margin-top: 16px;
    font-size: 0.78rem;
    line-height: 1.6;
    text-align: left;
    color: #333C58;
}

.ticket-merci {
    margin-top: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ticket-code {
    height: 44px;
    margin: 14px auto 6px;
    max-width: 240px;
    background: repeating-linear-gradient(90deg,
        var(--encre) 0 3px, transparent 3px 5px,
        var(--encre) 5px 6px, transparent 6px 9px,
        var(--encre) 9px 13px, transparent 13px 14px,
        var(--encre) 14px 15px, transparent 15px 19px);
}

.copyright {
    font-size: 0.78rem;
}

/* ===== Mouvement réduit ===== */
@media (prefers-reduced-motion: reduce) {
    .etiquette, .bon-image img, .bon-cta { transition: none; }
    .bon:hover .bon-image img { transform: none; }
    .etiquette:hover { transform: rotate(var(--penche, 0deg)); }
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
    .etiquettes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tampon { top: 90px; width: 118px; height: 118px; }
    .tampon strong { font-size: 1.25rem; }
    .tampon span { font-size: 0.78rem; }
}

@media (max-width: 768px) {
    .carton { padding: 0 16px 140px; }
    .scotch { margin: 0 -16px; }
    .scotch span { font-size: 0.85rem; }
    .carton-inner { padding-top: 22px; }
    .marque img { width: 150px; height: 150px; }
    .chapo { font-size: 1.04rem; }
    .pictos { font-size: 0.72rem; }
    .tampon { display: none; }

    .tri { margin-top: -96px; padding: 22px 14px 22px; }
    .tri::before, .tri::after { top: -26px; height: 28px; }
    .tri-tete h2 { font-size: 1.55rem; }
    .etiquettes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }

    .deballage { padding: 44px 16px 72px; }
    .grille { gap: 20px; }

    .ticket { padding: 26px 20px 24px; }
}
