/* ════════════════════════════════════════════════════════════════════
   responsive-fixes.css — v13 (RESET COMPLET)
   Charge en dernier dans <head> via /assets/css/responsive-fixes.css
   ════════════════════════════════════════════════════════════════════ */

/* ─── Sécurités globales ─── */
html, body { max-width: 100vw; }
img, picture, svg, video, canvas, iframe { max-width: 100%; height: auto; }

/* overflow-x: hidden uniquement sur mobile (sinon casse position:sticky de la price col desktop) */
@media (max-width: 720px) {
  html, body { overflow-x: hidden; }
}

/* ════════════════════════════════════════════════════════════════════
   DESKTOP (≥721px) — Refonte sticky bar bas + sticky col droite
   ════════════════════════════════════════════════════════════════════ */
@media (min-width: 721px) {

  /* ─── Étape "Votre fichier" : Designer + Drop zone côte à côte (2 zones distinctes) ─── */
  .fp-design-step {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    gap: 16px !important;
  }
  .fp-design-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    width: 100% !important;
    align-items: stretch !important;
  }
  .fp-design-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    min-width: 0 !important;
    padding: 18px !important;
    background: var(--b-bg2, #f7f7f5);
    border: 1px solid var(--b-line, rgba(16,17,20,.08));
    border-radius: 14px;
    box-sizing: border-box;
  }
  .fp-design-col .btn-design-editor {
    width: 100% !important;
    justify-content: center !important;
  }
  .fp-design-col .fp-file-drop {
    width: 100% !important;
    min-height: 100% !important;
    flex: 1;
    background: #fff !important;
    border-style: dashed !important;
    margin: 0 !important;
  }

  /* Colonne droite (price card) : VRAIMENT sticky en haut */
  .fp-cfg-price-col {
    position: sticky !important;
    top: 88px !important;
    align-self: start !important; /* sinon l'item flex/grid s'étire et casse sticky */
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Body NE DOIT PAS avoir overflow-x:hidden sur desktop sinon position:sticky
     sur les enfants ne fonctionne pas. */
  body { overflow: visible !important; }

  /* Sticky bar bas : design premium horizontal, max-width centré */
  .fp-sticky-bar--always {
    background: rgba(255,255,255,.96) !important;
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid rgba(16,17,20,.08) !important;
    box-shadow: 0 -8px 28px -10px rgba(16,17,20,.12) !important;
  }
  .fp-sticky-bar--always .fp-sticky-bar-inner {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 12px 24px !important;
    gap: 16px !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Bloc prix gauche : "Prix unitaire HT 56,00 € · TTC 67,20 €" */
  .fp-sticky-bar--always .fp-sticky-price {
    display: flex !important;
    align-items: baseline !important;
    gap: 14px !important;
    flex-shrink: 0;
  }
  .fp-sticky-bar--always .fp-sticky-price .fp-mob-price-label {
    display: inline !important;
    font-family: var(--b-mono, monospace);
    font-size: 11px !important; font-weight: 700;
    color: var(--b-muted, #6b6f76);
    text-transform: uppercase; letter-spacing: .06em;
    margin: 0 !important;
  }
  .fp-sticky-bar--always .fp-mob-price-val {
    font-family: var(--b-font, sans-serif);
    font-size: 22px !important; font-weight: 900 !important;
    color: var(--b-ink, #101114) !important;
    letter-spacing: -.6px !important;
    line-height: 1 !important;
    white-space: nowrap;
  }
  .fp-sticky-bar--always .fp-mob-price-ttc {
    font-family: var(--b-mono, monospace);
    font-size: 12px !important;
    color: var(--b-muted, #6b6f76);
    font-weight: 600;
    margin-left: 4px;
    white-space: nowrap;
  }

  /* Total quand visible : séparateur vertical + valeur orange */
  .fp-sticky-bar--always .fp-sticky-total {
    display: flex !important;
    align-items: baseline !important;
    gap: 10px !important;
    padding-left: 18px !important;
    border-left: 1px solid var(--b-line, rgba(16,17,20,.08)) !important;
  }
  .fp-sticky-bar--always .fp-sticky-total .fp-mob-price-val {
    color: var(--b-orange, #FF6B1A) !important;
  }

  /* Bouton Détails caché desktop (la price card sidebar fait le job) */
  .fp-sticky-bar--always .fp-sticky-details-btn { display: none !important; }

  /* Bouton Configurateur — pousse les CTA à droite */
  .fp-sticky-bar--always .fp-sticky-cfg-btn {
    margin-left: auto;
    padding: 8px 14px !important;
    border-radius: 9px !important;
    font-size: 12.5px !important;
    height: 36px;
  }
  /* CTA Commander — compact desktop */
  .fp-sticky-bar--always .fp-mob-cta {
    padding: 8px 16px !important;
    height: 36px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border-radius: 9px !important;
    background: var(--b-orange, #FF6B1A) !important;
    box-shadow: 0 4px 12px rgba(255,107,26,.30) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px;
    flex-shrink: 0;
  }
  .fp-sticky-bar--always .fp-mob-cta svg {
    width: 14px !important; height: 14px !important;
  }
  .fp-sticky-bar--always .fp-mob-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(255,107,26,.40) !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   MOBILE ≤ 720px — fix complet pour la fiche produit
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 720px) {

  /* ─── ORDRE DOM NATUREL : header → galerie → config → reste
     L'ancien hack 'GALERIE en haut' via body flex column cassait l'ordre
     normal et faisait disparaître les étapes config. On garde le DOM order.
     ─── */

  /* ─── LAYOUT GLOBAL : full-width strict, plus de padding latéral global ─── */
  .fp-cfg-section,
  .fp-cfg-layout,
  .fp-cfg-steps-col {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  /* CRITICAL : .fp-variants-wrap a margin-right: 7em en desktop, vire sur mobile */
  .fp-variants-wrap,
  .fp-axis-group {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  /* Section title : padding 16×12 latéral (sinon collé au bord) */
  .fp-cfg-section-title {
    padding: 16px 12px !important;
  }
  /* Étapes : padding 12px latéral pour les textes */
  .fp-step {
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-bottom: 28px !important;
  }
  /* Body d'étape : pas de padding (les sliders ont besoin de tout l'espace) */
  .fp-step-bd {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  /* Headers axes, titres variants : padding 12px latéral pour pas être collés au bord */
  .fp-cfgaxis-header,
  .fp-variants-title,
  .fp-cfgaxis-desc,
  .fp-qty-manual,
  .fp-qty-manual-label,
  .fp-dim-field,
  .fp-format-fixed,
  .fp-source-toggle {
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* ─── SLIDERS : aux bords du viewport, peek 4% chaque côté ─── */
  .fp-axis-cards,
  .fp-vcards,
  .fp-cards-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    overflow-x: scroll !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x pan-y !important;
    scroll-snap-type: x mandatory !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    /* Padding : peek visible des cards adjacentes */
    padding: 8px 4% 12px 4% !important;
    box-sizing: border-box !important;
    scroll-padding-left: 4% !important;
    gap: 10px !important;
    scrollbar-width: none !important;
  }
  .fp-axis-cards::-webkit-scrollbar,
  .fp-vcards::-webkit-scrollbar,
  .fp-cards-grid::-webkit-scrollbar { display: none !important; }

  .fp-axis-cards > .fp-axis-card,
  .fp-axis-cards > button.fp-axis-card,
  .fp-vcards > .fp-vcard,
  .fp-vcards > button.fp-vcard,
  .fp-cards-grid > .fp-item-card,
  .fp-cards-grid > label.fp-item-card,
  .fp-cards-grid > div.fp-item-card {
    flex: 0 0 88% !important;
    -webkit-flex: 0 0 88% !important;
    flex-basis: 88% !important;
    width: 88% !important;
    max-width: 88% !important;
    min-width: 88% !important;
    margin: 0 !important;
    scroll-snap-align: center !important;
    box-sizing: border-box !important;
  }

  /* ─── ÉTAPES CONFIG : numéro + titre côte à côte, contenu pleine largeur en dessous ─── */
  .fp-step {
    display: block !important;
    padding-bottom: 28px !important;
    gap: 0 !important;
  }
  .fp-step-num-col {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: auto !important;
    margin-bottom: 14px !important;
    gap: 10px !important;
  }
  .fp-step-circle {
    width: 36px !important; height: 36px !important;
    font-size: 13px !important;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,82,204,.25) !important;
  }
  .fp-step-vline {
    display: none !important;
  }
  .fp-step-content {
    padding-left: 0 !important;
    padding-top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .fp-step-hd { margin-bottom: 14px !important; }
  .fp-step-title {
    font-size: 17px !important;
    letter-spacing: -.4px !important;
    margin: 0 !important;
  }
  .fp-step-sub {
    font-size: 13px !important;
    line-height: 1.5 !important;
    margin-top: 4px !important;
  }
  .fp-step-bd { max-width: none !important; }


  /* ─── PALIERS TARIFAIRES : virés sur mobile ─── */
  #cfg-qty-tiers,
  .fp-tiers-grid { display: none !important; }

  /* ─── SÉLECTEUR QUANTITÉ : full-width ─── */
  .fp-qty-selector {
    width: 100% !important;
    max-width: 100% !important;
    height: 52px !important;
    display: flex !important;
  }
  .fp-qty-btn {
    flex: 0 0 60px !important;
    width: 60px !important;
    font-size: 24px !important;
    min-height: 52px !important;
  }
  .fp-qty-input {
    flex: 1 1 auto !important;
    width: auto !important;
    font-size: 20px !important;
    text-align: center !important;
  }
  .fp-qty-manual > div[style*="flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  /* ─── STICKY BAR : 1 ligne stricte ─── */
  .fp-sticky-bar--always .fp-sticky-bar-inner {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 10px !important;
    overflow: hidden !important;
  }
  .fp-sticky-bar--always .fp-sticky-file,
  .fp-sticky-bar--always .fp-sticky-cfg-btn { display: none !important; }
  .fp-sticky-price, .fp-sticky-total {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    padding: 0 !important; border: 0 !important;
  }
  .fp-mob-price-label {
    font-size: 9px !important; line-height: 1 !important; margin: 0 !important;
    white-space: nowrap !important;
  }
  .fp-mob-price-val {
    font-size: 14px !important; line-height: 1.1 !important;
    font-weight: 800 !important; white-space: nowrap !important;
  }
  .fp-sticky-details-btn {
    display: inline-flex !important; align-items: center; gap: 4px;
    flex-shrink: 0;
    padding: 6px 9px !important; height: 34px !important; min-height: 34px !important;
    background: #f7f7f5; border: 1px solid rgba(16,17,20,.08); border-radius: 8px;
    font-size: 11px !important; font-weight: 700; color: #101114;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
  }
  .fp-sticky-details-btn svg { width: 12px !important; height: 12px !important; }
  .fp-mob-cta {
    flex-shrink: 0 !important;
    padding: 7px 12px !important;
    height: 34px !important; min-height: 34px !important;
    font-size: 12px !important; font-weight: 800 !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    display: inline-flex !important; align-items: center !important; gap: 4px !important;
  }
  .fp-mob-cta svg { width: 12px !important; height: 12px !important; }

  /* ─── ÉTAPE "Votre fichier de production" responsive ─── */
  .fp-source-toggle {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    width: 100% !important; max-width: 100% !important;
    padding: 4px !important;
  }
  .fp-source-btn {
    width: 100% !important;
    padding: 10px 8px !important;
    font-size: 12.5px !important;
    min-height: 44px !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1.2 !important;
    gap: 6px !important;
  }
  .fp-source-btn svg { width: 13px !important; height: 13px !important; }
  .fp-design-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
  }
  .fp-design-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 14px !important;
    background: var(--b-bg2, #f7f7f5);
    border: 1px solid var(--b-line, rgba(16,17,20,.08));
    border-radius: 12px;
    box-sizing: border-box;
  }
  .fp-design-col .btn-design-editor {
    width: 100% !important;
    justify-content: center !important;
  }
  .fp-design-col .fp-file-drop {
    background: #fff !important;
    margin: 0 !important;
  }
  .fp-design-step {
    max-width: 100% !important;
    width: 100% !important;
    gap: 14px !important;
  }
  .btn-design-editor {
    width: 100% !important;
    min-height: 52px !important;
    padding: 14px 16px !important;
    font-size: 15px !important;
    justify-content: center !important;
    border-radius: 12px !important;
  }
  .de-launch-features {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    justify-content: center !important;
  }
  .de-feature-chip { font-size: 11px !important; padding: 5px 10px !important; }
  .fp-file-drop {
    width: 100% !important; max-width: 100% !important;
    padding: 24px 16px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  /* ─── Anti-débordement général ─── */
  body, .fp-cfg-section, .fp-cfg-layout, .fp-step,
  .fp-step-content, .fp-step-bd, .fp-axis-group {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  /* Sauf les sliders eux-mêmes (sinon le scroll horizontal interne casse) */
  .fp-axis-cards, .fp-vcards, .fp-cards-grid {
    overflow-x: scroll !important;
    overflow-y: hidden !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   DRAWER "Détails de la config" — bottom-sheet via checkbox toggle
   POSITION FIXED — masqué par défaut, slide depuis le bas au click
   ═══════════════════════════════════════════════════════════════ */
.fp-details-toggle { position: absolute !important; opacity: 0 !important; pointer-events: none !important; }
.fp-drawer-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(16,17,20,.5);
  z-index: 98;
  cursor: pointer;
}
.fp-drawer {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -16px 48px rgba(16,17,20,.18);
  z-index: 99;
  max-height: 85vh;
  overflow-y: auto;
  /* padding-bottom suffisant pour que le CTA ne soit pas masqué par la
     sticky bar (~50px) en bas du viewport */
  padding: 8px 0 calc(70px + env(safe-area-inset-bottom));
  animation: fpDrawerSlide .3s cubic-bezier(.25,.46,.45,.94);
}
.fp-details-toggle:checked ~ .fp-drawer-backdrop,
.fp-details-toggle:checked ~ .fp-drawer { display: block; }
@keyframes fpDrawerSlide {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.fp-drawer__handle { width: 40px; height: 4px; background: rgba(16,17,20,.15); border-radius: 2px; margin: 4px auto 12px; }
.fp-drawer__hd {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; padding: 0 22px 16px;
  border-bottom: 1px solid rgba(16,17,20,.08);
}
.fp-drawer__title { font-family: var(--b-font, sans-serif); font-size: 18px; font-weight: 800; letter-spacing: -.5px; color: #101114; margin: 0; }
.fp-drawer__sub { font-family: var(--b-mono, monospace); font-size: 11px; color: #6b6f76; margin-top: 4px; letter-spacing: .02em; }
.fp-drawer__close {
  width: 36px; height: 36px; border-radius: 50%; background: #f7f7f5;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #6b6f76; cursor: pointer; flex-shrink: 0;
}
.fp-drawer__close:hover, .fp-drawer__close:active { background: #101114; color: #fff; }
.fp-drawer__body { padding: 18px 22px 0; }
.fp-drawer__price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.fp-drawer__price-cell { padding: 14px 16px; background: #f7f7f5; border-radius: 12px; }
.fp-drawer__price-lbl { font-family: var(--b-mono, monospace); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #6b6f76; margin-bottom: 6px; }
.fp-drawer__price-val { font-family: var(--b-font, sans-serif); font-size: 20px; font-weight: 800; letter-spacing: -.5px; color: #101114; line-height: 1.1; }
.fp-drawer__price-val--total { color: #FF6B1A; }
.fp-drawer__price-tax { font-size: 11px; font-weight: 700; color: #6b6f76; letter-spacing: .04em; }
.fp-drawer__price-sub {
  margin-top: 6px;
  font-family: var(--b-mono, monospace);
  font-size: 10.5px; font-weight: 600;
  color: #6b6f76; line-height: 1.3;
}
.fp-drawer__recap { display: flex; flex-direction: column; margin-bottom: 16px; }
.fp-drawer__recap:empty { display: none; }
.fp-drawer__recap-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(16,17,20,.08); gap: 12px; }
.fp-drawer__recap-row:last-child { border-bottom: 0; }
.fp-drawer__recap-k { font-family: var(--b-mono, monospace); font-size: 11px; font-weight: 700; text-transform: uppercase; color: #6b6f76; }
.fp-drawer__recap-v { font-family: var(--b-font, sans-serif); font-size: 14px; font-weight: 600; color: #101114; text-align: right; }
.fp-drawer__file { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: #e8eeff; border-radius: 10px; margin-bottom: 16px; }
.fp-drawer__file-lbl { font-family: var(--b-mono, monospace); font-size: 10px; font-weight: 700; color: #0040DD; text-transform: uppercase; }
.fp-drawer__file-name { font-size: 12px; font-weight: 600; color: #101114; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
/* ─── Speed buttons dans le drawer (Standard/Express/Urgent) ─── */
.fp-drawer__speed-wrap { margin-bottom: 16px; }
.fp-drawer__speed-label {
  font-family: var(--b-mono, monospace);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: #6b6f76; margin-bottom: 10px;
}
.fp-drawer__speed-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
}
.fp-drawer__speed-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding: 10px 8px;
  background: #f7f7f5;
  border: 1.5px solid rgba(16,17,20,.08);
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--b-font, sans-serif);
  -webkit-tap-highlight-color: transparent;
  transition: all .15s;
  min-height: 56px;
}
.fp-drawer__speed-name {
  font-size: 12px; font-weight: 800; color: #101114;
  letter-spacing: -.2px;
}
.fp-drawer__speed-time {
  font-size: 10px; font-weight: 600; color: #6b6f76;
  font-family: var(--b-mono, monospace);
}
.fp-drawer__speed-btn.is-active {
  background: #0040DD;
  border-color: #0040DD;
  box-shadow: 0 6px 18px rgba(0,64,221,.3);
}
.fp-drawer__speed-btn.is-active .fp-drawer__speed-name,
.fp-drawer__speed-btn.is-active .fp-drawer__speed-time {
  color: #fff;
}

.fp-drawer__cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px;
  background: #FF6B1A; color: #fff;
  border: 0; border-radius: 14px;
  font-family: var(--b-font, sans-serif); font-size: 16px; font-weight: 800;
  cursor: pointer; box-shadow: 0 8px 24px rgba(255,107,26,.4);
  min-height: 52px;
}
.fp-drawer__cta:hover, .fp-drawer__cta:active { opacity: .9; }

/* Desktop : drawer + bouton détails cachés (price card sidebar gère) */
@media (min-width: 721px) {
  .fp-drawer, .fp-drawer-backdrop, .fp-sticky-details-btn { display: none !important; }
}

/* ─── Cache "Votre sélection" (recap inline sous chaque axe) ─── */
.fp-cfgaxis-desc,
#cfg-variant-desc {
  display: none !important;
}

/* ─── Barre mobile : prix HT + TTC compacts ─── */
@media (max-width: 720px) {
  .fp-sticky-bar--always .fp-mob-price-val {
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    color: var(--b-ink, #101114);
    white-space: nowrap;
  }
  .fp-mob-price-ttc {
    font-size: 10.5px !important;
    color: var(--b-muted, #6b6f76);
    font-weight: 600;
    line-height: 1.1;
    margin-top: 2px;
    white-space: nowrap;
  }
  /* Cache "Total HT" de la sticky bar — on garde uniquement prix unitaire HT+TTC */
  .fp-sticky-bar--always .fp-sticky-total {
    display: none !important;
  }
}

/* ─── ≤420px : ajustements mineurs ─── */
@media (max-width: 420px) {
  .fp-qty-btn { width: 54px !important; font-size: 22px !important; }
  .fp-source-btn svg { display: none !important; }
}
