/* ============================================================
   MÉRIDIAN — Couche de compatibilité
   Réimplémente le sous-ensemble Bootstrap / PrestaShop utilisé
   par les templates des modules (grille, utilitaires, collapse,
   dropdown, modal, boutons, formulaires). Chargée AVANT theme.css.
   ============================================================ */

/* ---------- Grille (flex 12 colonnes) ---------- */
.row { display: flex; flex-wrap: wrap; margin-inline: -12px; }
.row > [class*="col-"] { padding-inline: 12px; }
[class*="col-"] { position: relative; width: 100%; min-height: 1px; }

/* base mobile-first : col-xs / col-xxs */
.col-xxs-12, .col-xs-12 { flex: 0 0 100%; max-width: 100%; }
.col-xs-1 { flex: 0 0 8.333%; max-width: 8.333%; }
.col-xs-2 { flex: 0 0 16.666%; max-width: 16.666%; }
.col-xs-3 { flex: 0 0 25%; max-width: 25%; }
.col-xs-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-xs-5 { flex: 0 0 41.666%; max-width: 41.666%; }
.col-xs-6 { flex: 0 0 50%; max-width: 50%; }
.col-xs-7 { flex: 0 0 58.333%; max-width: 58.333%; }
.col-xs-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-xs-9 { flex: 0 0 75%; max-width: 75%; }
.col-xs-10 { flex: 0 0 83.333%; max-width: 83.333%; }
.col-xs-12 { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 576px) {
  .col-sm-1 { flex: 0 0 8.333%; max-width: 8.333%; }
  .col-sm-2 { flex: 0 0 16.666%; max-width: 16.666%; }
  .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
  .col-sm-4 { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-sm-5 { flex: 0 0 41.666%; max-width: 41.666%; }
  .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
  .col-sm-7 { flex: 0 0 58.333%; max-width: 58.333%; }
  .col-sm-8 { flex: 0 0 66.666%; max-width: 66.666%; }
  .col-sm-9 { flex: 0 0 75%; max-width: 75%; }
  .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
}
@media (min-width: 768px) {
  .col-md-1 { flex: 0 0 8.333%; max-width: 8.333%; }
  .col-md-2 { flex: 0 0 16.666%; max-width: 16.666%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-md-5 { flex: 0 0 41.666%; max-width: 41.666%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-7 { flex: 0 0 58.333%; max-width: 58.333%; }
  .col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
  .col-md-9 { flex: 0 0 75%; max-width: 75%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}
@media (min-width: 992px) {
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-lg-5 { flex: 0 0 41.666%; max-width: 41.666%; }
  .col-lg-7 { flex: 0 0 58.333%; max-width: 58.333%; }
  .col-lg-8 { flex: 0 0 66.666%; max-width: 66.666%; }
  .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
}
@media (min-width: 1200px) {
  .col-xl-3 { flex: 0 0 25%; max-width: 25%; }
  .col-xl-4 { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-xl-6 { flex: 0 0 50%; max-width: 50%; }
}

/* ---------- Utilitaires d'affichage responsive (style PrestaShop) ---------- */
@media (max-width: 767px) { .hidden-sm-down { display: none !important; } }
@media (min-width: 768px) { .hidden-md-up { display: none !important; } }
@media (max-width: 991px) { .hidden-md-down { display: none !important; } }
@media (min-width: 992px) { .hidden-lg-up { display: none !important; } }
.hidden-xs-up { display: none !important; }
.hide { display: none !important; }

/* ---------- Divers utilitaires ---------- */
.clearfix::after { content: ""; display: table; clear: both; }
.float-xs-right { float: right; }
.float-xs-left { float: left; }
.text-xs-center, .text-sm-center, .text-center { text-align: center; }
.text-xs-right { text-align: right; }
.text-uppercase { text-transform: uppercase; }
.img-fluid { max-width: 100%; height: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- Collapse ---------- */
.collapse { display: none; }
.collapse.in, .collapse.show { display: block; }

/* ---------- Onglets (tab-pane) : seul l'actif s'affiche ---------- */
.tab-pane { display: none; }
.tab-pane.active, .tab-pane.show.active, .tab-content > .active { display: block; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 40; min-width: 200px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 3px;
  box-shadow: var(--shadow-soft); padding: 8px 0; margin-top: 6px;
}
.dropdown.open > .dropdown-menu,
.dropdown.show > .dropdown-menu,
.dropdown-menu.show,
.dropdown-menu.open { display: block; }
.dropdown-menu > a, .dropdown-menu .select-list { display: block; padding: 9px 16px; font-size: 14px; color: var(--ink-soft); }
.dropdown-menu > a:hover, .dropdown-menu .select-list:hover { background: var(--bg-2); color: var(--ink); }
.dropdown-menu .select-list.current { color: var(--ink); font-weight: 600; }
.dropdown-menu .disabled { opacity: .5; pointer-events: none; }

/* ---------- Boutons (fallback Bootstrap → MÉRIDIAN) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 2px; font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid transparent;
  transition: all .35s var(--ease); line-height: 1; text-align: center;
}
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-secondary { background: none; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-tertiary { background: none; color: var(--accent); border: none; padding: 6px 0; }
.btn-unstyle { background: none; border: none; padding: 0; color: inherit; cursor: pointer; }
.btn:disabled, .btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Formulaires ---------- */
.form-control, input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  border: 1px solid var(--line); border-radius: 2px; padding: 11px 13px; background: var(--bg);
  width: 50px; font-size: 14.5px; color: var(--ink);
}
.form-control:focus, input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }

/* ---------- Alertes (Bootstrap → MÉRIDIAN) ---------- */
.alert {
  padding: 13px 16px; border-radius: var(--radius); font-size: 14px; line-height: 1.5;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink-soft);
}
.alert-info {
  background: color-mix(in oklch, var(--accent) 8%, var(--bg));
  border-color: color-mix(in oklch, var(--accent) 28%, var(--line)); color: var(--ink);
}
.alert-success {
  background: color-mix(in oklch, #2e9e5b 12%, var(--bg));
  border-color: color-mix(in oklch, #2e9e5b 30%, var(--line)); color: #1c7a45;
}
.alert-danger, .alert-warning {
  background: color-mix(in oklch, var(--sale) 12%, var(--bg));
  border-color: color-mix(in oklch, var(--sale) 30%, var(--line)); color: var(--sale);
}

/* ---------- Modal (Bootstrap-like, ouvert par le JS PrestaShop) ---------- */
.modal { display: none; position: fixed; inset: 0; z-index: 1050; overflow-x: hidden; overflow-y: auto; }
.modal.in, .modal.show { display: block; }
body.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 1040; background: oklch(0.15 0.01 65 / .5); }
.modal-backdrop.in, .modal-backdrop.show { opacity: 1; }
.modal-dialog { position: relative; width: min(92vw, 720px); margin: 6vh auto; }
.modal-content { background: var(--bg); border-radius: 4px; box-shadow: var(--shadow-lift); overflow: hidden; }

/* ---------- Header "centered" (header2) : une seule recherche ----------
   header2 a une recherche dédiée à gauche (.js-search-toggle) ; on masque l'icône
   recherche dupliquée rendue par displayNav2 à droite. (Placé ici, dans compat.css
   servi en direct, pour éviter la régénération du CSS combiné CCC.) L'overlay reste
   ouvrable par le bouton gauche (theme.js écoute aussi .js-search-toggle). */
.mrd-header[data-style="centered"] .mrd-header-row #search_widget { display: none; }

/* champ de recherche compact (header2, à gauche) : ressemble à un input, mais le
   clic ouvre l'overlay de recherche. Couleur via currentColor → s'adapte au header
   (foncé sur fond clair, blanc sur header transparent au-dessus du hero). */
.mrd-search-mini {
  display: inline-flex; align-items: center; gap: 9px;
  width: clamp(150px, 17vw, 220px);
  padding: 8px 2px; margin: 0;
  background: none; border: 0; border-bottom: 1px solid currentColor;
  color: inherit; cursor: pointer; text-align: left; opacity: .7;
  transition: opacity .3s var(--ease);
}
.mrd-search-mini:hover { opacity: 1; }
.mrd-search-mini svg { flex-shrink: 0; }
.mrd-search-mini span {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: inherit;
}


