/* affiliate/static/affiliate/css/shop.css
   Boutique éditoriale (ShopPage). Feuille chargée par le block `css` du gabarit
   affiliate/shop_page.html : aucune feuille globale (theme.css, guides.css,
   blog-home.css, recipe-discovery.css) n'est modifiée. Les couleurs, rayons et
   ombres viennent des tokens de theme.css ; aucune valeur neuve. */

/* Carte de page : la boutique garde .rc-page-card de theme.css. Seules les
   respirations internes sont posées ici. */
.template-shop-page .rc-page-card {
  padding: 1.75rem 1.5rem 2.5rem;
}

@media (min-width: 768px) {
  .template-shop-page .rc-page-card {
    padding: 2.25rem 2.5rem 3rem;
  }
}

/* ---------- En-tête ---------- */

.rc-shop__header {
  margin-bottom: 1.25rem;
}

.rc-shop__title {
  margin-bottom: .5rem;
  color: var(--rc-ink);
}

.rc-shop__lead {
  font-size: 1.0625rem;
  color: var(--rc-color-muted);
  margin: 0 0 1.25rem;
}

.rc-shop__intro {
  margin-bottom: 1.25rem;
}

.rc-shop__intro h2,
.rc-shop__intro h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
}

/* ---------- Légende des statuts éditoriaux ---------- */

.rc-shop__legend {
  background: var(--rc-surface);
  border: 1px solid var(--rc-line);
  border-left: .25rem solid var(--rc-brand-line);
  border-radius: var(--rc-radius-card);
  padding: .85rem 1rem;
  margin: 0 0 1.75rem;
  font-size: .9375rem;
  color: var(--rc-color-text);
}

.rc-shop__legend p:last-child {
  margin-bottom: 0;
}

/* ---------- Liste des produits ---------- */

/* Une colonne sur mobile ; deux colonnes dès 768 px. L'ordre est celui du
   StreamField products, aucun tri n'est fait ici. */
.rc-shop__list {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
  .rc-shop__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

.rc-shop__item {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  border: 1px solid var(--rc-line);
  border-radius: var(--rc-radius-card);
  background: #ffffff;
  box-shadow: var(--rc-shadow-card);
  padding: 1.15rem 1.15rem 1.25rem;
}

.rc-shop__item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem .75rem;
}

.rc-shop__name {
  flex: 1 1 8rem;
  font-size: 1.125rem;
  line-height: 1.3;
  margin: 0;
  color: var(--rc-ink);
}

/* ---------- Statut éditorial ---------- */

.rc-shop__badge {
  flex: 0 0 auto;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .01em;
  padding: .2rem .55rem;
  border-radius: var(--rc-radius-btn);
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Utilisé réellement : pastille bleue de la charte (texte #064a8a sur #e8f1fb). */
.rc-shop__badge--personnel {
  background: var(--rc-brand-tint);
  color: var(--rc-brand-dark);
  border-color: var(--rc-brand-line);
}

/* Simple sélection utile : neutre, volontairement moins promoteur. */
.rc-shop__badge--selection {
  background: var(--rc-surface-deep);
  color: var(--rc-ink);
  border-color: var(--rc-line);
}

/* ---------- Corps de la fiche produit ---------- */

.rc-shop__category {
  font-size: .8125rem;
  color: var(--rc-color-muted);
  margin: 0;
}

.rc-shop__note {
  font-size: .9375rem;
  line-height: 1.55;
  color: var(--rc-color-text);
  margin: 0;
}

/* ---------- Sections de la sélection (RC-C087, 22/11/2026) ---------- */

/* Trois sections au plus, dans l'ordre de `affiliate/promotions.py` : robots, équipements,
   puis « Bonnes affaires » (calculée, rendue seulement si des promotions remplissent la
   règle). Les titres sont des h2 de page, les items des h3 : la hiérarchie de titres suit
   la hiérarchie visuelle, et le nom du produit reste stylé par `.rc-shop__name`. */
.rc-shop__section {
  margin: 0 0 2rem;
}

.rc-shop__section-title {
  font-size: 1.375rem;
  line-height: 1.25;
  color: var(--rc-ink);
  margin: 0 0 .35rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--rc-line);
}

.rc-shop__section-note {
  font-size: .875rem;
  line-height: 1.5;
  color: var(--rc-color-muted);
  margin: 0 0 1rem;
}

@media (min-width: 768px) {
  .rc-shop__section-note {
    max-width: 72ch;
  }
}

/* Le volet « Comment sont calculées les remises ? » (RC-C087, 22/11/2026) : le détail de la règle
   quitte l'introduction de la section « Bonnes affaires », qui ne garde qu'une phrase courte.
   `<details>` / `<summary>` natifs : atteignables au clavier, annoncés par les lecteurs d'écran,
   fermés par défaut, et le texte reste dans le DOM (les robots et la lecture d'écran y accèdent).
   Mêmes encres et corps que la note de section, aucune couleur importée. */
.rc-shop__details {
  font-size: .875rem;
  line-height: 1.5;
  color: var(--rc-color-muted);
  margin: -0.4rem 0 1rem; /* remonte sous la phrase courte ; l'air vient du volet lui-même */
}

.rc-shop__details > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* cible tactile comme les autres appels du site, mobile compris */
  padding: 0 0.2rem;
  color: var(--rc-brand);
  font-weight: 600;
  cursor: pointer;
  list-style: none; /* la puce native est remplacée par le chevron ci-dessous */
}

