/*
  Robotibo (robotibo.site) — responsive.css (chargée en dernier)
  Partie 1 : SOCLE commun (templates/one-page). Partie 2 : réglages propres au site.
  Aucun élément ne dépasse l'écran, de 320 à 2560 px de large.
*/

/* Navigation repliée dans le menu */
@media (max-width: 1080px) {
  .barre__nav {
    display: none;
  }

  .barre__menu {
    display: grid;
  }
}

@media (max-width: 860px) {
  .pied__grille {
    grid-template-columns: minmax(0, 1fr);
  }

  .annexe dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .js .cine__texte {
    right: var(--gouttiere);
    bottom: 72px;
  }

  .js .cine__reperes {
    display: none;
  }

  .cine__voile {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.2) 45%, rgba(0, 0, 0, 0) 65%);
  }
}

@media (max-width: 560px) {
  .barre {
    padding: 8px 8px;
  }

  .barre__inner {
    gap: 6px;
    padding: 6px;
  }

  .marque {
    font-size: clamp(0.78rem, 3.6vw - 1px, 0.95rem);
  }

  .barre__actions .bouton--secondaire {
    display: none;
  }

  .barre__actions .bouton--principal {
    padding-left: 12px;
    font-size: 0.84rem;
  }
}

/* Très petits téléphones : l'icône seule dans la barre, boutons plus compacts */
@media (max-width: 359px) {
  .barre .marque__texte {
    display: none;
  }

  .bouton {
    gap: 7px;
    padding-inline: 16px;
    font-size: 0.9rem;
  }

  .bouton--principal {
    padding-right: 5px;
  }
}

/* ============================================================================================
   PARTIE 2 — RÉGLAGES DU SITE
   ============================================================================================ */

/* Le bouton de la barre : libellé complet sur ordinateur, court puis icônes seules sur téléphone */
.cta-court {
  display: none;
}

@media (max-width: 1180px) {
  .produits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 28px;
  }

  .reperes__liste {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .frise__etapes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 36px;
  }

  .qualite__points {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1024px) {
  .ouverture__grille,
  .cellule__grille,
  .etapes__grille,
  .qualite__grille,
  .questions__grille,
  .demonstration__grille,
  .formule {
    grid-template-columns: minmax(0, 1fr);
  }

  .ouverture__texte {
    position: static;
    padding-bottom: 0;
  }

  .assemblage {
    height: 190vh;
  }

  .nomenclature {
    display: none;
  }

  /* Le compteur des 48 étapes devient une bande collée sous la barre */
  .compteur {
    top: calc(var(--barre-hauteur) + 6px);
    z-index: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 16px;
    align-items: center;
    padding: 12px 16px;
  }

  .compteur__numero b {
    font-size: 2.6rem;
  }

  .compteur__phase {
    margin-top: 0;
    font-size: 1.2rem;
  }

  .compteur__jauge,
  .compteur__action {
    grid-column: 1 / -1;
  }

  .compteur__jauge {
    margin: 4px 0 2px;
  }

  .compteur__action {
    min-height: 0;
    font-size: 0.92rem;
  }
}

@media (max-width: 860px) {
  .produits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    perspective: none;
  }

  .produit__plaque {
    transform: none;
  }

  .avancement__etape {
    display: none;
  }
}

