/* ==========================================================================
   Petit Canon — page Coffret naissance (coffret-naissance.css)
   Préfixe cof- ; repose sur base.css : jetons --pc-*, .pc-chip (filtres),
   .pc-sizes / .pc-size (suites de pointures), .pc-skeleton, .pc-empty, .pc-alert,
   .pc-accordion. Élément signature : le récapitulatif crème piqué d'une couture
   (data-pc-piqure), collant à droite sur grand écran.
   ========================================================================== */

.cof-main { padding-bottom: var(--pc-space-4); }

/* --------------------------------------------------------------------------
   En-tête et points clés
   -------------------------------------------------------------------------- */
.cof-hero { padding-block: var(--pc-space-2) var(--pc-space-5); }
.cof-hero__titre { margin-top: var(--pc-space-3); max-width: 20ch; }
.cof-hero__lead { margin-top: var(--pc-space-4); max-width: 46ch; }

.cof-points {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem 2rem;
  max-width: 60rem;
  margin-top: var(--pc-space-5);
  padding: 0;
  list-style: none;
}
.cof-points__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  font-size: var(--pc-fs-sm);
  line-height: 1.55;
  color: var(--pc-encre-douce);
}
.cof-points__item[hidden] { display: none; }
.cof-points__item .pc-icon {
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  margin-top: 0.05rem;
  color: var(--pc-terracotta-fonce);
}
@media (min-width: 48em) {
  .cof-hero { padding-block: var(--pc-space-3) var(--pc-space-6); }
  .cof-points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cof-inactif { padding-block: var(--pc-space-6); }
.cof-inactif .pc-empty__title { font-size: var(--pc-fs-xl); }

/* --------------------------------------------------------------------------
   Mise en page : étapes puis récapitulatif (mobile) ; récapitulatif collant (bureau)
   -------------------------------------------------------------------------- */
.cof-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--pc-space-7);
}
.cof-form {
  display: flex;
  flex-direction: column;
  gap: var(--pc-space-7);
  min-width: 0;
}
@media (min-width: 64em) {
  .cof-layout {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
    align-items: start;
    gap: var(--pc-space-8, 4rem);
  }
  .cof-aside {
    position: sticky;
    top: calc(var(--pc-header-h) + var(--pc-space-4));
  }
}

/* --------------------------------------------------------------------------
   Étapes (fieldset + légende portant le titre h2)
   -------------------------------------------------------------------------- */
.cof-etape { min-width: 0; margin: 0; padding: 0; border: 0; }
.cof-etape[hidden] { display: none; }
.cof-etape__legende {
  display: block;
  width: 100%;
  margin-bottom: var(--pc-space-4);
  padding: 0;
}
.cof-etape__titre {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--pc-fs-xl);
  line-height: 1.2;
}
/* Numéro d'étape dans une pastille piquée */
.cof-etape__num {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1.5px dashed var(--pc-couture);
  border-radius: 50%;
  background: var(--pc-creme);
  font-size: var(--pc-fs-base);
  font-weight: 600;
  color: var(--pc-encre);
}

/* Filtres en pastilles : passent à la ligne sur petit écran (aucun défilement horizontal) */
.cof-filtres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cof-filtres[hidden] { display: none; }

.cof-compte {
  margin-top: var(--pc-space-3);
  font-size: var(--pc-fs-sm);
  color: var(--pc-texte-doux);
}
.cof-compte:focus { outline: none; }

.cof-url-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: var(--pc-space-3);
  padding: 0.75rem 1rem;
  border-radius: var(--pc-radius-m);
  background: var(--pc-papier-fonce);
  font-size: var(--pc-fs-sm);
  color: var(--pc-encre-douce);
}
.cof-url-note[hidden] { display: none; }
.cof-url-note .pc-icon { flex: none; width: 1.125rem; height: 1.125rem; margin-top: 0.15rem; color: var(--pc-ardoise); }

