/* ═══════════════════════════════════════════════════
   BricoVélo – Feuille de style principale
   Portrait-first, PWA-ready
════════════════════════════════════════════════════ */
/* =========================
   Polices de caractères
========================= */
@font-face {
    font-family: "Montserrat";
    src: local("Montserrat"),
    url("../fonts/Montserrat-SemiBold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Poppins";
    src: local("Poppins"),
    url("../fonts/Poppins-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Material Symbols Outlined";
    src: local("Material Symbols Outlined"),
    url("../fonts/material-symbols-outlined-v307-latin-300.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "AnimeAce";
    src: local("AnimeAce"),
    url("../fonts/animeace2_reg.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}


/* -- Material Icons -- */
.mat-icon, .mat-icon-danger, .mat-icon-vente {
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    font-size: 20px;
}

/* ── Variables ── */
:root {
  --bg-deep:      #0f1221;
  --bg-card:      #1a2040;
  --bg-surface:   #232b4a;
  --accent-blue:  #3d8ef8;
  --accent-cyan:  #00d4ff;
  --accent-red:   #e74c3c;
  --text-primary: #e8edf8;
  --text-muted:   #8892a4;
  --red:    #e74c3c;
  --orange: #f39c12;
  --yellow: #f1c40f;
  --green:  #2ecc71;
  --purple: #9b59b6;
  --blue:   #3498db;
  --grey:   #7f8c8d;

  --sidebar-w: 20vw;
  --sidebar-w-min: 64px;
  --radius: 12px;
  --font-display: "Montserrat", sans-serif;
  --font-body:    "Poppins", sans-serif;
}

/* ── Thème clair ── */
[data-theme="light"] {
  --bg-deep:      #f0f3f9;
  --bg-card:      #ffffff;
  --bg-surface:   #e4e9f2;
  --text-primary: #1a2040;
  --text-muted:   #5a6478;
}

/* Ajustements contextuels en mode clair */
[data-theme="light"] .sidebar {
  border-right-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .sidebar-logo {
  border-bottom-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .step-card,
[data-theme="light"] .fiche-card {
  border-color: rgba(0,0,0,0.07);
}
[data-theme="light"] .page-header {
  border-bottom-color: rgba(0,0,0,0.08);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

/* ════════════════════════════════════════════════
   LAYOUT PRINCIPAL
════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  height: 100dvh;
  width: 100vw;
}

/* ════════════════════════════════════════════════
   SIDEBAR (1/5)
════════════════════════════════════════════════ */
.btn-hamburger {
  display: none;
}

.sidebar-menu .menu-item span {
    text-decoration: none;
    display: inline-block;
}

.mat-icon {
    font-display: block;
}

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w-min);
  max-width: 150px;
  height: 100%;
  background: var(--bg-card);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 6px;
  z-index: 10;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  width: 100%;
}

.logo-img {
  width: 125px;
  height: auto;
  object-fit: contain;
  padding: 0 10px;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-cyan);
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  flex: 1;
  padding: 0 6px;
}

.sidebar-menu a,
.sidebar-menu a:hover,
.sidebar-menu a:visited {
  text-decoration: none; 
  color: var(--text-muted);
}

.menu-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  position: relative;
}
.menu-item:hover {
  background: rgba(61,142,248,0.12);
}
.menu-item.active {
  background: rgba(61,142,248,0.2);
  border: 1px solid rgba(61,142,248,0.3);
}
.menu-item.active .menu-label { color: var(--accent-cyan); }

.menu-item .mat-icon, .theme-toggle .mat-icon, .sidebar-footer .mat-icon {
  font-size: 1rem;
  color: var(--text-muted);
  width: 26px; height: 26px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid rgba(136, 146, 164, 0.25);
  color: var(--text-muted);
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  padding: 3px 4px;
}

.menu-label {
  font-size: 0.6rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  width: 100%;
  padding: 0 6px;
}
.sidebar-footer:hover { opacity: 1; }
.sidebar-footer a,
.sidebar-footer a:hover,
.sidebar-footer a:visited {
  text-decoration: none;
}
.sidebar-footer-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  position: relative;
  width: 100%;
  color: var(--text-muted);
}
.sidebar-footer-link:hover {
  background: rgba(61,142,248,0.12);
}

.theme-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px 4px;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}
.theme-toggle:hover {
  background: rgba(61,142,248,0.12);
  color: var(--accent-cyan);
}

/* ════════════════════════════════════════════════
   MAIN CONTENT (4/5)
════════════════════════════════════════════════ */
.main-content {
  flex: 1;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 8px;
  gap: 12px;
}

/* ── En-tête de page commun (index, viewer, favoris) ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 10px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.05em;
  color: var(--text-primary);
  white-space: nowrap;
}

.type-header-icon {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--text-muted) 25%, transparent);
  color: var(--text-muted);
  flex-shrink: 0;
}
.type-header-icon .mat-icon { font-size: 1.5rem; }

.subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ════════════════════════════════════════════════
   BIKE SVG CONTAINER
════════════════════════════════════════════════ */
.bike-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bike-svg {
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: contain;
}

/* Dots SVG */
.dot {
  cursor: pointer;
  transition: r 0.2s, opacity 0.2s;
}
.bike-link:hover .dot {
  opacity: 0.85;
  filter: brightness(1.3);
}

/* Animation pulsation */
@keyframes pulse {
  0%, 100% { r: 18; opacity: 0.6; }
  50%       { r: 28; opacity: 0; }
}
.dot-pulse { animation: pulse 2.4s ease-in-out infinite; }

/* Labels SVG */
.dot-label {
  fill: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.bike-panel {
  position: absolute;
  background: var(--bg-surface, #fff);
  border: 0.5px solid #ccc;
  border-radius: 12px;
  padding: 1rem;
  min-width: 320px;
  max-width: 320px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  font-family: inherit;
}
.bike-panel-title {
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: .5rem;
}
.bike-panel a {
  display: block;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
}
.bike-panel a:hover {
  color: var(--accent-blue);
  text-decoration: none;
}
.bike-panel-badge { width:13px; height:13px; border-radius:50%; flex-shrink:0; }
.bike-panel-close { margin-left:auto; background:none; border:none; cursor:pointer; font-size:16px; color:#888; }
.bike-panel ul { list-style:none; padding:0; margin:0; }
.bike-panel li { border-bottom: 0.5px solid #eee; }
.bike-panel li:last-child { border-bottom: none; }
.bike-container { position: relative; } /* indispensable pour le positionnement absolu */

/* ════════════════════════════════════════════════
   LÉGENDE
════════════════════════════════════════════════ */
.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 6px 0 4px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  letter-spacing: 0.06em;
}
.legend-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
}
.legend-dot.red    { background: var(--red); }
.legend-dot.orange { background: var(--orange); }
.legend-dot.green  { background: var(--green); }
.legend-dot.purple { background: var(--purple); }
.legend-dot.blue   { background: var(--blue); }
.legend-dot.grey   { background: var(--grey); }

/* ════════════════════════════════════════════════
   PAGE FICHE TECHNIQUE
════════════════════════════════════════════════ */

/* Côté gauche du header : titre + sous-élément (dots viewer, dots index) */
.page-header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-bottom: 10px;
}

/* Indicateur d'étape */
.steps-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}
.step-dot-nav {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.3s;
  cursor: pointer;
}
.step-dot-nav.active {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  width: 24px;
  border-radius: 4px;
}

/* Zone de défilement des cartes */
.cards-scroll {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.cards-wrapper {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── CARTE D'ÉTAPE ── */
.step-card {
  min-width: 100%;
  height: 100%;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.07);
  display: flex;
  /* flex-direction: column; */
  flex-direction: row;
  overflow: hidden;
}

.card-image-zone {
  flex: 1;
  min-width: 50%;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  padding: 15px 10px;
}

.card-image-zone img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 30px;
  object-fit: contain;
  display: block;
}

.card-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
}
.card-image-placeholder span { font-size: 3rem; }
.card-image-placeholder p { font-size: 0.75rem; color: var(--text-muted); }

.step-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent-blue);
  color: white;
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  padding: 3px 15px;
  border-radius: 20px;
}

