/* CODES PROMO placements drawn by assets/js/codes-promo.js only when a live code exists:
   button on fiches / brand review pages, badge on product cards, promo card of the fiche gallery, top banner. */

/* Button « Codes promo {Marque} » (after the H1) */
.cp-bouton, .cp-ban, .cp-pastille { font-family: var(--sans, system-ui, sans-serif); }
/* mobile-0711b: 4 px Éditorial corners like the review-page buttons (design-boutons.css), not the 999 px control token */
.cp-bouton { display: inline-flex; align-items: stretch; margin: .5rem 0 .4rem; border-radius: 4px; border: 1px solid var(--moutarde); background: var(--blanc); color: var(--anthracite); text-decoration: none; font-size: var(--t-sm, .9rem); font-weight: 600; overflow: hidden; transition: background .15s; }
.cp-bouton:hover { background: var(--moutarde-voile); }
.cp-bouton__pct { display: flex; align-items: center; padding: .32rem .7rem; background: var(--moutarde); color: var(--anthracite); font-weight: 700; white-space: nowrap; }
.cp-bouton__txt { display: flex; align-items: center; padding: .32rem .85rem; }
.cp-bouton:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }

/* Badge « -X % avec code » on product cards */
.carte .carte__photo { position: relative; }
.cp-pastille { position: absolute; z-index: 2; left: .6rem; bottom: .6rem; padding: .22rem .6rem; border-radius: var(--r-ctl, 999px); background: var(--moutarde); color: var(--anthracite); font-size: var(--t-xs, .76rem); font-weight: 700; line-height: 1.3; letter-spacing: .01em; box-shadow: 0 1px 4px rgba(0,0,0,.12); pointer-events: none; white-space: nowrap; }

/* Promo card « A · moutarde » (Romain 05/11): takes the place of the 1st vertical scene of the fiche head (same box,
   the photo stays in the strip and the zoom), or a thumbnail of the strip that opens it over the main photo (mobile,
   tablet, fiches without scenes). Text sized on the card (container units), never the card on the text. */