.cof-erreur { margin-top: var(--pc-space-4); }
.cof-erreur[hidden] { display: none; }
.cof-erreur__corps { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; }

/* --------------------------------------------------------------------------
   Grille des modèles : vraies radios, carte entière cliquable
   -------------------------------------------------------------------------- */
.cof-modeles__grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.25rem, 1fr));
  gap: 0.75rem;
  margin-top: var(--pc-space-4);
}
.cof-modeles__grille[hidden] { display: none; }
@media (min-width: 48em) {
  .cof-modeles__grille { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 1rem; }
}

.cof-modele {
  position: relative;
  display: block;
  min-width: 0;
  color: var(--pc-encre);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cof-modele[hidden] { display: none; }
/* Radio réelle, invisible, posée sur toute la carte (clic, flèches, lecteurs d'écran) */
.cof-modele__input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}
.cof-modele__corps {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: var(--pc-tap);
  padding: 0.5rem 0.5rem 0.75rem;
  border: 1.5px solid var(--pc-trait);
  border-radius: var(--pc-radius-m);
  background: var(--pc-surface);
  transition: border-color var(--pc-dur-1) ease, background-color var(--pc-dur-1) ease, box-shadow var(--pc-dur-1) ease;
}
.cof-modele__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 1.12;
  border-radius: var(--pc-radius-s);
  background: var(--pc-papier-fonce);
}
.cof-modele__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cof-modele__img--vide { height: 100%; }
.cof-modele__nom {
  margin-top: 0.5rem;
  font-family: var(--pc-font-titre);
  font-variation-settings: var(--pc-soft);
  font-size: var(--pc-fs-base);
  font-weight: 560;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.cof-modele__meta {
  margin-top: 0.125rem;
  font-size: var(--pc-fs-xs);
  line-height: 1.3;
  color: var(--pc-texte-doux);
}
/* Coche du modèle choisi */
.cof-modele__coche {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  display: none;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--pc-encre);
  color: var(--pc-creme);
}
.cof-modele__coche .pc-icon { width: 1rem; height: 1rem; }

.cof-modele:hover .cof-modele__corps { border-color: var(--pc-encre); }
.cof-modele__input:checked + .cof-modele__corps {
  border-color: var(--pc-encre);
  background: var(--pc-creme);
  box-shadow: inset 0 0 0 1px var(--pc-encre);
}
.cof-modele__input:checked + .cof-modele__corps .cof-modele__coche { display: grid; }
/* Focus visible sur la carte (la radio elle-même est transparente) */
.cof-modele__input:focus-visible + .cof-modele__corps {
  outline: 3px solid var(--pc-focus);
  outline-offset: 2px;
}

/* Squelettes de chargement (mêmes proportions que les cartes) */
.cof-squelette {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.5rem 0.75rem;
  border: 1.5px solid var(--pc-trait);
  border-radius: var(--pc-radius-m);
}
.cof-squelette__img { aspect-ratio: 1.12; }
.cof-squelette__nom { width: 70%; margin-top: 0.625rem; }
.cof-squelette__meta { width: 45%; }

.cof-vide { padding-block: var(--pc-space-5); }
.cof-vide[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Étape 2 : suites de pointures (pastilles du socle, plus larges)
   -------------------------------------------------------------------------- */
.cof-suites__liste { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); }
.cof-suite .pc-size__box { min-height: 4.5rem; padding-inline: 0.75rem; }
.cof-suite__num { white-space: normal; line-height: 1.35; }
.cof-suite__p { white-space: nowrap; }
.cof-suite__sep { color: var(--pc-texte-doux); }
.cof-suite .pc-size__input:checked + .pc-size__box .cof-suite__sep { color: inherit; }
.cof-suites__aide { margin-top: 0.75rem; }
.cof-suites__aide a {
  display: inline-block;
  padding-block: 0.6rem; /* cible tactile ≥ 44 px en ligne */
  margin-block: -0.6rem;
}