.card-text-zone {
  flex: 1;
  min-width: 0;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: var(--bg-card);
  overflow-y: auto;
  min-height: 0;
}

.card-text-zone a, .card-text-zone a:visited {
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  border-radius: 999px;
  padding: 0 6px;
  text-decoration: none;
}

.card-text-zone .mat-icon {
  /* display: flex; */
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,.4);
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
  padding: 0 3px;
  /* font-size: .9rem; */
}

.card-text-zone a:hover { background: rgba(61, 142, 248, 0.3); }

.card-step-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 15px;
  margin-bottom: 6px;
  padding-bottom: 3px;
  color: var(--accent-cyan);
  border-bottom: 1px solid var(--accent-cyan);
}

.card-step-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-top: 5px;
  margin-bottom: 10px;
}

.card-tip {
  margin-top: 10px;
  background: rgba(0,212,255,0.08);
  border-left: 3px solid var(--accent-cyan);
  padding: 8px 10px;
  border-radius: 0 6px 6px 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-tip .mat-icon {
  color: var(--yellow);
  background: none;
  border: none;
  padding: 0;
}
.card-tip--danger {
  background: rgba(255,0,0,0.08);
  border-left: 3px solid var(--accent-red);
  color: var(--red);
}

.card-tip--vente {
  background: rgba(46,204,113,0.08);
  border-left: 3px solid var(--green);
  color: var(--green);
}
.bleu { color: white; background: blue; border-radius: 999px; padding: 0 6px;}
.rouge { color: white; background: red; border-radius: 999px; padding: 0 6px;}
.vert { color: white; background: green; border-radius: 999px; padding: 0 6px;}
.violet { color: white; background: #9b59b6; border-radius: 999px; padding: 0 6px;}

/* Navigation cartes */
.card-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-deep);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.btn-card-nav {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--text-primary);
  font-size: 1.2rem;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  text-decoration: none;
}
.btn-card-nav:hover { background: rgba(61,142,248,0.2); border-color: var(--accent-blue); }
.btn-card-nav:disabled { opacity: 0.3; cursor: default; }
.btn-card-nav.primary { background: var(--accent-blue); border-color: transparent; }
.btn-card-nav.primary:hover { background: #5aa3ff; }

.card-counter {
  padding: 0 15px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════
   CARTE SOMMAIRE (image cercle + liste texte)
════════════════════════════════════════════════ */

/* Zone image : fixée à 50% de largeur */
.sv2-image-zone {
  flex: 0 0 50%;
  min-width: 50%;
  align-items: center;
  justify-content: center;
}

/* Cercle contenant l'image de l'étape 1 */
.sv2-circle {
  width: 500px;
  height: 500px;
  max-width: 80%;
  max-height: 80%;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
}
.sv2-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* annule le border-radius de .card-image-zone img */
  border-radius: 0;
}

/* Zone texte : occupe l'autre 50%, scrollable */
.sv2-text-zone {
  flex: 0 0 50%;
  min-width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
}

/* Titre "Au programme" */
.sv2-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

/* Liste des titres — sans habillage de fond/bordure */
.sv2-list {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sv2-item {
  width: 100%;
}

.sv2-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: color 0.15s;
}
.sv2-item:last-child .sv2-link {
  border-bottom: none;
}
.sv2-link:hover {
  color: var(--accent-cyan);
}

.sv2-label {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.4;
}

.sv2-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 1.1rem;
  background: none !important;
  border: none !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  transition: color 0.15s;
}
.sv2-link:hover .sv2-arrow {
  color: var(--accent-cyan);
}

