/* Correctifs responsive des maquettes produit.
   Les maquettes sont des interfaces desktop affichées dans un cadre étroit :
   plutôt que de laisser le contenu déborder, on fait passer les barres d'outils
   à la ligne et on masque les colonnes secondaires des tableaux. */

/* Onglets : passage à la ligne au lieu d'un débordement horizontal. */
.pui-tabs,
.pv-tabs {
  flex-wrap: wrap;
  row-gap: 2px;
}

@container (max-width: 959px) {
  .pui-topbar,
  .ed-bar,
  .ed-tools,
  .rn-head,
  .ca-empty,
  .ca-picked,
  .ca-steps {
    flex-wrap: wrap;
  }

  .pui-btn {
    max-width: 100%;
    white-space: normal;
  }

  .lb-table th:nth-child(4),
  .lb-table td:nth-child(4) {
    display: none;
  }

  .tl-card .pui-table,
  .lb-table {
    table-layout: fixed;
    width: 100%;
  }

  .tl-card .pui-table th,
  .tl-card .pui-table td,
  .lb-table th,
  .lb-table td {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ed-bar .pui-btn {
    flex: 0 1 auto;
  }
}

@container (max-width: 639px) {
  .tl-card .pui-table th:nth-child(2),
  .tl-card .pui-table td:nth-child(2),
  .tl-card .pui-table th:nth-child(3),
  .tl-card .tl-ext,
  .lb-table th:nth-child(2),
  .lb-table td:nth-child(2),
  .lb-table th:nth-child(3),
  .lb-table td:nth-child(3),
  .pv-table th:nth-child(2),
  .pv-table td:nth-child(2),
  .pv-table th:nth-child(3),
  .pv-table td:nth-child(3) {
    display: none;
  }

  .pui-table th,
  .pui-table td {
    padding-left: 8px;
    padding-right: 8px;
  }

  .ca-pb-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
  }
}

@container (max-width: 359px) {
  .ed-bar,
  .ed-tools {
    flex-direction: column;
    align-items: flex-start;
  }

  .ca-pb-actions {
    display: none !important;
  }

  .lb-table th:last-child,
  .lb-table td:last-child {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .book-btn {
    white-space: normal;
    padding-inline: 16px;
    text-align: center;
  }
}

/* Schéma « Toute l'année » : sous 860 px, les zones positionnées en absolu
   deviennent trop étroites pour leurs libellés. On repasse le schéma en
   grille lisible (hub, légende, puis zones deux par deux) et on masque
   les liens SVG, dont la géométrie ne correspond plus. */
@media (max-width: 859px) {
  .zn.zn {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-content: start;
    gap: 10px;
    height: auto;
    padding: 16px 14px;
  }

  .zn-links.zn-links {
    display: none;
  }

  .zn-hub.zn-hub {
    grid-column: 1 / -1;
    grid-row: 1;
    position: static;
    transform: none;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
  }

  .zn-hub-logo.zn-hub-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    box-shadow: none;
  }

  .zn-hub-name.zn-hub-name {
    margin-top: 0;
  }

  .zn-legend.zn-legend {
    grid-column: 1 / -1;
    grid-row: 2;
    position: static;
    bottom: auto;
    left: auto;
    transform: none;
    flex-wrap: wrap;
    justify-content: center;
    white-space: normal;
    gap: 4px 16px;
    margin-bottom: 4px;
  }

  .zn-zone.zn-zone {
    position: static;
    transform: none;
    width: auto;
    min-width: 0;
    padding: 10px 12px;
  }

  .zn-zone.l1.l1 {
    grid-area: 3 / 1;
  }

  .zn-zone.r1.r1 {
    grid-area: 3 / 2;
  }

  .zn-zone.l2.l2 {
    grid-area: 4 / 1;
  }

  .zn-zone.r2.r2 {
    grid-area: 4 / 2;
  }

  .zn-zone.l3.l3 {
    grid-area: 5 / 1;
  }

  .zn-zone.r3.r3 {
    grid-area: 5 / 2;
  }

  .zn-implant.zn-implant {
    min-width: 0;
    font-size: 0.8125rem;
    gap: 8px;
    align-items: flex-start;
    overflow-wrap: anywhere;
  }

  /* L'icône d'implant est décorative : sur deux colonnes étroites, elle
     vole la largeur nécessaire aux identifiants (implant-…-01). */
  .zn-implant.zn-implant > svg {
    display: none;
  }

  .zn-line.zn-line {
    flex-wrap: wrap;
    gap: 2px 10px;
    margin-top: 6px;
    font-size: 0.75rem;
  }

  .zn-line.zn-line b {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .zn.zn {
    gap: 8px;
    padding: 14px 12px;
  }

  .zn-zone.zn-zone {
    padding: 9px 10px;
  }

  .zn-implant.zn-implant {
    font-size: 0.75rem;
  }

  .zn-hub-name.zn-hub-name {
    font-size: 0.8125rem;
  }
}

/* Maquettes produit : les hauteurs sont calées sur la mise en page desktop.
   Sur mobile, le contenu (tableaux, listes, graphiques) est plus haut que le
   cadre : on laisse la maquette grandir au lieu de rogner son contenu. */
@media (max-width: 859px) {
  .benefit-scene .pui.pui {
    height: auto;
    overflow: visible;
  }

  .pui .pui-main.pui-main {
    overflow: visible;
  }

  .pui .pui-app.pui-app {
    min-height: 0;
  }
}

/* Maquette du hero : hauteur fixe de 520 px sur mobile alors que le tableau
   de bord a besoin de ~870 px. On laisse le cadre suivre le contenu. */
@media (max-width: 859px) {
  .hero-frame.hero-frame {
    height: auto;
  }

  .hero-frame .pui.pui {
    height: auto;
    overflow: visible;
  }

  .hero-frame .pui .pui-main.pui-main {
    overflow: visible;
  }
}
