/* ==========================================================
   Ibarra House Body Shop — cotizador.css
   Solo se carga en cotizar.html para no pesar en el resto del sitio.
   ========================================================== */

.ih-q-hero { padding: 10rem 0 3rem; margin-bottom: 1.5rem; }
.ih-q-hero .ih-lead { margin-top: 1rem; }
.ih-q-wrap { padding-bottom: clamp(3rem, 8vw, 6rem); }

.ih-q {
  display: grid;
  gap: var(--ih-gap);
  align-items: start;
}
@media (min-width: 1200px) { .ih-q { grid-template-columns: minmax(0, 1fr) 360px; } }

/* ---------- Pasos ---------- */
.ih-q__steps {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ih-q__steps li { display: grid; gap: .5rem; font-size: .875rem; color: var(--ih-text-3); }
.ih-q__steps li::before { content: ""; height: 4px; border-radius: 2px; background: var(--ih-n4); transition: background-color .4s ease; }
.ih-q__steps li.is-done::before, .ih-q__steps li.is-active::before { background: var(--ih-red); }
.ih-q__steps li.is-active { color: #fff; font-weight: 600; }
.ih-q__steps span { display: none; }
@media (min-width: 576px) { .ih-q__steps span { display: block; color: inherit; } }

/* ---------- Panel principal ---------- */
.ih-q__panel {
  border-radius: calc(var(--ih-radius) + 4px);
  background: var(--ih-n2);
  border: 1px solid rgba(255, 255, 255, .06);
  overflow: clip; /* clip (no hidden) para que la barra de navegación se quede fija al hacer scroll */
  min-width: 0;
}
.ih-q__body { padding: clamp(1.25rem, 3.5vw, 2.5rem); }
.ih-q__step { display: none; }
.ih-q__step.is-active { display: block; animation: ih-q-in .45s var(--ih-ease); }
@keyframes ih-q-in { from { opacity: 0; transform: translateY(14px); } }

.ih-q__block + .ih-q__block { margin-top: clamp(1.75rem, 4vw, 2.5rem); }
.ih-q__block[hidden] { display: none !important; }
.ih-q__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.ih-q__label h2, .ih-q__label h3 {
  font-family: var(--ih-font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.05;
  margin: 0;
}
.ih-q__hint { color: var(--ih-text-3); font-size: .9375rem; margin: -.5rem 0 1rem; }

/* ---------- Chips ---------- */
.ih-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.ih-chips--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.ih-chip {
  min-height: 48px;
  padding: .55rem .95rem;
  border-radius: 10px;
  border: 1px solid var(--ih-n5);
  background: var(--ih-n3);
  color: var(--ih-text);
  font: 500 1rem/1.15 var(--ih-font-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  text-align: center;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, transform .15s ease;
}
.ih-chip:hover { border-color: var(--ih-n6); }
.ih-chip:active { transform: scale(.97); }
.ih-chip[aria-pressed="true"] { background: var(--ih-red); border-color: var(--ih-red); color: #fff; }
.ih-chip .ih-i { width: 20px; height: 20px; }
.ih-chip--wide { grid-column: span 2; }

/* ---------- Marcas ---------- */
.ih-search {
  position: relative;
  margin-bottom: 1rem;
}
.ih-search input { padding-left: 2.75rem; }
.ih-search svg { position: absolute; left: 1rem; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--ih-text-3); }
.ih-brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .5rem; }
@media (min-width: 768px) { .ih-brands { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); } }
.ih-brand {
  aspect-ratio: 1.15;
  border-radius: 12px;
  border: 1px solid var(--ih-n5);
  background: var(--ih-n3);
  color: var(--ih-text);
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-items: center;
  padding: .7rem .5rem .6rem;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, transform .15s ease;
}
.ih-brand:hover { border-color: var(--ih-n6); }
.ih-brand:active { transform: scale(.97); }
.ih-brand img { width: 52px; height: 40px; object-fit: contain; filter: grayscale(1) brightness(2.2); opacity: .9; transition: filter .2s ease; }
.ih-brand.no-logo img { display: none; }
.ih-brand__mono {
  display: none;
  font-family: var(--ih-font-display);
  font-weight: 900;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ih-text-2);
}
.ih-brand.no-logo { aspect-ratio: auto; min-height: 58px; grid-template-rows: auto; padding: .5rem; }
.ih-brand.no-logo .ih-brand__name { font-family: var(--ih-font-display); font-weight: 700; font-size: 1.15rem; color: var(--ih-text); }
.ih-brand__name { font-size: .8125rem; color: var(--ih-text-2); text-align: center; line-height: 1.15; }
.ih-brand[aria-pressed="true"] { background: var(--ih-red); border-color: var(--ih-red); }
.ih-brand[aria-pressed="true"] img { filter: grayscale(1) brightness(10); }
.ih-brand[aria-pressed="true"] .ih-brand__name,
.ih-brand[aria-pressed="true"] .ih-brand__mono { color: #fff; }
.ih-q__sub { font-size: .9375rem; color: var(--ih-text-3); margin: 1.25rem 0 .6rem; }

/* ---------- Campos ---------- */
.ih-field { display: grid; gap: .45rem; }
.ih-field label, .ih-field .ih-field__label { font-weight: 600; font-size: .9875rem; }
.ih-field small { color: var(--ih-text-3); }
.ih-input,
.ih-q select,
.ih-q textarea {
  width: 100%;
  min-height: 54px;
  padding: .8rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--ih-n5);
  background: var(--ih-n1);
  color: #fff;
  font: 400 1.0625rem/1.3 var(--ih-font-body);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ih-q textarea { min-height: 110px; resize: vertical; }
.ih-input:focus, .ih-q select:focus, .ih-q textarea:focus { outline: none; border-color: var(--ih-red-hot); box-shadow: 0 0 0 3px rgba(222, 43, 65, .25); }
.ih-input::placeholder, .ih-q textarea::placeholder { color: var(--ih-text-3); }
.ih-input[aria-invalid="true"] { border-color: var(--ih-red-hot); }
.ih-err { color: var(--ih-red-hot); font-size: .9rem; min-height: 1.2em; }
.ih-fields { display: grid; gap: 1rem; }
@media (min-width: 768px) { .ih-fields--2 { grid-template-columns: 1fr 1fr; } }
.ih-cp-zone { color: var(--ih-ok); font-size: .9rem; min-height: 1.2em; }
.ih-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.ih-check { display: flex; gap: .75rem; align-items: flex-start; color: var(--ih-text-2); font-size: .9375rem; cursor: pointer; }
.ih-check input { width: 22px; height: 22px; margin-top: .1rem; accent-color: var(--ih-red); flex: none; }

/* ---------- Diagrama del auto ---------- */
.ih-damage { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .ih-damage { grid-template-columns: 260px minmax(0, 1fr); align-items: start; } }
.ih-diagram {
  position: relative;
  border-radius: 16px;
  background: var(--ih-carbon);
  background-color: #131315;
  background-size: 20px 20px;
  padding: 1.25rem .75rem;
  border: 1px solid rgba(255, 255, 255, .06);
  max-width: 300px;
  margin-inline: auto;
  width: 100%;
}
.ih-diagram svg { display: block; width: 100%; height: auto; }
.ih-z { fill: #2a2a2f; stroke: #5a5a62; stroke-width: 1.2; cursor: pointer; transition: fill .2s ease; }
.ih-z:hover { fill: #3a3a41; }
.ih-z.is-on { fill: var(--ih-red); stroke: #ff8a97; }
.ih-z-glass { fill: #0d0d0f; stroke: #3c3c44; stroke-width: 1; pointer-events: none; }
.ih-z-wheel { fill: #050505; stroke: #2b2b30; pointer-events: none; }
.ih-z-txt { fill: var(--ih-text-3); font: 600 11px var(--ih-font-body); pointer-events: none; }
.ih-views h3 { font: 600 .9375rem/1.2 var(--ih-font-body); color: var(--ih-text-2); margin: 1.1rem 0 .55rem; display: flex; align-items: center; gap: .5rem; }
.ih-views h3:first-child { margin-top: 0; }
.ih-views .ih-chip { min-height: 42px; font-size: .9375rem; padding: .45rem .8rem; }

/* ---------- Fotos ---------- */
.ih-tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1.25rem; }
.ih-tips div { padding: .9rem .75rem; border-radius: 12px; background: var(--ih-n3); font-size: .875rem; color: var(--ih-text-2); line-height: 1.3; }
.ih-tips strong { display: block; color: #fff; font-family: var(--ih-font-display); font-size: 1.15rem; margin-bottom: .2rem; }
.ih-drop {
  display: grid;
  place-items: center;
  gap: .75rem;
  text-align: center;
  padding: 2rem 1rem;
  border-radius: 16px;
  border: 1.5px dashed var(--ih-n6);
  background: rgba(255, 255, 255, .02);
  transition: border-color .2s ease, background-color .2s ease;
}
.ih-drop.is-over { border-color: var(--ih-red-hot); background: rgba(222, 43, 65, .08); }
.ih-drop .ih-badge { width: 56px; height: 56px; }
.ih-drop input[type="file"] { display: none; }
.ih-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-top: 1rem; }
.ih-photo { position: relative; border-radius: 12px; overflow: hidden; background: var(--ih-n3); border: 1px solid var(--ih-n5); }
.ih-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ih-photo select { min-height: 42px; border-radius: 0; border: 0; border-top: 1px solid var(--ih-n5); font-size: .9rem; padding: .5rem .6rem; background: var(--ih-n2); }
.ih-photo__rm {
  position: absolute; top: 6px; right: 6px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .7); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.ih-photo__rm .ih-i { width: 18px; height: 18px; }
.ih-photo__kb { position: absolute; left: 6px; top: 6px; padding: .15rem .45rem; border-radius: 6px; background: rgba(0, 0, 0, .7); font-size: .75rem; color: var(--ih-ok); }
.ih-photo.is-busy::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .55) linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .12) 50%, transparent 70%) 0 0 / 200% 100%; animation: ih-shimmer 1s linear infinite; }
@keyframes ih-shimmer { to { background-position: -200% 0; } }

/* ---------- Navegación del cotizador ---------- */
.ih-q__nav {
  position: sticky;
  bottom: calc(var(--ih-bar-h) + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  display: flex;
  gap: .5rem;
  padding: .75rem clamp(1rem, 3vw, 2.5rem);
  background: rgba(18, 18, 20, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, .06);
}
@media (min-width: 992px) { .ih-q__nav { bottom: 0; } }
.ih-q__nav .ih-btn { flex: 1; }
.ih-q__nav [data-back] { flex: 0 0 auto; }
.ih-q__nav [data-back][hidden] { display: none; }

/* ---------- Resumen en vivo ---------- */
.ih-q__sum {
  position: sticky;
  top: 96px;
  display: none;
  border-radius: calc(var(--ih-radius) + 4px);
  background: var(--ih-n3);
  border: 1px solid rgba(255, 255, 255, .06);
  padding: 1.5rem;
}
@media (min-width: 1200px) { .ih-q__sum { display: block; } }
.ih-q__sum h2 { font-family: var(--ih-font-display); font-weight: 800; font-size: 1.5rem; margin: 0 0 1rem; }
.ih-q__sum dl { margin: 0; display: grid; gap: .9rem; }
.ih-q__sum dt { font-size: .8125rem; color: var(--ih-text-3); font-weight: 500; }
.ih-q__sum dd { margin: .15rem 0 0; color: #fff; }
.ih-q__sum dd:empty::before { content: "Pendiente"; color: var(--ih-n6); }
.ih-q__sum hr { border-color: var(--ih-n5); opacity: 1; margin: 1.25rem 0; }

/* ---------- Envío y confirmación ---------- */
.ih-q__done { text-align: center; padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 4vw, 3rem); }
.ih-q__done .ih-badge { width: 76px; height: 76px; border-radius: 50%; margin-bottom: 1.5rem; }
.ih-q__done .ih-badge .ih-i { width: 38px; height: 38px; }
.ih-folio {
  display: inline-block;
  margin: 1rem 0 1.5rem;
  padding: .55rem 1rem;
  border-radius: 10px;
  background: var(--ih-n1);
  border: 1px solid var(--ih-n5);
  font-family: var(--ih-font-display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: .03em;
}
.ih-q__done .ih-actions { justify-content: center; }
.ih-progress { height: 6px; border-radius: 3px; background: var(--ih-n4); overflow: hidden; margin: 1.5rem auto 0; max-width: 420px; }
.ih-progress span { display: block; height: 100%; width: 0; background: var(--ih-red); transition: width .2s ease; }
.ih-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--ih-bar-h) + env(safe-area-inset-bottom, 0px) + 5.5rem);
  transform: translate(-50%, 20px);
  z-index: 1300;
  max-width: min(92vw, 460px);
  padding: .85rem 1.1rem;
  border-radius: 12px;
  background: #fff;
  color: #000;
  font-weight: 500;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s var(--ih-ease);
}
.ih-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 992px) { .ih-toast { bottom: 2rem; } }