/* ── Responsive mobile v2 ── */
@media (max-width: 600px) {
  .summary-card-v2 .card-image-zone {
    height: 100%;
    min-height: 100%;
  }
  .sv2-circle {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
    padding: 5px;
    /* margin: auto !important; */
  }
  .sv2-circle img {
    border-radius: 50% !important;
    margin-top: 40% !important;
  }
}


/* ════════════════════════════════════════════════
   RESPONSIVE  (tablette, grand écran)
════════════════════════════════════════════════ */
@media (min-width: 600px) {
  .logo-text { font-size: 0.85rem; }
  .menu-label { font-size: 0.7rem; }
}
@media (max-width: 900px) {
  * {
    font-size: 0.85rem;
  }
  .card-step-text {
    font-size: 0.85rem;
  }
  .step-card {
    flex-direction: column;
  }
}

/* ════════════════════════════════════════════════
   TABLETTE PORTRAIT – scroll global image + texte
════════════════════════════════════════════════ */
@media (min-width: 601px) and (max-width: 900px) and (orientation: portrait) {

  /* Autoriser le scroll vertical dans la zone des cartes */
  .cards-scroll {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Laisser la wrapper s'étirer en hauteur naturelle */
  .cards-wrapper {
    height: auto;
    align-items: flex-start;
  }

  /* La carte n'est plus contrainte à 100 % de la hauteur visible */
  .step-card {
    height: auto;
  }

  /* Donner une hauteur minimale à la zone image pour qu'elle reste lisible */
  .card-image-zone {
    min-height: 50dvh;
    height: 50dvh;
  }

  /* La zone texte s'étire à sa hauteur naturelle (pas de scroll interne) */
  .card-text-zone {
    overflow-y: visible;
    height: auto;
    min-height: unset;
  }
  
  .page-header h1 {
    white-space: normal;
  }

}


/* ════════════════════════════════════════════════
   MOBILE PORTRAIT – swipe interne image / texte
════════════════════════════════════════════════ */
@media (max-width: 600px) and (orientation: portrait) {

  /* En-tête viewer : titre + dots sur 1re ligne, actions sur 2e ligne */
  .page-header {
    flex-wrap: wrap;
  }
  .page-header h1 {
    white-space: normal;
    padding-right: 52px;   /* espace pour le bouton hamburger */
  }
  .page-header-left {
    flex: 1 1 100%;
    padding-bottom: 4px;
  }
  .fiche-header-actions {
    flex: 1 1 100%;
    justify-content: flex-end;
  }
  .fiche-header-actions .card-nav {
    width: 100%;
    justify-content: center;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 0 16px;
  }

  /* La carte devient un swiper interne vertical */
  .step-card {
    flex-direction: column;       /* panneaux empilés verticalement */
    overflow: hidden;
    position: relative;
  }

  /* Les deux zones : chacune fait 100% de la hauteur de la carte */
  .card-image-zone,
  .card-text-zone {
    min-height: 100%;
    height: 100%;
    width: 100%;
    flex-shrink: 0;
  }

  /* Image : pleine largeur, padding 5px */
  .card-image-zone {
    padding: 5px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
  }
  .card-image-zone img {
    width: 100%;
    height: auto;
    max-height: none;
    border-radius: 12px;
    object-fit: contain;
  }

  /* Texte : scrollable */
  .card-text-zone {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(255,255,255,0.06);
    border-left: none;
  }

  /* Dots internes image/texte — orientés verticalement */
  .inner-dots {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    z-index: 5;
  }
  .inner-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid rgba(255,255,255,0.25);
    transition: all 0.3s;
    cursor: pointer;
  }
  .inner-dot.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    height: 18px;
    width: 6px;
    border-radius: 3px;
  }
}