.qcpa { position: absolute; inset: 0; z-index: 2; display: block; container: qcpa / size; border-radius: inherit; overflow: hidden; background: var(--moutarde, #d6a62b); color: var(--anthracite, #25272b); text-decoration: none; font-family: var(--sans, "Familjen Grotesk", system-ui, sans-serif); -webkit-tap-highlight-color: transparent; }
.qcpa:hover, .qcpa:focus-visible { color: var(--anthracite, #25272b); text-decoration: none; }
.qcpa:focus-visible { outline: 2px solid var(--anthracite, #25272b); outline-offset: -4px; }
/* Sizes (05/11 fix): container units with a readable floor (11 px small lines, 12 px button, 28 px figure), so a low or
   wide box (Vimle: 184 x 142) never shrinks the text below reading size; ajuster() drops lines instead. */
.qcpa__in { box-sizing: border-box; height: 100%; display: flex; flex-direction: column; padding: max(9px, 7cqmin) max(10px, 7.5cqw) max(9px, 6.5cqmin); }
.qcpa__marque { flex: none; font-size: max(11px, 5.4cqw); line-height: 1.2; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qcpa__titre { flex: none; margin-top: max(3px, 3.5cqmin); font-family: var(--serif, "Source Serif 4", Georgia, serif); font-weight: 600; font-size: max(15px, min(13.5cqw, 16cqh)); line-height: .95; letter-spacing: -.01em; }
.qcpa__l1 { display: block; }
.qcpa__titre em { font-weight: 400; }
.qcpa__big { flex: none; margin: auto 0 max(3px, 2cqmin); padding-top: max(3px, 2cqmin); font-family: var(--serif, "Source Serif 4", Georgia, serif); font-weight: 400; font-size: max(30px, min(29cqw, 34cqh)); line-height: .9; letter-spacing: -.02em; white-space: nowrap; }
.qcpa__big--txt { font-size: max(16px, min(11cqw, 14cqh)); line-height: 1; white-space: normal; letter-spacing: 0; }
.qcpa__big small { margin-top: max(2px, 1.5cqmin); font-family: var(--sans, "Familjen Grotesk", system-ui, sans-serif); font-size: max(11px, 6cqw); line-height: 1.2; font-weight: 600; letter-spacing: 0; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qcpa__code { flex: none; margin-bottom: max(3px, 2cqmin); font-size: max(11px, 5.6cqw); line-height: 1.25; font-weight: 600; }
.qcpa__code b { font-weight: 700; letter-spacing: .06em; padding: 0 .3em; border: 1px dashed currentColor; border-radius: 3px; }
.qcpa__cond { flex: none; margin-bottom: max(6px, 4cqmin); font-size: max(11px, 5.2cqw); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qcpa__go { flex: none; display: flex; align-items: stretch; background: var(--anthracite, #25272b); color: #fff; border-radius: 4px; overflow: hidden; font-size: max(12px, 6.4cqw); line-height: 1.1; font-weight: 600; }
.qcpa__go > span { flex: 1; padding: max(6px, 4.2cqmin) max(8px, 5.4cqw); white-space: nowrap; }
.qcpa__go > i { flex: none; width: max(26px, 17cqw); display: grid; place-items: center; font-style: normal; background: #fff; color: var(--anthracite, #25272b); transition: transform .2s ease; }
.qcpa:hover .qcpa__go > i { transform: translateX(2px); }
.qcpa:hover .qcpa__in { background: rgba(255,255,255,.06); }
/* Short box: the script (ajuster) drops optional lines one by one until everything fits, nothing is ever cut:
   title on one line (c1), scope (c2), conditions (c3), tighter spacing (c5), shorter merchant lead (c8, c9), end date
   (c10, it stays in the top banner), then a smaller figure (c4, c6, never under 28 px), brand (c7), offer name (c11). */
.qcpa--c1 .qcpa__l1 { display: inline; }
.qcpa--c1 .qcpa__titre { font-size: max(15px, min(11cqw, 14cqh)); }
.qcpa--c2:not(.qcpa--hors) .qcpa__portee, .qcpa--c3 .qcpa__cond-c, .qcpa--c10 .qcpa__cond { display: none; }
.qcpa--c4 .qcpa__big:not(.qcpa__big--txt) { font-size: max(28px, min(23cqw, 28cqh)); }
.qcpa--c5 .qcpa__in { padding-top: max(8px, 5cqmin); padding-bottom: max(8px, 5cqmin); }
.qcpa--c5 .qcpa__titre { margin-top: max(2px, 2cqmin); }
.qcpa--c5 .qcpa__cond { margin-bottom: max(5px, 3cqmin); }
.qcpa--c5 .qcpa__go > span { padding-top: max(5px, 3cqmin); padding-bottom: max(5px, 3cqmin); }
.qcpa--c6 .qcpa__big { padding-top: 0; }
.qcpa--c6 .qcpa__big:not(.qcpa__big--txt) { font-size: max(28px, min(19cqw, 23cqh)); }
.qcpa--c7 .qcpa__marque { display: none; }
.qcpa--c7 .qcpa__titre, .qcpa--c11 .qcpa__big { margin-top: 0; }
.qcpa--c11 .qcpa__titre { display: none; }
/* Non-affiliated fiche (05/11): « Le bon plan du moment chez {merchant} » on two lines, never cut; c8 / c9 shorten the lead. */
.qcpa__chez { white-space: normal; text-transform: none; letter-spacing: .01em; font-weight: 500; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.qcpa__chez b { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.qcpa--na .qcpa__cond { -webkit-line-clamp: 3; }
.qcpa--c8 .qcpa__chez-le, .qcpa--c8 .qcpa__chez-l { display: none; }
.qcpa--c8 .qcpa__chez-bp { text-transform: capitalize; }
.qcpa--c9 .qcpa__chez-bp { display: none; }
.qcpa--c9 .qcpa__chez-c { text-transform: capitalize; }
/* Large wide box (main photo of the mobile / tablet gallery): two columns, sized on the height. A small wide box
   (a desktop scene such as Vimle, 184 x 142) keeps the single column above: two columns there gave 7 px text. */
@container qcpa (min-aspect-ratio: 5 / 4) and (min-width: 300px) {
  .qcpa__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr auto auto; column-gap: 6cqh; padding: max(10px, 7cqh) max(10px, 7cqh) max(10px, 6.5cqh); grid-template-areas: "m m" "t b" "x x" "c c" "g g"; }
  .qcpa__marque { grid-area: m; font-size: max(11px, 4.6cqh); }
  .qcpa__chez { font-size: max(11px, 5cqh); }
  .qcpa__titre { grid-area: t; align-self: start; margin-top: 4cqh; font-size: max(16px, 12cqh); }
  .qcpa--c1 .qcpa__titre { font-size: max(16px, 10cqh); }
  .qcpa--c4 .qcpa__big:not(.qcpa__big--txt), .qcpa--c6 .qcpa__big:not(.qcpa__big--txt) { font-size: max(30px, 20cqh); }
  .qcpa__big { grid-area: b; align-self: start; margin: 3cqh 0 0; padding: 0; font-size: max(32px, 25cqh); }
  .qcpa__big--txt { font-size: max(16px, 9cqh); }
  .qcpa__big small { font-size: max(11px, 5cqh); margin-top: 2cqh; }
  .qcpa__code { grid-area: x; align-self: end; margin: 0 0 1.5cqh; font-size: max(11px, 5cqh); }
  .qcpa__cond { grid-area: c; margin: 0 0 4cqh; font-size: max(11px, 4.8cqh); }
  .qcpa__go { grid-area: g; font-size: max(12px, 5.6cqh); }
  .qcpa__go > span { padding: max(6px, 3.6cqh) max(8px, 4cqh); }
  .qcpa__go > i { width: max(26px, 13cqh); }
}
/* Desktop: inside the 1st scene, whose photo keeps the box (hidden, never removed, so the size cannot move). */
.fiche .ft-scene.qcpa-hote > img { visibility: hidden; }
/* Strip thumbnail (size copied from its neighbour by the script) and the card over the main photo. */
.qcpa-vig { position: relative; flex: none; width: 84px; aspect-ratio: 4 / 3; padding: 0; border: 1px solid var(--moutarde, #d6a62b); border-radius: 8px; background: var(--moutarde, #d6a62b); color: var(--anthracite, #25272b); cursor: pointer; overflow: hidden; container-type: size; font-family: var(--sans, "Familjen Grotesk", system-ui, sans-serif); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3cqh; line-height: 1; }
.qcpa-vig__v { font-family: var(--serif, "Source Serif 4", Georgia, serif); font-size: 36cqh; letter-spacing: -.02em; white-space: nowrap; }
.qcpa-vig__v--txt { font-size: 20cqh; }
.qcpa-vig__e { font-size: 13cqh; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.qcpa-vig.est-actif { border-color: var(--anthracite, #25272b); box-shadow: 0 0 0 1px var(--anthracite, #25272b); }
.galerie__principale.qcpa-ouvert { position: relative; }
.galerie__principale > .qcpa { z-index: 6; }

/* Top banner (closable, hidden 3 days for this code) */
.cp-ban { background: var(--anthracite); color: var(--blanc); font-size: var(--t-sm, .9rem); }
.cp-ban__in { max-width: var(--col, 72rem); margin: 0 auto; padding: .5rem var(--gutter, 1rem); display: flex; align-items: center; gap: .5rem .9rem; }
.cp-ban__pct { flex: none; padding: .15rem .55rem; border-radius: var(--r-ctl, 999px); background: var(--moutarde); color: var(--anthracite); font-weight: 700; white-space: nowrap; }
.cp-ban__txt { flex: 1; min-width: 0; }
.cp-ban__txt strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; color: var(--moutarde); }
.cp-ban__cta { flex: none; color: var(--blanc); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.cp-ban__cta:hover { color: var(--moutarde); }
.cp-ban__fermer { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: transparent; color: var(--blanc); cursor: pointer; }
.cp-ban__fermer:hover { background: rgba(255,255,255,.12); }
@media (max-width: 640px) {
  .cp-ban__in { flex-wrap: wrap; padding-block: .45rem; font-size: var(--t-xs, .8rem); position: relative; padding-right: 2.6rem; }
  .cp-ban__fermer { position: absolute; top: .3rem; right: .4rem; }
}

/* Fiche head (design-fiche-t1): desktop grid with named areas, mobile flex column with order */
@media (min-width: 901px) {
  .fiche.ft .fiche__tete .achat > .cp-bouton { grid-area: kick; justify-self: end; align-self: end; margin: 0; }
}
@media (max-width: 900px) {
  .fiche.ft .achat > .cp-bouton { order: 2; align-self: flex-start; }
  .cp-ban__txt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