/* --------------------------------------------------------------------------
   Récapitulatif cousu
   -------------------------------------------------------------------------- */
.cof-aside[hidden] { display: none; }
.cof-recap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  padding: 1.5rem 1.375rem;
  border-radius: var(--pc-radius-l);
  background: var(--pc-creme);
  box-shadow: var(--pc-ombre-1);
}
/* Couture de repli (masquée quand lib/couture.js a cousu le cadre) */
.cof-recap::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1.5px dashed var(--pc-couture);
  border-radius: calc(var(--pc-radius-l) - 7px);
  pointer-events: none;
}
.cof-recap.is-cousu::before { display: none; }
.cof-recap > :not(.pc-piqure-cadre) { position: relative; min-width: 0; }
.cof-recap > [hidden] { display: none; }

.cof-recap__titre { font-size: var(--pc-fs-lg); }
.cof-recap__vide { font-size: var(--pc-fs-sm); color: var(--pc-texte-doux); }

.cof-recap__modele {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
}
.cof-recap__media {
  flex: none;
  width: 4.5rem;
  overflow: hidden;
  aspect-ratio: 1.12;
  border-radius: var(--pc-radius-s);
  background: var(--pc-papier-fonce);
}
.cof-recap__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cof-recap__ident { display: flex; flex-direction: column; min-width: 0; }
.cof-recap__nom {
  font-family: var(--pc-font-titre);
  font-variation-settings: var(--pc-soft);
  font-size: var(--pc-fs-lg);
  font-weight: 560;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.cof-recap__meta { font-size: var(--pc-fs-xs); color: var(--pc-texte-doux); }

.cof-recap__lignes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--pc-trait);
  font-size: var(--pc-fs-sm);
}
.cof-recap__ligne {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.125rem 1rem;
}
.cof-recap__ligne[hidden] { display: none; }
.cof-recap__ligne dt { color: var(--pc-encre-douce); }
.cof-recap__ligne dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.cof-recap__ligne dd.is-a-choisir { font-weight: 400; color: var(--pc-texte-doux); }
.cof-recap__montant { font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.cof-recap__ligne--remise dd { color: var(--pc-terracotta-fonce); }
.cof-recap__ligne--total {
  align-items: baseline;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--pc-trait);
}
.cof-recap__ligne--total dt { font-weight: 650; color: var(--pc-encre); }
.cof-recap__ligne--total dd {
  font-family: var(--pc-font-titre);
  font-variation-settings: var(--pc-soft);
  font-size: var(--pc-fs-xl);
  font-weight: 560;
  color: var(--pc-encre);
}

.cof-recap__deja {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--pc-radius-s);
  background: var(--pc-menthe-pale);
  font-size: var(--pc-fs-sm);
  color: var(--pc-encre);
}
.cof-recap__deja .pc-icon { flex: none; width: 1.125rem; height: 1.125rem; margin-top: 0.1rem; color: var(--pc-vert); }

.cof-recap__aide { margin-top: -0.375rem; font-size: var(--pc-fs-sm); color: var(--pc-texte-doux); }
.cof-recap__fiche { font-size: var(--pc-fs-sm); overflow-wrap: anywhere; }
.cof-recap__fiche a {
  display: inline-block;
  padding-block: 0.6rem; /* cible tactile ≥ 44 px en ligne */
  margin-block: -0.6rem;
}

/* --------------------------------------------------------------------------
   Questions fréquentes
   -------------------------------------------------------------------------- */
.cof-faq[hidden] { display: none; }
.cof-faq__inner { max-width: calc(48rem + 2 * var(--pc-gutter)); }
.cof-faq__liste { margin-top: var(--pc-space-5); }
.cof-faq .pc-accordion__item[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Mouvement réduit : aucune transition
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .cof-modele__corps,
  .cof-suite .pc-size__box { transition: none; }
}
