/* Risen COD 2.3 — noir / blanc / gris ; le vert ne sert qu'au CTA d'achat et de confirmation.
   Échelle : 4 · 8 · 12 · 16 · 20 · 24 · 32. Compact, lisible, peu de décor. */
:root { --risen-cta: #1a7f43; --risen-cta-h: #146835; --cod-err: #b00020; --cod-mute: #666; --cod-line: #dfdfdf; --cod-soft: #f6f6f6; }

/* ---------- Offres : [radio] NOM [badge] ........ PRIX  /  pastille d'avantage ........ ancien prix ---------- */
.risen-cod__offers { border: 0; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.risen-cod__offers legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.risen-cod__offer { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; column-gap: 14px; padding: 14px 16px; min-height: 72px; cursor: pointer; border: 1px solid var(--cod-line); border-radius: 12px; background: var(--paper, #fff); transition: border-color .15s, background-color .15s, box-shadow .15s; }
.risen-cod__offer:hover { border-color: #b5b5b5; }
.risen-cod__offer:has(input:checked) { border-color: var(--ink, #121212); box-shadow: inset 0 0 0 1px var(--ink, #121212); background: var(--cod-soft); }
.risen-cod__offer:has(input:focus-visible) { outline: 2px solid var(--ink, #121212); outline-offset: 2px; }
.risen-cod__offer-body { display: grid; justify-items: start; gap: 6px; min-width: 0; }
.risen-cod__offer-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.risen-cod__offer-title strong { font-size: 15px; font-weight: 700; line-height: 1.25; text-transform: uppercase; letter-spacing: .03em; }
.risen-cod__offer-body em { font-style: normal; font-size: 12px; font-weight: 600; line-height: 1.3; padding: 4px 10px; border-radius: 999px; background: #ececec; color: var(--ink, #121212); }
.risen-cod__offer-body small { font-size: 12px; line-height: 1.3; font-weight: 600; color: var(--cod-mute); }
.risen-cod__offer-side { display: flex; align-items: center; text-align: right; }
.risen-cod__offer-price { display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 2px; font-size: 20px; font-weight: 700; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.risen-cod__offer-price:empty { display: none; }
.risen-cod__offer-price s { font-weight: 500; font-size: 13px; color: var(--ink-40, #8f8f8f); }
.risen-cod__badge { font-size: 10px; font-weight: 600; line-height: 1; text-transform: uppercase; letter-spacing: .08em; padding: 5px 8px; border-radius: 999px; background: var(--ink, #121212); color: var(--paper, #fff); white-space: nowrap; }
.risen-cod__offer input[type="radio"] { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin: 0; border: 2px solid #c4c4c4; border-radius: 50%; background: var(--paper, #fff); transition: border-color .15s, background-color .15s; }
.risen-cod__offer input[type="radio"]:checked { border-color: var(--ink, #121212); background: radial-gradient(circle, #fff 0 4px, var(--ink, #121212) 4.5px); }

/* ---------- Boutons d'achat : seul endroit en vert ---------- */
.risen-cod__open, .risen-cod__submit { width: 100%; min-height: 60px; cursor: pointer; font: inherit; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--risen-cta); color: #fff; border: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; transition: background-color .15s; }
.risen-cod__open::before { content: ""; width: 18px; height: 18px; margin-right: 6px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.risen-cod__open:hover, .risen-cod__submit:hover { background: var(--risen-cta-h); }
.risen-cod__open:active, .risen-cod__submit:active { background: #0f5a2d; }
.risen-cod__open-total { font-weight: 600; }
.risen-cod__open:focus-visible, .risen-cod__submit:focus-visible { outline: 2px solid var(--ink, #121212); outline-offset: 2px; }
.risen-cod__submit[disabled], .risen-cod__submit[aria-busy="true"] { opacity: .75; cursor: wait; }
.risen-cod__submit[aria-busy="true"]::before { content: ""; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: risen-cod-spin .7s linear infinite; }
@keyframes risen-cod-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .risen-cod__submit[aria-busy="true"]::before { animation-duration: 2s; } }
.risen-cod__open { margin: 0; }
.risen-cod__hint { margin: 10px 0 0; font-size: 13px; color: var(--cod-err); }
[data-invalid="true"] { outline: 2px solid var(--cod-err); outline-offset: 4px; }

/* ---------- Quantité (seulement quand elle est modifiable) : un seul contrôle compact ---------- */
.risen-cod__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.risen-cod__row--pdp { margin: 0 0 12px; }
.risen-cod__qtylabel { font-size: 13px; font-weight: 500; color: var(--cod-mute); }
.risen-cod__qty { display: inline-flex; align-items: center; height: 40px; border: 1px solid var(--cod-line); border-radius: 10px; background: var(--paper, #fff); }
.risen-cod__qty button { width: 40px; height: 38px; border: 0; background: none; font-size: 18px; font-weight: 300; line-height: 1; cursor: pointer; color: var(--ink, #121212); padding: 0; border-radius: 10px; }
.risen-cod__qty button:hover { background: rgba(0, 0, 0, .05); }
.risen-cod__qty button:focus-visible, .risen-cod__qty input:focus-visible { outline: 2px solid var(--ink, #121212); outline-offset: -2px; }
.risen-cod__qty input { width: 32px; height: 38px; text-align: center; border: 0; font: inherit; font-size: 15px; font-weight: 600; -moz-appearance: textfield; border-radius: 0; padding: 0; background: none; color: inherit; font-variant-numeric: tabular-nums; }
.risen-cod__qty input::-webkit-outer-spin-button, .risen-cod__qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Commande : produit en tête, champs, totaux, confirmation ---------- */
.risen-cod { position: relative; display: flex; flex-direction: column; margin: 0; }
.risen-cod__aside { display: contents; }
.risen-cod__head { order: 0; }
.risen-cod__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* titre conservé pour les lecteurs d'écran */
.risen-cod__close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #f1f1f1; font-size: 0; cursor: pointer; color: var(--ink, #121212); padding: 0; transition: background-color .15s; }
.risen-cod__close::before, .risen-cod__close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 1.6px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.risen-cod__close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.risen-cod__close:hover { background: #e6e6e6; }
.risen-cod__close:focus-visible { outline: 2px solid var(--ink, #121212); outline-offset: 2px; }

/* Produit : image WooCommerce, nom, variante / offre, prix */
.risen-cod__order { order: 1; position: relative; padding: 14px 20px 0; }
.risen-cod__sum { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; padding-right: 48px; }
.risen-cod__img { width: 64px; height: 80px; object-fit: cover; background: #efefef; border-radius: 10px; display: block; }
.risen-cod__info { display: grid; gap: 2px; min-width: 0; }
.risen-cod__name { font-size: 16px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.risen-cod__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; font-size: 13px; line-height: 1.4; color: var(--cod-mute); }
.risen-cod__lines .is-offer { color: var(--ink, #121212); font-weight: 600; }
.risen-cod__lines .is-offer ~ .is-qty { display: none; } /* l'offre dit déjà la quantité */
.risen-cod__unit { margin-top: 2px; font-size: 20px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.risen-cod__order > .risen-cod__row { position: absolute; right: 20px; bottom: 0; }
.risen-cod__order > .risen-cod__row .risen-cod__qtylabel { display: none; }
.risen-cod__order .risen-cod__qty { height: 36px; }
.risen-cod__order .risen-cod__qty button { width: 36px; height: 34px; }
.risen-cod__order .risen-cod__qty input { height: 34px; width: 30px; }

/* Champs : libellés nets, champs hauts, rayon 12 */
.risen-cod__fields { order: 2; padding: 18px 20px 0; }
.risen-cod__field { margin-bottom: 14px; }
.risen-cod__fields .risen-cod__field:last-child { margin-bottom: 0; }
.risen-cod__field label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; color: var(--ink, #121212); }
.risen-cod__field label span { color: var(--cod-err); }
.risen-cod__field input {
  display: block; width: 100%; height: 56px; padding: 0 16px; font: inherit; font-size: 16px; /* 16px : pas de zoom iOS */
  color: var(--ink, #121212); background: var(--paper, #fff); border: 1px solid var(--cod-line); border-radius: 12px; box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.risen-cod__field input::placeholder { color: #9b9b9b; }
.risen-cod__field input:focus-visible { outline: 0; border-color: var(--ink, #121212); box-shadow: 0 0 0 3px rgba(18, 18, 18, .08); }
.risen-cod input[aria-invalid="true"] { border-color: var(--cod-err); box-shadow: 0 0 0 3px rgba(176, 0, 32, .08); }
.risen-cod__msg { margin: 6px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--cod-err); }
.risen-cod__msg[hidden], .risen-cod__error[hidden], .risen-cod__hint[hidden] { display: none; }

/* Totaux : bloc doux, Produit / Livraison, puis Total */
.risen-cod__recap { order: 3; margin: 16px 20px 0; padding: 12px 16px; display: grid; gap: 8px; background: var(--cod-soft); border-radius: 12px; }
.risen-cod__recap div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 14px; }
.risen-cod__recap dt, .risen-cod__recap dd { margin: 0; }
.risen-cod__recap dt { color: var(--cod-mute); }
.risen-cod__recap dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.risen-cod__recap dd.is-free { color: var(--risen-cta); font-weight: 700; }
.risen-cod__recap .risen-cod__grand { margin-top: 2px; padding-top: 12px; border-top: 1px solid #e2e2e2; }
.risen-cod__recap .risen-cod__grand dt { font-size: 17px; font-weight: 700; color: var(--ink, #121212); }
.risen-cod__recap .risen-cod__grand dd { font-size: 22px; font-weight: 700; }

/* Pied */
.risen-cod__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.risen-cod__error { margin: 0 0 10px; font-size: 13px; line-height: 1.4; color: var(--cod-err); }
.risen-cod__foot { order: 4; position: sticky; bottom: 0; z-index: 1; display: grid; justify-items: center; padding: 10px 20px calc(4px + env(safe-area-inset-bottom, 0px)); background: var(--paper, #fff); }
.risen-cod__foot > .risen-cod__submit, .risen-cod__foot > .risen-cod__error { justify-self: stretch; }
.risen-cod__submit { min-height: 58px; }
.risen-cod__trust { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 0; font-size: 12.5px; color: var(--cod-mute); }
.risen-cod__trust::before { content: ""; width: 14px; height: 14px; background: var(--risen-cta); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.risen-cod__edit { min-height: 36px; margin: 0; padding: 0 12px; border: 0; background: none; color: var(--cod-mute); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.risen-cod__edit:hover { color: var(--ink, #121212); text-decoration: underline; text-underline-offset: 4px; }
.risen-cod__edit:focus-visible { outline: 2px solid var(--ink, #121212); outline-offset: -2px; }

/* ---------- Fenêtre : feuille basse (mobile), carte centrée (tablette), deux colonnes compactes (ordinateur) ---------- */
.risen-cod__dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; max-height: 96vh; max-height: 96dvh; overflow: auto; padding: 0; border: 0; border-radius: 16px 16px 0 0; background: var(--paper, #fff); color: var(--ink, #121212); overscroll-behavior: contain; }
.risen-cod__dialog::backdrop { background: rgba(10, 10, 10, .55); }
body:has(.risen-cod__dialog[open]) { overflow: hidden; }

@media (min-width: 601px) {
  .risen-cod__dialog { width: min(520px, calc(100vw - 32px)); max-width: none; margin: auto; max-height: 94dvh; border-radius: 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, .22); }
  .risen-cod__order { padding: 24px 28px 0; }
  .risen-cod__order > .risen-cod__row { right: 28px; }
  .risen-cod__fields { padding: 20px 28px 0; }
  .risen-cod__recap { margin: 16px 28px 0; }
  .risen-cod__foot { padding: 14px 28px 12px; }
  .risen-cod__close { top: 16px; right: 16px; }
}

@media (min-width: 860px) { /* produit en bandeau, puis formulaire | totaux + confirmation, hauteur = contenu */
  .risen-cod__dialog { width: min(840px, calc(100vw - 64px)); }
  .risen-cod__submit { font-size: 13.5px; letter-spacing: .04em; white-space: nowrap; }
  .risen-cod { display: grid; grid-template-columns: minmax(0, 1fr) 340px; column-gap: 32px; row-gap: 20px; padding: 28px 32px; }
  .risen-cod__head { display: contents; }
  .risen-cod__order { grid-column: 1 / -1; grid-row: 1; padding: 0; }
  .risen-cod__order > .risen-cod__row { right: 0; }
  .risen-cod__sum { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; }
  .risen-cod__img { width: 72px; height: 90px; }
  .risen-cod__fields { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; align-content: start; padding: 0; }
  .risen-cod__fields > .risen-cod__field { grid-column: 1 / -1; }
  .risen-cod__fields > .risen-cod__field--half { grid-column: auto; }
  .risen-cod__aside { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; gap: 16px; }
  .risen-cod__recap { order: 0; margin: 0; }
  .risen-cod__foot { order: 0; position: static; padding: 0; background: none; }
  .risen-cod__close { top: 20px; right: 20px; }
}

/* ---------- Offres a plusieurs articles : couleur et taille des articles 2..N (meme esprit que les cartes d'offre) ---------- */
.risen-cod__items { display: grid; gap: 12px; margin: 0 0 12px; }
.risen-cod__items-note { margin: 0; font-size: 13px; line-height: 1.4; color: var(--cod-mute); }
.risen-cod__item { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--cod-line); border-radius: 12px; background: var(--paper, #fff); }
.risen-cod__item-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.risen-cod__item-head strong { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.risen-cod__item-head span { font-size: 13px; color: var(--cod-mute); min-width: 0; overflow-wrap: anywhere; }
.risen-cod__item-img { width: 48px; height: 60px; object-fit: cover; border-radius: 8px; background: #efefef; flex: none; }
.risen-cod__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.risen-cod__chips-label { width: 100%; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--cod-mute); }
.risen-cod__chip { min-width: 48px; min-height: 40px; padding: 0 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--cod-line); border-radius: 8px; background: var(--paper, #fff); color: var(--ink, #121212); }
.risen-cod__chip[aria-pressed="true"] { background: var(--ink, #121212); border-color: var(--ink, #121212); color: var(--paper, #fff); }
.risen-cod__chip:focus-visible { outline: 2px solid var(--ink, #121212); outline-offset: 2px; }

/* Avec une offre : le bloc de l'offre remplace les choix couleur / taille du haut de la fiche (les champs restent dans la page et pilotent la galerie). */
html.risen-cod-has-offers .risen-choices { display: none; }
.risen-cod__guide { display: flex; justify-content: flex-start; }
.risen-cod__chip.is-out, .risen-cod__chip:disabled { color: #9a9a9a; background: #f4f4f4; cursor: not-allowed; text-decoration: line-through; }
.risen-cod__chip.is-out { opacity: .75; }
.risen-cod__out { margin: 0; font-size: 13px; line-height: 1.4; color: var(--cod-err); }
