/* Jérôme-Pneus · fenêtre « Ça m'intéresse » (véhicule, jantes ou pack, capteurs) — mobile d'abord */

.ji-lock, .ji-lock body { overflow: hidden; }

.ji { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: flex-end; justify-content: center; }
.ji[hidden] { display: none; }
.ji__backdrop {
  position: absolute; inset: 0; background: rgba(10, 27, 51, .58); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity var(--t) var(--ease);
}
.ji__sheet {
  position: relative; width: 100%; max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px);
  background: var(--surface); color: var(--ink); border-radius: 24px 24px 0 0; box-shadow: var(--sh-lg);
  display: flex; flex-direction: column; transform: translateY(100%); transition: transform .34s var(--ease);
  font-family: var(--font-body);
}
.ji.is-open .ji__backdrop { opacity: 1; }
.ji.is-open .ji__sheet { transform: none; }
.ji__handle { width: 42px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 10px auto 0; flex: none; }

.ji__head { display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px 14px; border-bottom: 1px solid var(--border); flex: none; }
.ji__kicker { margin: 0 0 3px; font-family: var(--font-display); font-weight: 700; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--red-500); }
.ji__title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.3; color: var(--navy-800); overflow-wrap: anywhere; }
.ji__close {
  flex: none; width: 40px; height: 40px; margin: -4px -8px 0 auto; border: 0; border-radius: 50%; background: var(--steel-50); color: var(--navy-800);
  display: grid; place-items: center; cursor: pointer; transition: background var(--t-fast);
}
.ji__close:hover { background: var(--steel-100); }
.ji__close svg { width: 18px; height: 18px; }

.ji__body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 6px 20px 8px; flex: 1 1 auto; }
.ji__sec { padding: 16px 0 14px; border-bottom: 1px solid var(--border); }
.ji__sec:last-child { border-bottom: 0; }
.ji__h { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-family: var(--font-display); font-weight: 700; font-size: .98rem; color: var(--navy-800); }
.ji__num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--navy-800); color: #fff; font-size: .78rem; display: grid; place-items: center; }
.ji__h.is-done .ji__num { background: var(--green-500); }
.ji__h.is-done .ji__num svg { width: 14px; height: 14px; }

.ji__field { margin: 0 0 12px; }
.ji__field[hidden] { display: none; }
.ji__label { display: block; font-family: var(--font-display); font-weight: 600; font-size: .86rem; color: var(--navy-800); margin: 0 0 6px; }
.ji__label small { font-weight: 500; color: var(--muted); }
.ji__err { display: none; margin: 6px 0 0; font-size: .82rem; color: var(--red-600); }
.ji__field.is-error .ji__err { display: block; }
.ji__field.is-error .ji__input { border-color: var(--red-500); }

/* Liste à recherche directe (marque, modèle) */
.ji__combo { position: relative; }
.ji__input {
  width: 100%; min-height: 48px; padding: 12px 44px 12px 14px; font: inherit; font-size: 16px; /* 16px : pas de zoom iPhone */
  border: 1.5px solid var(--border-strong); border-radius: var(--r-sm); background: #fff; color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast); -webkit-appearance: none; appearance: none;
}
.ji__input:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 4px rgba(30, 58, 95, .1); }
.ji__input::placeholder { color: var(--muted-2); }
.ji__input:disabled { background: var(--steel-50); color: var(--muted); }
.ji__combo.is-set .ji__input { border-color: var(--navy-700); background: var(--steel-50); font-weight: 600; color: var(--navy-800); }
.ji__clear, .ji__caret {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent;
  color: var(--muted); display: grid; place-items: center; border-radius: 50%; cursor: pointer;
}
.ji__clear svg, .ji__caret svg { width: 18px; height: 18px; }
.ji__caret { pointer-events: none; }
.ji__combo.is-set .ji__caret, .ji__combo:not(.is-set) .ji__clear { display: none; }
.ji__clear:hover { background: var(--steel-100); color: var(--navy-800); }
.ji__list {
  list-style: none; margin: 6px 0 0; padding: 4px; max-height: 42vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  border: 1.5px solid var(--border); border-radius: var(--r-md); background: #fff; box-shadow: var(--sh-md);
}
.ji__list[hidden] { display: none; }
.ji__item {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 12px; border-radius: var(--r-sm); cursor: pointer;
  font-size: .95rem; color: var(--ink);
}
.ji__item b { font-weight: 700; color: var(--navy-800); }
.ji__item.is-active, .ji__item:hover { background: var(--steel-50); }
.ji__item--free { color: var(--navy-700); font-style: italic; border-top: 1px solid var(--border); border-radius: 0; margin-top: 4px; padding-top: 12px; }
.ji__item--empty { color: var(--muted); cursor: default; font-size: .88rem; }
.ji__item--empty:hover { background: transparent; }
.ji__loading { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; padding: 6px 2px 0; }
.ji__loading[hidden] { display: none; }
.ji__spin { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--navy-700); border-radius: 50%; animation: ji-spin .8s linear infinite; }
@keyframes ji-spin { to { transform: rotate(360deg); } }