@media (max-width: 700px) {
  .galerie__mosaique {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .frise__etapes {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 22px;
    border-left: 2px solid var(--accent);
    row-gap: 22px;
  }

  .frise__trait {
    display: none;
  }

  .frise__etapes li {
    padding-top: 0;
  }

  .frise__etapes li::before {
    top: 4px;
    left: -30px;
  }

  .qualite__images {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .produits,
  .reperes__liste,
  .galerie__mosaique {
    grid-template-columns: minmax(0, 1fr);
  }

  .galerie__vue--large {
    grid-column: auto;
  }

  .barre .cta-long {
    display: none;
  }

  .barre .cta-court {
    display: inline;
  }

  .ouverture__actions .bouton,
  .demonstration__actions .bouton,
  .formule .bouton {
    width: 100%;
  }

  .ouverture__actions .bouton--principal .bouton__fleche,
  .demonstration__actions .bouton--principal .bouton__fleche,
  .formule .bouton--principal .bouton__fleche {
    margin-left: auto;
  }

  .fiche__ligne {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .reperes__valeur {
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .barre .cta-court {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .barre__actions .bouton--principal {
    gap: 6px;
    padding-left: 12px;
  }
}

/* ---------- Nouvelle section héros et film produit (T53, 02/11/2026) ---------- */
@media (max-width: 1080px) {
  .heros__cartes {
    display: none;
  }

  .heros__contenu {
    padding-bottom: clamp(90px, 14vh, 130px);
  }
}

/* Téléphone et petite tablette : le texte d'abord, puis l'appareil dans sa scène, puis les cartes */
@media (max-width: 760px) {
  .heros {
    padding: 8px;
  }

  .heros__cadre {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
  }

  .heros__contenu {
    order: -1;
    max-width: none;
    padding: calc(var(--barre-hauteur) + 22px) 20px 8px;
  }

  .heros__scene {
    position: relative;
    inset: auto;
    z-index: 0;
    width: 100%;
    aspect-ratio: 16 / 11;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .heros__cartes {
    position: static;
    display: grid;
    gap: 8px;
    padding: 0 16px 18px;
  }

  .heros__carte {
    width: auto;
  }

  .heros__legende,
  .heros__meta,
  .heros__defiler {
    display: none;
  }

  .heros .bouton {
    flex: 1 1 100%;
  }

  /* Le film : jamais coupé, l'image entière au centre (on dézoome au lieu de recadrer) */
  .cine-produit__piste {
    height: 240vh;
  }

  .cine-produit__scene {
    padding: 8px;
  }

  .cine-produit__cadre {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: calc(var(--barre-hauteur) + 10px) 16px 20px;
  }

  .cine-produit__video {
    position: relative;
    inset: auto;
    z-index: 0;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    transform: none;
  }

  .cine-produit__voile {
    display: none;
  }

  .cine-produit__tete {
    order: -1;
  }

  .cine-produit__tete,
  .cine-produit__etapes,
  .cine-produit__compteur {
    position: static;
    width: auto;
    max-width: none;
  }

  .cine-produit__etapes li {
    padding: 10px 12px;
  }
}

/* T54 12.14 / 12.15 — téléphone : piste du film allongée (arrêts compris) ; les deux plans l'un sous l'autre */
@media (max-width: 760px) {
  .cine-produit__piste {
    height: 480vh;
  }

  .cellule__grille {
    grid-template-columns: minmax(0, 1fr);
  }

  .cellule__mot {
    font-size: 19vw;
  }
}

/* T54 12.10 — « Du moteur électrique au robot » : jamais de case vide sous les cartes. En trois colonnes, les deux
   cartes du bas se partagent toute la largeur (grille de 6 : 2 + 2 + 2 puis 3 + 3) ; en deux colonnes, la dernière
   prend toute la ligne. Les images des cartes élargies passent à un format plus large : même hauteur partout. */
@media (min-width: 861px) and (max-width: 1180px) {
  .produits {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .produits > .produit {
    grid-column: span 2;
  }

  .produits > .produit:nth-child(n + 4) {
    grid-column: span 3;
  }

  .produits > .produit:nth-child(n + 4) .visuel {
    aspect-ratio: 6 / 5;
  }
}

@media (min-width: 561px) and (max-width: 860px) {
  .produits > .produit:last-child {
    grid-column: 1 / -1;
  }

  .produits > .produit:last-child .visuel {
    aspect-ratio: 8 / 5;
  }
}

/* T54 12.8 / 12.11 — RÈGLE DES DEUX BOUTONS (exigence ferme) : deux boutons tiennent toujours sur une seule ligne. La
   rangée devient un conteneur : quand la place manque, les boutons rapetissent (police, marges, icônes, pastille de la
   flèche) au lieu de passer à la ligne ; au téléphone, l'icône de gauche s'efface, la flèche reste. */
.demonstration__actions {
  flex-wrap: nowrap;
  gap: 10px;
  container-type: inline-size;
}

.demonstration__actions .bouton {
  flex: 0 0 auto;
  width: auto;
}

@container (max-width: 500px) {
  .demonstration__actions .bouton {
    gap: 8px;
    min-height: 46px;
    padding-left: 16px;
    font-size: 0.9rem;
  }

  .demonstration__actions .bouton--secondaire {
    padding-right: 16px;
  }

  .demonstration__actions .bouton__icone {
    width: 16px;
    height: 16px;
  }

  .demonstration__actions .bouton__fleche {
    margin-left: 2px;
    padding: 9px;
  }
}

@container (max-width: 440px) {
  .demonstration__actions .bouton {
    gap: 6px;
    padding-left: 12px;
    font-size: 13px;
  }

  .demonstration__actions .bouton--principal {
    padding-right: 4px;
  }

  .demonstration__actions .bouton--secondaire {
    padding-right: 12px;
  }

  .demonstration__actions .bouton__icone {
    width: 15px;
    height: 15px;
  }

  .demonstration__actions .bouton__fleche {
    width: 14px;
    height: 14px;
    padding: 8px;
  }
}

@container (max-width: 380px) {
  .demonstration__actions .bouton {
    gap: 6px;
    min-height: 42px;
    padding-left: 10px;
    font-size: 12px;
    letter-spacing: -0.02em;
  }

  .demonstration__actions .bouton__icone {
    display: none;
  }

  .demonstration__actions .bouton--principal {
    padding-right: 4px;
  }

  .demonstration__actions .bouton--secondaire {
    padding-right: 10px;
  }

  .demonstration__actions .bouton__fleche {
    width: 12px;
    height: 12px;
    margin-left: 1px;
    padding: 6px;
  }
}

@container (max-width: 290px) {
  .demonstration__actions .bouton {
    gap: 4px;
    padding-left: 9px;
    font-size: 11px;
  }

  .demonstration__actions .bouton--secondaire {
    padding-right: 9px;
  }
}

@container (max-width: 262px) {
  .demonstration__actions .bouton {
    font-size: 10px;
  }
}