/* Hors mobile portrait : cacher les dots internes */
@media not all and (max-width: 600px) and (orientation: portrait) {
  .inner-dots { display: none; }
}

/* ════════════════════════════════════════════════
   MOBILE PAYSAGE – image gauche / texte droite (50/50)
   Annule le flex-direction: column du breakpoint 900px
════════════════════════════════════════════════ */
@media (orientation: landscape) and (max-width: 900px) {
  .main-content {
    padding-top: 6px !important;
  }
  /* Viewer : annuler le wrap portrait, tout sur une ligne */
  .page-header {
    flex-wrap: nowrap;
  }
  .page-header-left {
    flex: 0 1 auto;
    padding-bottom: 10px;
  }
  .fiche-header-actions {
    flex: 0 0 auto;
    padding-right: 40px;
  }

  .step-card {
    flex-direction: row;
    overflow: hidden;
  }

  .card-image-zone {
    flex: 0 0 50%;
    min-width: 50%;
    height: 100%;
    min-height: unset;
    width: auto;
    padding: 10px;
  }

  .card-text-zone {
    flex: 0 0 50%;
    min-width: 50%;
    height: 100%;
    min-height: unset;
    width: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: none;
    border-left: 1px solid rgba(255,255,255,0.06);
  }

  /* Dots internes inutiles en paysage : masqués */
  .inner-dots { display: none; }
}