/* Années et versions */
.ji__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ji__chip {
  min-height: 42px; padding: 0 14px; border: 1.5px solid var(--border-strong); border-radius: var(--r-pill); background: #fff; color: var(--navy-800);
  font-family: var(--font-display); font-weight: 600; font-size: .9rem; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.ji__chip:hover { border-color: var(--navy-700); }
.ji__chip[aria-pressed="true"] { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.ji__chip--more { color: var(--muted); border-style: dashed; }
.ji__opts { display: grid; gap: 8px; }
.ji__opt {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; text-align: left;
  border: 1.5px solid var(--border-strong); border-radius: var(--r-md); background: #fff; color: var(--ink); cursor: pointer; font: inherit;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.ji__opt:hover { border-color: var(--navy-700); }
.ji__opt[aria-checked="true"] { border-color: var(--navy-800); background: var(--steel-50); box-shadow: inset 0 0 0 1px var(--navy-800); }
.ji__opt__dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; }
.ji__opt[aria-checked="true"] .ji__opt__dot { border-color: var(--navy-800); }
.ji__opt[aria-checked="true"] .ji__opt__dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--navy-800); }
.ji__opt b { display: block; font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: var(--navy-800); }
.ji__opt small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }

/* Résumé véhicule mémorisé */
.ji__memo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--green-500); background: var(--green-soft); border-radius: var(--r-md); font-size: .92rem; color: var(--ink); }
.ji__memo[hidden] { display: none; }
.ji__memo svg { flex: none; width: 18px; height: 18px; color: var(--green-600); }
.ji__memo b { color: var(--navy-800); }
.ji__memo button { margin-left: auto; flex: none; border: 0; background: transparent; color: var(--navy-800); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 6px 2px; }

.ji__link { display: inline-block; margin: 2px 0 0; border: 0; background: transparent; padding: 6px 0; color: var(--muted); font: inherit; font-size: .86rem; text-decoration: underline; cursor: pointer; }
.ji__link:hover { color: var(--navy-800); }

/* Choix jantes / pack et capteurs */
.ji__seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ji__seg--3 { grid-template-columns: repeat(3, 1fr); }
.ji__seg button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 60px; padding: 10px 8px;
  border: 1.5px solid var(--border-strong); border-radius: var(--r-md); background: #fff; color: var(--navy-800); cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: .88rem; line-height: 1.2; text-align: center;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.ji__seg button svg { width: 24px; height: 24px; }
.ji__seg button:hover { border-color: var(--navy-700); }
.ji__seg button[aria-pressed="true"] { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.ji__seg--3 button { min-height: 48px; font-size: .84rem; padding: 8px 6px; }
.ji__hint { margin: 10px 0 0; font-size: .82rem; color: var(--muted); line-height: 1.45; }
.ji__hint b { color: var(--navy-800); font-weight: 600; }

/* Aperçu du message */
.ji__preview {
  margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--steel-50);
  font: inherit; font-size: .84rem; line-height: 1.5; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 170px; overflow-y: auto;
}

.ji__foot { flex: none; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: #fff; }
.ji__send { background: #25D366; border-color: #25D366; box-shadow: 0 10px 24px rgba(37, 211, 102, .32); min-height: 50px; font-size: .98rem; }
.ji__send:hover { background: #1da851; border-color: #1da851; }
.ji__skip { display: block; text-align: center; margin: 10px 0 0; font-size: .82rem; color: var(--muted); text-decoration: underline; }
.ji__skip:hover { color: var(--navy-800); }

/* Écran large : boîte centrée */
@media (min-width: 640px) {
  .ji { align-items: center; padding: 24px; }
  .ji__sheet {
    max-width: 560px; border-radius: 22px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
    opacity: 0; transform: translateY(14px) scale(.985); transition: transform .26s var(--ease), opacity .26s var(--ease);
  }
  .ji.is-open .ji__sheet { opacity: 1; transform: none; }
  .ji__handle { display: none; }
  .ji__head { padding-top: 22px; }
  .ji__body { padding: 6px 24px 8px; }
  .ji__foot { padding-left: 24px; padding-right: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .ji__backdrop, .ji__sheet { transition: none; }
}
