/* ════════════════════════════════════════════════════════════════
   responsive.css — Éditions B. portail B2B
   Règles communes responsive partagées par toutes les pages.
   Breakpoints : 480 (phone), 768 (tablet), 1024 (laptop)
   ════════════════════════════════════════════════════════════════ */

/* ── Box-sizing partout (sécurité) */
*, *::before, *::after { box-sizing: border-box; }

/* ── Variables responsive partagées */
:root {
  --bp-phone: 480px;
  --bp-tablet: 768px;
  --bp-laptop: 1024px;
}

/* ── Helpers de visibilité */
.hide-mobile { }
.show-mobile { display: none !important; }
.hide-tablet { }

@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: initial !important; }
}
@media (max-width: 1024px) {
  .hide-tablet { display: none !important; }
}

/* ── Anti-scroll horizontal global */
html, body { max-width: 100vw; overflow-x: hidden; }

/* ── Tabs barres communes : scroll horizontal sous tablet */
@media (max-width: 768px) {
  .tabs,
  .nav-tabs,
  .topbar-tabs {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .tabs::-webkit-scrollbar,
  .nav-tabs::-webkit-scrollbar,
  .topbar-tabs::-webkit-scrollbar { height: 3px; }
  .tabs > *,
  .nav-tabs > *,
  .topbar-tabs > * { flex-shrink: 0; }
}

/* ── Modals : taille adaptative sous tablet */
@media (max-width: 768px) {
  .modal {
    max-width: 95vw !important;
    max-height: 90vh !important;
    width: auto !important;
    margin: 10px;
  }
  .modal-overlay,
  .ovl { padding: 10px; }
}

/* ── Boutons cliquables minimum (touch target ≥ 40px) */
@media (max-width: 768px) {
  button, .btn, .b1, .b2, .b3 {
    min-height: 38px;
  }
}

/* ── Inputs un peu plus généreux sur mobile */
@media (max-width: 480px) {
  input, select, textarea {
    font-size: 16px; /* évite le zoom auto iOS sur focus */
  }
}

/* ── Topbar adaptative (header app) */
@media (max-width: 768px) {
  .topbar, .top-bar, header.app-bar {
    height: auto !important;
    min-height: 52px;
    padding: 8px 12px !important;
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ── Wrap principal : padding réduit sous mobile */
@media (max-width: 768px) {
  .wrap, .container, main.wrap {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}
@media (max-width: 480px) {
  .wrap, .container, main.wrap {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* ── Hero : padding réduit sur mobile */
@media (max-width: 768px) {
  .hero {
    padding: 32px 16px !important;
  }
  .hero h1 {
    font-size: 1.6rem !important;
    line-height: 1.2 !important;
  }
  .hero p { font-size: 13px !important; }
}
@media (max-width: 480px) {
  .hero { padding: 24px 12px !important; }
  .hero h1 { font-size: 1.3rem !important; }
}

/* ── Images responsives par défaut */
img { max-width: 100%; height: auto; }

/* ── Garde-fou : toute image dans un panneau/modal ne doit jamais bloquer
   l'affichage des contrôles en dessous. Plafond raisonnable. */
.modal img, .panel img, .ovl img, [class*="panel-img"] img {
  max-height: 50vh;
}

/* ── Focus visible accessible */
:focus-visible {
  outline: 2px solid var(--gold, #d4700a);
  outline-offset: 2px;
}