/* ════════════════════════════════════════════════
   TABLETTE PAYSAGE LARGE – scroll texte uniquement
   Couvre iPad (1024 px) et iPad Pro (1366 px)
════════════════════════════════════════════════ */
@media (min-width: 901px) and (max-width: 1366px) and (orientation: landscape) {

  .card-text-zone {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}


/* ════════════════════════════════════════════════
   MOBILE – HAMBURGER + OVERLAY NAV
════════════════════════════════════════════════ */
@media (max-width: 600px), (orientation: landscape) and (max-height: 500px) {

  /* Sidebar cachée par défaut, devient overlay */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    width: 150px;
    max-width: 80vw;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    overflow-y: auto;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .logo-img {
    width: 90px;
    height: auto;
    object-fit: contain;
    padding: 0 3px;
  }

  /* Fond semi-transparent derrière la sidebar */
  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  .nav-backdrop.open {
    display: block;
  }

  /* Bouton hamburger fixe haut droite */
  .btn-hamburger {
    position: fixed;
    top: 16px;
    right: 12px;
    z-index: 201;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    transition: background 0.2s;
  }
  .btn-hamburger:hover { background: var(--bg-surface); }

  /* Les 3 barres */
  .btn-hamburger .bar {
    width: 18px; height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s, width 0.3s;
    transform-origin: center;
  }
  /* Animation → croix quand ouvert */
  .btn-hamburger.open .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .btn-hamburger.open .bar:nth-child(2) {
    opacity: 0; width: 0;
  }
  .btn-hamburger.open .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Le main-content prend toute la largeur */
  .app-layout {
    flex-direction: column;
  }
  .main-content {
    width: 100%;
    padding-top: 16px;
  }

  /* Labels sidebar visibles en overlay */
  .menu-label { font-size: 0.72rem; text-align: left; }
  .sidebar-menu { padding: 0 10px; }
  .menu-item {
    flex-direction: row;
    justify-content: flex-start;
  }
  .sidebar-footer {
    flex-direction: column;
    width: 100%;
    padding: 10px 14px;
  }
}

/* ════════════════════════════════════════════════
   INDEX COMMUN — fiches techniques & fiches outils
════════════════════════════════════════════════ */

/* Côté droit du header index : badge total + bouton nouveau */
.index-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.index-total {
  font-size: .72rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-radius: 20px;
  padding: .2rem .65rem;
  white-space: nowrap;
}

.btn-newedit {
  width: 36px; height: 36px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.btn-newedit a {
  text-decoration: none;
  color: var(--text-muted);
}

/* ── Barre de recherche ── */
.search-bar {
  flex: 1;
  position: relative;
  max-width: 320px;
  margin-left: auto;
}
.search-bar input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: .85rem;
  padding: .45rem .85rem .45rem 2.2rem;
  transition: border-color .2s;
}
.search-bar input:focus { outline: none; border-color: var(--accent-blue); }
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar .mat-icon {
  position: absolute;
  left: .55rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .95rem;
  opacity: .4;
  pointer-events: none;
}

/* ── Grille des catégories ── */
.cats-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  overflow: hidden;
}

/* ── Carte de catégorie ── */
.cat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  padding-bottom: 10px;
}