.rc-shop__details > summary::-webkit-details-marker {
  display: none; /* Safari : même règle que `list-style: none` */
}

.rc-shop__details > summary::before {
  content: "\25B8"; /* ▸ chevron, pivoté quand le volet est ouvert */
  margin-right: 0.4rem;
}

.rc-shop__details[open] > summary::before {
  transform: rotate(90deg);
}

.rc-shop__details > summary:focus-visible {
  outline: 3px solid var(--rc-brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.rc-shop__details-body {
  max-width: 62ch;
  margin: 0.15rem 0 0;
}

@media (min-width: 768px) {
  .rc-shop__details-body {
    max-width: 72ch;
  }
}

/* La section calculée est signalée par la couleur de la charte, aucune couleur neuve. */
.rc-shop__section--promos .rc-shop__section-title {
  color: var(--rc-brand-dark);
  border-bottom-color: var(--rc-brand-line);
}

/* ---------- Ligne « Bonnes affaires » d'un item ---------- */

/* Le prix de référence est celui **déclaré par le marchand** : la ligne le nomme comme
   tel. Aucun suivi de prix, aucune promesse de durée. En dessous de 768 px, les trois
   morceaux s'empilent par retournement (`flex-wrap`), sans largeur imposée. */
.rc-shop__promo {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .75rem;
  margin: 0;
  padding: .5rem .65rem;
  background: var(--rc-surface);
  border: 1px solid var(--rc-line);
  border-left: .25rem solid var(--rc-brand-line);
  border-radius: var(--rc-radius-card);
  font-size: .875rem;
  line-height: 1.45;
  color: var(--rc-color-text);
}

.rc-shop__promo-remise {
  font-weight: 700;
  color: var(--rc-brand-dark);
  white-space: nowrap;
}

.rc-shop__promo-prix {
  flex: 1 1 10rem;
  min-width: 0;
}

.rc-shop__promo-recoup {
  flex: 1 1 100%;
  min-width: 0;
  font-size: .8125rem;
  color: var(--rc-color-muted);
}

@media (min-width: 768px) {
  .rc-shop__promo-recoup {
    flex: 0 1 auto;
  }
}

/* ---------- Appel au marchand ---------- */

/* Le lien est en bas de carte, aligné en tête de zone tactile (44 px). */
.rc-shop__cta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  align-self: flex-start;
  margin-top: .35rem;
  min-height: 2.5rem;
  padding: .5rem .9rem;
  border-radius: var(--rc-radius-btn);
  background: var(--rc-brand);
  color: #ffffff;
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
}

.rc-shop__cta:hover,
.rc-shop__cta:focus-visible {
  background: var(--rc-brand-dark);
  color: #ffffff;
  text-decoration: none;
}

.rc-shop__cta:focus-visible {
  outline: .2rem solid var(--rc-brand-dark);
  outline-offset: .15rem;
}

.rc-shop__cta-label {
  line-height: 1.35;
  text-align: left;
}

.rc-shop__cta-arrow {
  font-size: .8125rem;
}

/* ---------- États et pied de page ---------- */

.rc-shop__empty {
  border: 1px dashed var(--rc-line);
  border-radius: var(--rc-radius-card);
  background: var(--rc-surface);
  color: var(--rc-color-muted);
  padding: 1rem 1.15rem;
  margin: 0 0 1.75rem;
}

.rc-shop__disclosure {
  font-size: .8125rem;
  color: var(--rc-color-muted);
  border-top: 1px solid var(--rc-line);
  padding-top: .85rem;
  margin: 0;
}
