/* Box Design 97 - Self-stockage
   Charte : bleu #17318f, anthracite #383839, vert réservé au bouton de demande (devis), police Figtree.
   Couleurs reprises des variables du thème boxdesign97 quand elles existent. */

.bd97stk {
  --stk-blue: var(--bd97-blue, #17318f);
  --stk-blue-dark: var(--bd97-blue-dark, #0f2464);
  --stk-navy: var(--v6-navy, #003366);
  --stk-dark: var(--bd97-dark, #383839);
  --stk-text: var(--bd97-text, #2b2f3a);
  --stk-muted: #5d6475;
  --stk-line: var(--v6-line, #dde3ee);
  --stk-soft: #f4f6fb;
  --stk-blue-soft: #eaf0ff;
  --stk-red: #c62828;
  --stk-green-grad: var(--v6-green-grad, linear-gradient(180deg, #70c80e 0%, #56ae06 45%, #429700 100%));
  --stk-green-grad-hover: var(--v6-green-grad-hover, linear-gradient(180deg, #5fb80a 0%, #4a9d04 45%, #377f00 100%));
  --stk-font: var(--bd97-font, "Figtree", "Helvetica Neue", Arial, sans-serif);
  font-family: var(--stk-font);
  color: var(--stk-text);
  text-align: left;
  padding: 28px 0 24px;
  scroll-margin-top: 90px;
}
.bd97stk *, .bd97stk *::before, .bd97stk *::after { box-sizing: border-box; }
.bd97stk [hidden] { display: none !important; }
.bd97stk label, .bd97stk legend, .bd97stk p, .bd97stk h2, .bd97stk h3 { text-align: inherit; }

.bd97stk-shell {
  background: #fff;
  border: 1px solid var(--stk-line);
  border-radius: 14px;
  padding: 30px 32px 32px;
  box-shadow: 0 10px 30px rgba(15, 36, 100, .06);
  position: relative;
  overflow: hidden;
}
.bd97stk-shell::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, var(--stk-blue) 0%, var(--stk-navy) 100%);
}

/* ---------- En-tête ---------- */
.bd97stk-head { max-width: 760px; margin-bottom: 22px; }
.bd97stk-eyebrow {
  display: flex; align-items: center; gap: 10px; margin: 0 0 6px;
  font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--stk-blue);
}
.bd97stk-dash { width: 26px; height: 3px; border-radius: 2px; background: var(--stk-blue); display: inline-block; }
.bd97stk h2 {
  margin: 0 0 8px; font-family: var(--stk-font); font-weight: 800; color: var(--stk-navy);
  font-size: clamp(24px, 2.6vw, 34px); line-height: 1.15; letter-spacing: -.01em; text-transform: none;
}
.bd97stk-dot { color: var(--stk-blue); }
.bd97stk-lead { margin: 0; font-size: 16px; line-height: 1.55; color: var(--stk-muted); }

/* ---------- Grille ---------- */
.bd97stk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 30px; align-items: start; }

/* ---------- Photos ---------- */
.bd97stk-main { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--stk-soft); aspect-ratio: 4 / 3; }
.bd97stk-main picture, .bd97stk-main img { display: block; width: 100%; height: 100%; }
.bd97stk-main img { object-fit: cover; transition: opacity .25s; }
.bd97stk-main img.is-loading { opacity: .35; }
.bd97stk-badge {
  position: absolute; left: 12px; bottom: 12px; right: 12px; width: max-content; max-width: calc(100% - 24px);
  background: rgba(0, 31, 77, .82); color: #fff; font-size: 13px; font-weight: 700;
  padding: 7px 12px; border-radius: 6px; backdrop-filter: blur(4px);
}
.bd97stk-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.bd97stk-thumb {
  padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer;
  background: var(--stk-soft); aspect-ratio: 4 / 3; transition: border-color .15s, transform .15s;
}
.bd97stk-thumb picture, .bd97stk-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bd97stk-thumb:hover { transform: translateY(-1px); }
.bd97stk-thumb.is-active { border-color: var(--stk-blue); }
.bd97stk-thumb:focus-visible { outline: 3px solid #91b4ff; outline-offset: 2px; }

/* ---------- Atouts ---------- */
.bd97stk-perks { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.bd97stk-perks li { display: flex; gap: 11px; align-items: flex-start; font-size: 14px; line-height: 1.4; color: var(--stk-muted); }
.bd97stk-perks strong { display: block; color: var(--stk-dark); font-size: 15px; font-weight: 800; margin-bottom: 1px; }
.bd97stk-ico {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center;
  background: var(--stk-blue-soft); color: var(--stk-blue);
}
.bd97stk-ico svg { width: 21px; height: 21px; }

/* ---------- Carte formulaire ---------- */
.bd97stk-card {
  background: var(--stk-soft); border: 1px solid var(--stk-line); border-radius: 12px; padding: 22px 22px 20px;
}
.bd97stk-card-title { margin: 0; font-family: var(--stk-font); font-size: 21px; font-weight: 800; color: var(--stk-navy); text-transform: none; }
.bd97stk-card-sub { margin: 2px 0 14px; font-size: 14px; color: var(--stk-muted); font-weight: 600; }

.bd97stk-step { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.bd97stk-step legend {
  display: flex; align-items: center; gap: 9px; width: 100%; margin: 0 0 9px; padding: 0;
  font-size: 15.5px; font-weight: 800; color: var(--stk-dark); line-height: 1.3; float: none;
}
.bd97stk-num {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--stk-blue); color: #fff; font-size: 13px; font-weight: 800;
}

/* Territoire */
.bd97stk-terrs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bd97stk-pill, .bd97stk-size, .bd97stk-chip { position: relative; margin: 0; cursor: pointer; display: block; }
.bd97stk-pill input, .bd97stk-size input, .bd97stk-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.bd97stk-pill-box, .bd97stk-size-box {
  display: flex; flex-direction: column; justify-content: center; height: 100%;
  background: #fff; border: 1.5px solid var(--stk-line); border-radius: 9px; padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.bd97stk-pill-box strong { font-size: 16px; font-weight: 800; color: var(--stk-dark); }
.bd97stk-pill-box small { font-size: 12.5px; color: var(--stk-muted); font-weight: 600; }
.bd97stk-pill:hover .bd97stk-pill-box, .bd97stk-size:hover .bd97stk-size-box { border-color: #9fb0db; }
.bd97stk-pill input:checked + .bd97stk-pill-box, .bd97stk-size input:checked + .bd97stk-size-box {
  border-color: var(--stk-blue); background: var(--stk-blue-soft); box-shadow: inset 0 0 0 1px var(--stk-blue);
}
.bd97stk-pill input:focus-visible + .bd97stk-pill-box, .bd97stk-size input:focus-visible + .bd97stk-size-box,
.bd97stk-chip input:focus-visible + span { outline: 3px solid #91b4ff; outline-offset: 2px; }

/* Tailles */
.bd97stk-sizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bd97stk-size-box { padding: 10px 10px; justify-content: flex-start; }
.bd97stk-size-box strong { font-size: 15.5px; font-weight: 800; color: var(--stk-dark); }
.bd97stk-size-vol { font-size: 13px; font-weight: 800; color: var(--stk-blue); margin: 1px 0 3px; }
.bd97stk-size-box small { font-size: 12px; line-height: 1.3; color: var(--stk-muted); }
.bd97stk-size--help .bd97stk-size-box { border-style: dashed; }

/* Champs */
.bd97stk-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bd97stk-field { margin-bottom: 10px; min-width: 0; }
.bd97stk-field label { display: block; margin: 0 0 4px; font-size: 13.5px; font-weight: 700; color: var(--stk-dark); }
.bd97stk-field label small { font-weight: 500; color: var(--stk-muted); }
.bd97stk-field input, .bd97stk-field select, .bd97stk-field textarea {
  display: block; width: 100%; min-height: 46px; padding: 10px 12px; margin: 0;
  font: 500 15.5px/1.3 var(--stk-font); color: var(--stk-text);
  background: #fff; border: 1.5px solid var(--stk-line); border-radius: 8px; box-shadow: none;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.bd97stk-field select {
  padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2317318f' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.bd97stk-field textarea { min-height: 64px; resize: vertical; }
.bd97stk-field input:focus, .bd97stk-field select:focus, .bd97stk-field textarea:focus {
  outline: none; border-color: var(--stk-blue); box-shadow: 0 0 0 3px rgba(23, 49, 143, .15);
}
.bd97stk [aria-invalid="true"] { border-color: var(--stk-red) !important; }
.bd97stk-step.is-invalid .bd97stk-pill-box, .bd97stk-step.is-invalid .bd97stk-size-box { border-color: #e6a4a4; }

/* Particulier / Pro */
.bd97stk-profile { display: inline-flex; background: #fff; border: 1.5px solid var(--stk-line); border-radius: 999px; padding: 3px; margin-bottom: 10px; }
.bd97stk-chip span { display: block; padding: 6px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--stk-muted); transition: background-color .15s, color .15s; }
.bd97stk-chip input:checked + span { background: var(--stk-blue); color: #fff; }

/* Consentement, erreurs */
.bd97stk-consent { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 4px; font-size: 13px; line-height: 1.45; color: var(--stk-muted); cursor: pointer; font-weight: 500; }
.bd97stk-consent input { flex: 0 0 18px; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--stk-blue); }
.bd97stk-consent a { color: var(--stk-blue); text-decoration: underline; }
.bd97stk-err { margin: 5px 0 0; font-size: 13px; font-weight: 700; color: var(--stk-red); }
.bd97stk-alert { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: #fdecec; color: #8e1c1c; font-size: 14px; font-weight: 600; }
.bd97stk-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Bouton d'envoi : vert = demande / devis (charte) */
.bd97stk-submit {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 52px; margin-top: 12px; padding: 12px 20px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--stk-green-grad); color: #fff; font: 800 17px/1.2 var(--stk-font); letter-spacing: .01em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .18); box-shadow: 0 6px 16px rgba(66, 151, 0, .28);
  transition: background .15s, transform .1s, box-shadow .15s;
}
.bd97stk-submit:hover { background: var(--stk-green-grad-hover); }
.bd97stk-submit:active { transform: scale(.99); }
.bd97stk-submit:focus-visible { outline: 3px solid #91b4ff; outline-offset: 3px; }
.bd97stk-submit[disabled] { opacity: .75; cursor: progress; }
.bd97stk-spinner { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: bd97stk-spin .8s linear infinite; }
.bd97stk-submit.is-busy .bd97stk-spinner { display: inline-block; }
@keyframes bd97stk-spin { to { transform: rotate(360deg); } }
.bd97stk-alt { margin: 12px 0 0; text-align: center; font-size: 14px; color: var(--stk-muted); }
.bd97stk-alt a { color: var(--stk-blue); font-weight: 700; text-decoration: underline; }

/* ---------- Confirmation ---------- */
.bd97stk-done { text-align: center; padding: 18px 6px 6px; outline: none; }
.bd97stk-done-ico { width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--stk-blue); color: #fff; }
.bd97stk-done-ico svg { width: 32px; height: 32px; }
.bd97stk-done p { font-size: 15px; line-height: 1.5; color: var(--stk-muted); margin: 8px 0; }
.bd97stk-done-ref strong { color: var(--stk-navy); font-size: 17px; letter-spacing: .03em; }
.bd97stk-done-sum { font-weight: 700; color: var(--stk-dark) !important; }
.bd97stk-done-sum:empty { display: none; }
.bd97stk-done-contact { margin: 16px 0 6px; padding-top: 14px; border-top: 1px solid var(--stk-line); text-align: left; }
.bd97stk-done-small { font-size: 13.5px !important; font-weight: 700; text-align: center; }
.bd97stk-done .bd97c-inline-name { display: none; }
.bd97stk-again {
  margin-top: 10px; background: none; border: 0; padding: 6px; cursor: pointer;
  font: 700 14px var(--stk-font); color: var(--stk-blue); text-decoration: underline;
}


/* =================== Format réduit (bandeau + fenêtre) =================== */
.bd97stk--compact { padding: 18px 0 14px; }
.bd97stk-banner {
  display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: stretch;
  background: #fff; border: 1px solid var(--stk-line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 36, 100, .06); position: relative;
}
.bd97stk-banner::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; z-index: 1;
  background: linear-gradient(180deg, var(--stk-blue) 0%, var(--stk-navy) 100%);
}
.bd97stk-banner-img { position: relative; min-height: 220px; background: var(--stk-soft); }
.bd97stk-banner-img picture, .bd97stk-banner-img img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bd97stk-banner-img img { object-fit: cover; }
.bd97stk-banner-count {
  position: absolute; right: 10px; bottom: 10px; z-index: 1;
  background: rgba(0, 31, 77, .8); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 6px;
}
.bd97stk-banner-body { padding: 20px 26px 18px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.bd97stk-banner-body h2 { font-size: clamp(21px, 2vw, 27px); margin-bottom: 4px; }
.bd97stk-banner-lead { margin: 0 0 10px; font-size: 15px; line-height: 1.45; color: var(--stk-muted); }
.bd97stk-chips { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.bd97stk-chips li {
  font-size: 13px; font-weight: 700; color: var(--stk-blue); background: var(--stk-blue-soft);
  padding: 5px 10px; border-radius: 999px; line-height: 1.2;
}
.bd97stk-banner-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.bd97stk-banner-cta .bd97stk-submit { width: auto; margin-top: 0; min-height: 48px; padding: 11px 24px; font-size: 16px; }
.bd97stk-banner-terr { font-size: 14px; color: var(--stk-muted); display: inline-flex; gap: 8px; align-items: center; }
.bd97stk-linkbtn {
  background: none; border: 0; padding: 4px 2px; cursor: pointer;
  font: 700 14.5px var(--stk-font); color: var(--stk-blue); text-decoration: underline; text-underline-offset: 3px;
}
.bd97stk-linkbtn:focus-visible { outline: 3px solid #91b4ff; outline-offset: 2px; border-radius: 4px; }
.bd97stk-banner-note { margin: 8px 0 0; font-size: 12.5px; color: var(--stk-muted); }

/* Fenêtre */
.bd97stk-modal, .bd97stk.bd97stk-modal { position: fixed; inset: 0; z-index: 10045; display: flex; align-items: center; justify-content: center; padding: 24px; margin: 0; }
.bd97stk-modal-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .55); animation: bd97stk-fade .2s ease; }
.bd97stk-modal-box {
  position: relative; width: min(1120px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column; background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3); outline: none; animation: bd97stk-pop .22s ease;
}
.bd97stk-modal-head { position: relative; padding: 16px 64px 12px 26px; border-bottom: 1px solid var(--stk-line); flex: 0 0 auto; }
.bd97stk-modal-head .bd97stk-eyebrow { margin-bottom: 2px; font-size: 12px; }
.bd97stk-modal-title { margin: 0; font-size: 22px; font-weight: 800; color: var(--stk-navy); line-height: 1.2; }
.bd97stk-close {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--stk-soft); color: var(--stk-dark); cursor: pointer; display: grid; place-items: center;
}
.bd97stk-close:hover { background: var(--stk-blue-soft); color: var(--stk-blue); }
.bd97stk-close:focus-visible { outline: 3px solid #91b4ff; outline-offset: 2px; }
.bd97stk-close svg { width: 22px; height: 22px; }
.bd97stk-modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 22px 26px 26px; }
html.bd97stk-lock, html.bd97stk-lock body { overflow: hidden !important; }
@keyframes bd97stk-fade { from { opacity: 0; } }
@keyframes bd97stk-pop { from { opacity: 0; transform: translateY(12px) scale(.985); } }

@media (max-width: 767px) {
  .bd97stk-banner { grid-template-columns: minmax(0, 1fr); }
  .bd97stk-banner-img { min-height: 0; aspect-ratio: 16 / 9; }
  .bd97stk-banner-body { padding: 16px 16px 16px 20px; }
  .bd97stk-banner-cta .bd97stk-submit { width: 100%; }
  .bd97stk-banner-terr { width: 100%; justify-content: center; }
  .bd97stk-banner-note { text-align: center; }
  .bd97stk-modal, .bd97stk.bd97stk-modal { padding: 0; align-items: stretch; }
  .bd97stk-banner-img { aspect-ratio: 2 / 1; }
  .bd97stk-chips li:nth-child(n+3), .bd97stk-banner-note { display: none; }
  .bd97stk-banner-lead { font-size: 14.5px; margin-bottom: 8px; }
  .bd97stk-modal-box { width: 100%; max-height: none; height: 100%; border-radius: 0; }
  .bd97stk-modal-head { padding: 12px 60px 10px 16px; }
  .bd97stk-modal-title { font-size: 19px; }
  .bd97stk-close { top: 8px; right: 8px; }
  .bd97stk-modal-body { padding: 14px 14px 24px; }
  /* Dans la fenêtre sur mobile : formulaire d'abord, photos ensuite */
  .bd97stk-modal .bd97stk-card { order: -1; margin: 0; }
  .bd97stk-modal .bd97stk-perks { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .bd97stk-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .bd97stk-media { order: 0; }
  .bd97stk-sizes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
  .bd97stk { padding: 18px 0 16px; }
  .bd97stk-shell { padding: 20px 16px 18px; border-radius: 12px; }
  .bd97stk-shell::before { width: 4px; }
  .bd97stk-card { padding: 16px 14px; margin: 0 -4px; }
  .bd97stk-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .bd97stk-perks { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .bd97stk-thumbs { gap: 6px; }
  .bd97stk-badge { font-size: 12px; }
  .bd97stk-lead { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .bd97stk *, .bd97stk *::before, .bd97stk *::after { transition: none !important; animation: none !important; }
}