.cat-head {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .9rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.cat-icon {
  width: 40px; height: 40px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cat-icon .mat-icon { font-size: 1.75rem; }

/* Couleurs fiches techniques */
.cat-icon.freinage     { background: rgba(231,76,60,.18);  color: #e74c3c; }
.cat-icon.transmission { background: rgba(243,156,18,.18); color: #9b59b6; }
.cat-icon.roue         { background: rgba(46,204,113,.18); color: #3498db; }
.cat-icon.cadre-assise { background: rgba(155,89,182,.18); color: #f39c12; }
.cat-icon.direction    { background: rgba(52,152,219,.18); color: #2ecc71; }

/* Couleurs fiches outils */
.cat-icon.serrage      { background: rgba(231,76,60,.18);  color: #e74c3c; }
.cat-icon.mesure       { background: rgba(243,156,18,.18); color: #f39c12; }
.cat-icon.lubrification{ background: rgba(46,204,113,.18); color: #2ecc71; }

/* Partagée fiches + outils */
.cat-icon.divers       { background: rgba(127,140,141,.18); color: #7f8c8d; }

.cat-head-info { flex: 1; min-width: 0; }
.cat-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-count { font-size: .8rem; color: var(--text-muted); margin-top: 1px; }

/* ── Liste des items dans la carte ── */
.index-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.index-list::-webkit-scrollbar { width: 4px; }
.index-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

/* ── Ligne item ── */
.index-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 2px 15px;
  text-decoration: none;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .12s;
}
.index-item:last-child { border-bottom: none; }
.index-item:hover { background: rgba(61,142,248,.1); }

.index-item-label {
  flex: 1;
  font-size: .8rem;
  line-height: 1.3;
  text-decoration: none; /* Supprime le soulignement */
  color: var(--text-primary); /* Garde la couleur du texte */
  display: block;
}
.index-item:has(.index-item-label:hover) {
  background: rgba(61,142,248,.1);
}

.index-item-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 25px; height: 25px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-muted);
  text-decoration: none;
  flex-shrink: 0;
}
.index-item-edit .mat-icon { font-size: .9rem; }
.index-item:hover .index-item-edit { opacity: 1; }
.index-item-edit:hover {
  background: rgba(61,142,248,.15);
  border-color: rgba(61,142,248,.35);
  color: var(--accent-blue);
}

/* ── Bouton favori inline (index — vue liste) ── */
.index-item-favori {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 25px; height: 25px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.index-item-favori .mat-icon { font-size: .9rem; }
.index-item-favori:hover,
.index-item-favori.active {
  background: rgba(241,196,15,.15);
  border-color: rgba(241,196,15,.4);
  color: #f1c40f;
}
.index-item-favori.pulse { animation: favoriPulse .35s ease; }

/* @media (max-width: 950px) {
  .index-item-favori { display: none; }
} */

.index-item-empty {
  padding: .75rem .9rem;
  font-size: .75rem;
  color: var(--text-muted);
  font-style: italic;
  opacity: .5;
}

/* ── Aucun résultat ── */
.no-results-msg {
  display: none;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .5rem;
  color: var(--text-muted);
  font-size: .88rem;
}
.no-results-msg .mat-icon { font-size: 2rem; opacity: .3; }
.no-results-msg.visible { display: flex; }

/* ── Responsive mobile ── */
@media (max-width: 600px) {
  .cats-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    overflow-y: auto;
  }
  .cat-card { min-height: 110px; }
  .index-list { overflow-y: visible; }
  .index-total { display: none; }
  .btn-newedit, .index-item-edit { display: none; }
}

@media (max-width: 950px) {
  .btn-newedit, .index-item-edit { display: none; }
  .page-header--searchable .search-bar { margin-right: 50px; }
}

  /* ── Indicateur de pages (mobile uniquement) ── */
  .index-pages-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    flex-shrink: 0;
  }
  .index-page-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s;
    cursor: pointer;
  }
  .index-page-dot.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    width: 24px;
    border-radius: 4px;
  }

  /* ── Mobile commun : wrapper swipeable ── */
  @media (max-width: 600px), (orientation: landscape) and (max-width: 950px) {
    .index-pages-indicator { display: flex; }

    .cats-grid {
      /* Clip horizontal pour le swipe — le scroll vertical reste libre */
      overflow-x: clip;
      display: block;
      position: relative;
    }

    /* Le wrapper interne porte toutes les pages côte à côte */
    .cats-pages-wrapper {
      display: flex;
      /* Pas de height fixe : les pages dictent leur hauteur */
      transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* Chaque page fait exactement 100% de la largeur du conteneur */
    .cats-page {
      min-width: 100%;
      /* Pas de height fixe ni overflow hidden : scroll vertical libre */
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 0 0 12px;
    }

    /* Paysage : 2 cartes côte à côte par page */
    @media (orientation: landscape) {
      .cats-page {
        flex-direction: row;
        flex-wrap: wrap;
      }
      .cats-page .cat-card {
        flex: 1 1 calc(50% - 5px);
      }
    }
  }

/* ════════════════════════════════════════════════
   BOUTON FAVORI + NAVIGATION (viewer)
════════════════════════════════════════════════ */

.fiche-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-favori, .btn-print, .btn-outils-requis {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
  flex-shrink: 0;
}
.btn-print:hover, .btn-outils-requis:hover {
  color: var(--text-primary);
}
.btn-favori .mat-icon {
  transition: font-variation-settings .18s;
}
.btn-favori:hover {
  background: rgba(241,196,15,.15);
  border-color: rgba(241,196,15,.35);
  color: #f1c40f;
}
.btn-favori.active {
  background: rgba(241,196,15,.18);
  border-color: rgba(241,196,15,.5);
  color: #f1c40f;
}
.btn-favori.pulse { animation: favoriPulse .35s ease; }
@keyframes favoriPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.28); }
  70%  { transform: scale(.93); }
  100% { transform: scale(1); }
}

/* ════════════════════════════════════════════════
   BOUTON BACK-ORIGIN (fiche.html / outil.html)
════════════════════════════════════════════════ */

.btn-back-origin {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(241,196,15,.15);
  border: 1px solid rgba(241,196,15,.35);
  color: #f1c40f;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
  flex-shrink: 0;
  text-decoration: none;
}
.btn-back-origin .mat-icon {
  transition: font-variation-settings .18s;
}
.btn-back-origin:hover {
  background: var(--bg-surface);
  border-color: rgba(255,255,255,.1);
  color: var(--text-muted);
}
.btn-back-origin.pulse { animation: favoriPulse .35s ease; }
@keyframes favoriPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.28); }
  70%  { transform: scale(.93); }
  100% { transform: scale(1); }
}

/* ════════════════════════════════════════════════
   PAGE FAVORIS
════════════════════════════════════════════════ */

.favoris-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  overflow-y: auto;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.favoris-grid::-webkit-scrollbar { width: 4px; }
.favoris-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

@media (min-width: 951px) {
  .favoris-grid .favori-thumb,
  .favoris-grid .favori-thumb-placeholder {
    height: 160px;
    aspect-ratio: unset;
  }
}



.favoris-desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 0 4px;
  flex-shrink: 0;
}
.favoris-page-nav {
  margin-left: auto;
  align-items: center;
  gap: 8px;
}

/* Quand paginé, le grid devient simple conteneur de clip */
.favoris-grid--paginated {
  display: block;
  overflow: hidden;
  position: relative;
}

.favoris-pages-wrapper--desktop {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.favoris-page--desktop {
  min-width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-content: start;
  gap: 10px;
  overflow: hidden;
}

.favoris-page--desktop .favori-thumb,
.favoris-page--desktop .favori-thumb-placeholder {
  height: 200px;
  aspect-ratio: unset;
}





.favori-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
  text-decoration: none;
  color: var(--text-primary);
}
.favori-card:hover {
  border-color: rgba(61,142,248,.75);
  /* transform: translateY(-2px); */
}

.favori-thumb, .index-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 180px;   /* plafond absolu */
  object-fit: cover;
  display: block;
  background: var(--bg-surface);
  flex-shrink: 1;      /* peut se comprimer si la carte est contrainte */
  min-height: 60px;    /* mais garde un minimum visible */
}
.favori-thumb-placeholder, .index-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 180px;
  min-height: 60px;
  flex-shrink: 1;
  background: var(--bg-surface);
  display: flex; align-items: center; justify-content: center;
}
.favori-thumb-placeholder .mat-icon, .index-thumb-placeholder .mat-icon { font-size: 2rem; opacity: .2; }

.favori-body {
  flex: 1;
  padding: .55rem .7rem .5rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.favori-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.favori-badge {
  font-size: .58rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .1rem .4rem;
  border-radius: 4px;
}
.favori-badge.type-fiche { background: rgba(61,142,248,.18);  color: var(--accent-blue); border: 1px solid var(--accent-blue); }
.favori-badge.type-outil { background: rgba(0,212,255,.15);   color: var(--accent-red); border: 1px solid var(--accent-red); }
.favori-badge.type-composant { background: rgba(0,212,255,.15);   color: var(--orange); border: 1px solid var(--orange); }
.favori-badge.cat        { background: var(--bg-surface);     color: var(--text-muted); }

.favori-titre {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.btn-remove-favori {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(15,18,33,.75);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s, opacity .15s;
  opacity: 1;
}
.btn-remove-favori .mat-icon { font-size: .95rem; }
.btn-remove-favori:hover {
  background: rgba(231,76,60,.85);
  color: #fff;
  border-color: transparent;
}

.favoris-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  color: var(--text-muted);
  padding: 4rem 1rem;
  text-align: center;
}
.favoris-empty .mat-icon { font-size: 3rem; opacity: .2; }
.favoris-empty p { font-size: .85rem; opacity: .5; line-height: 1.5; }

.favoris-no-results {
  display: none;
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--text-muted);
  font-size: .88rem;
  padding: 2rem;
}
.favoris-no-results .mat-icon { font-size: 2rem; opacity: .3; }
.favoris-no-results.visible { display: flex; }

.favori-card.removing {
  animation: favoriOut .22s ease forwards;
  pointer-events: none;
}
@keyframes favoriOut { to { opacity: 0; transform: scale(.88); } }

@media (max-width: 600px) {
  .favoris-grid { grid-template-columns: 1fr; }
  .btn-remove-favori { opacity: 1; }
}

/* ════════════════════════════════════════════════
   PAGE FAVORIS — additions carousel mobile
   À ajouter à la suite de la section "PAGE FAVORIS"
   (après la règle @media (max-width: 600px) existante)
════════════════════════════════════════════════ */

/* ── Badge total : toujours visible dans le header sticky ── */
@media (max-width: 600px) {
  .page-header--sticky .index-total { display: inline-flex !important; }
}

/* ── Carousel mobile : même mécanique que cats-grid ── */
@media (max-width: 600px), (orientation: landscape) and (max-width: 950px) {

  .favoris-grid {
    /* Devient un conteneur de clip pour le swipe horizontal */
    overflow: hidden;
    display: block;          /* écrase le display:grid desktop */
    position: relative;
  }

  /* Le wrapper interne porte toutes les pages côte à côte */
  .favoris-pages-wrapper {
    display: flex;
    /* Pas de height fixe */
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  /* Chaque page fait exactement 100 % de la largeur du conteneur */
  .favoris-page {
    min-width: 100%;
    /* Pas de height fixe ni overflow hidden — scroll vertical libre */
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 0 12px;
  }

  /* Portrait : 3 cartes par page — hauteur naturelle */
  @media (orientation: portrait) {
    .favoris-page .favori-thumb,
    .favoris-page .favori-thumb-placeholder {
      aspect-ratio: 16 / 9;
      height: auto;
      max-height: auto;
      flex-shrink: 0;
    }
    .favoris-page .index-thumb,
    .favoris-page .index-thumb-placeholder {
      aspect-ratio: 16 / 9;
      height: auto;
      flex-shrink: 0;
    }
  }

  /* Paysage : 2 cartes côte à côte par page */
  @media (orientation: landscape) {
    .favoris-page {
      flex-direction: row;
      flex-wrap: wrap;
    }
    .favoris-page .favori-card {
      flex: 0 0 49%;
    }
    .favoris-page .favori-thumb,
    .favoris-page .favori-thumb-placeholder {
      aspect-ratio: 16 / 9;
      height: auto;
      flex-shrink: 0;
    }
    .favoris-page .index-thumb,
    .favoris-page .index-thumb-placeholder {
      aspect-ratio: 16 / 9;
      height: auto;
      flex-shrink: 0;
    }
  }
}

/* ════════════════════════════════════════════════
   HEADER STICKY COMMUN  (liens, lexique, …)
════════════════════════════════════════════════ */

.page-header--sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-deep);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.07);
  padding: 12px 20px;
}

.page-header--sticky h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -.05em;
  color: var(--text-primary);
  margin: 0;
}

/* Annule le padding-bottom que .page-header-left porte pour le viewer */
.page-header--sticky .page-header-left {
  padding-bottom: 0;
}

/* Ligne 1 : bloc titre + contrôles droite */
.page-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Côté droit : search-bar + bouton optionnel */
.page-header-controls {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-shrink: 0;
  align-self: center;
}

/* Ligne 2 : filtres catégories */
.page-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-top: .65rem;
}

.btn-filter {
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 300;
  padding: .22rem .8rem;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
  letter-spacing: .02em;
}
.btn-filter:hover {
  background: rgba(61,142,248,.12);
  color: var(--accent-blue);
  border-color: rgba(61,142,248,.3);
}
.btn-filter.active {
  background: rgba(61,142,248,.18);
  color: var(--accent-cyan);
  border-color: rgba(61,142,248,.45);
  font-weight: 600;
}

/* ── Responsive mobile ── */
@media (max-width: 640px) {
  .page-header--sticky        { padding: 10px 16px; }
  .page-header-top            { flex-direction: column; gap: .6rem; }
  .page-header-top .page-header-controls { width: 100%; }
  .page-header-top .search-bar           { max-width: unset; margin-left: 0; }
}
