/* ================================================================
   quote-wizard.css — Modal de cotización (servicios → vehículo → contacto)
   Lo usan index.html y proteccion-esencial.html junto con js/quote-wizard.js.
   ================================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 18px;
  padding: 2.5rem;
  max-width: 500px;
  width: 100%;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overflow-x: hidden; /* el slide entra desde el costado: sin esto aparece scroll horizontal */
  overscroll-behavior: contain;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
}
/* Transición entre pasos tipo carrusel (la dispara js/quote-wizard.js).
   Avanzar: se desplaza de derecha a izquierda. Volver: de izquierda a derecha.
   .qw-ghost es la copia del paso que sale. */
@keyframes qwInFromLeft  { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes qwInFromRight { from { transform: translateX(100%); }  to { transform: none; } }
@keyframes qwOutToRight  { from { transform: none; } to { transform: translateX(100%); } }
@keyframes qwOutToLeft   { from { transform: none; } to { transform: translateX(-100%); } }
@keyframes qwFade        { from { opacity: 0; } to { opacity: 1; } }
.qw-in-from-left  { animation: qwInFromLeft  0.38s cubic-bezier(0.65, 0, 0.35, 1) both; }
.qw-in-from-right { animation: qwInFromRight 0.38s cubic-bezier(0.65, 0, 0.35, 1) both; }
.qw-out-to-right  { animation: qwOutToRight  0.38s cubic-bezier(0.65, 0, 0.35, 1) both; }
.qw-out-to-left   { animation: qwOutToLeft   0.38s cubic-bezier(0.65, 0, 0.35, 1) both; }
.qw-fade          { animation: qwFade 0.25s ease both; }
.modal-box.qw-sliding { overflow-y: hidden; }
.modal-box.qw-resizing { transition: height 0.38s cubic-bezier(0.65, 0, 0.35, 1); overflow-y: hidden; }
@media (prefers-reduced-motion: reduce) {
  .qw-in-from-left, .qw-in-from-right, .qw-fade { animation: none; }
  .qw-ghost { display: none; }
  .modal-box.qw-resizing { transition: none; }
}

/* Variante en página (contacto.html): mismo formulario, sin overlay ni tarjeta flotante.
   El padding/margen de 4px evita que overflow:hidden recorte el foco de los campos. */
.quote-inline .modal-box {
  background: transparent;
  padding: 4px;
  margin: -4px;
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}
.quote-inline .wizard-steps { margin-right: 0; }
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(0,0,0,0.06);
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--color-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: rgba(0,0,0,0.12); color: var(--color-heading); }
.modal-box h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-heading);
  margin-bottom: 0.4rem;
  line-height: 1.1;
}
.modal-box > p { color: var(--color-muted); margin-bottom: 1.5rem; font-size: 0.95rem; }
.modal-checks { display: flex; flex-direction: column; gap: 10px; }
.modal-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  transition: border-color 0.2s, background 0.2s;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  user-select: none;
}
.modal-check-item:has(input:checked) {
  border-color: var(--color-primary);
  background: rgba(237,107,13,0.06);
}
.modal-check-item label { display: flex; align-items: center; gap: 12px; flex: 1; cursor: pointer; }
.modal-check-item input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  cursor: pointer;
}
.modal-check-label { flex: 1; cursor: pointer; }
.modal-help-btn {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--color-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.modal-help-btn:hover { background: var(--color-primary); color: #fff; }
.modal-check-included {
  opacity: 0.7;
  border-color: rgba(237,107,13,0.45) !important;
  background: rgba(237,107,13,0.04) !important;
}
.modal-check-included .modal-check-label::after {
  content: ' — incluido';
  color: var(--color-primary);
  font-size: 0.75em;
  font-weight: 600;
}
.modal-cta {
  width: 100%;
  margin-top: 1.75rem;
  font-size: 1rem;
}
/* Que `hidden` gane siempre dentro del modal, aunque el elemento tenga display propio */
#quoteWizard [hidden] { display: none !important; }
/* Paso 1a: recomendación vs. servicio específico */
.quote-choices { display: flex; flex-direction: column; gap: 12px; }
.quote-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 18px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--color-border);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.quote-choice:hover, .quote-choice:focus-visible {
  border-color: var(--color-primary);
  background: rgba(237,107,13,0.06);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(237,107,13,0.15);
  outline: none;
}
.quote-choice-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.quote-choice-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-heading);
  line-height: 1.15;
}
.quote-choice-desc { font-family: var(--font-body); font-size: 0.86rem; color: var(--color-muted); line-height: 1.45; }
.quote-choice-arrow { flex-shrink: 0; color: var(--color-primary); font-size: 1.2rem; font-weight: 700; }
/* Paso 1a-bis: tarjetas con selección múltiple */
.quote-choice--check input { position: absolute; opacity: 0; pointer-events: none; }
.quote-choice--check { position: relative; }
.quote-choice--check:has(input:focus-visible) { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.quote-choice--check:has(input:checked) {
  border-color: var(--color-primary);
  background: rgba(237,107,13,0.06);
}
.quote-choice-tag {
  align-self: flex-start;
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 2px;
}
.quote-choice-tag--dark { background: #111; }
/* Etiqueta informativa: orienta sin competir con "más contratado" / "tope de gama" */
.quote-choice-tag--soft { background: rgba(237,107,13,0.12); color: var(--color-primary); }
.quote-choice-price {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 2px;
}
.quote-choice-check {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.quote-choice--check:has(input:checked) .quote-choice-check {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.quote-choice--check:has(input:checked) .quote-choice-check::after {
  content: '';
  width: 14px; height: 14px;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.quote-choice--check.modal-check-included { cursor: default; transform: none !important; box-shadow: none !important; }
.quote-choice--check.modal-check-included .quote-choice-title::after {
  content: ' — incluido';
  color: var(--color-primary);
  font-size: 0.75em;
}
/* Tarjeta desplegable (Zonas Críticas): la lista de piezas cuelga de la tarjeta */
.quote-group { display: flex; flex-direction: column; }
.quote-group.is-open > .quote-choice { border-radius: 12px 12px 0 0; }
.quote-group.is-open > .quote-choice:hover { transform: none; box-shadow: none; }
/* La tarjeta se ve marcada solo con alguna pieza elegida, no por estar desplegada */
.quote-group:not(.has-selection) > .quote-choice--check:has(input:checked) { background: #fff; }
.quote-group:not(.has-selection) > .quote-choice--check:has(input:checked) .quote-choice-check { background: none; border-color: rgba(0,0,0,0.25); }
.quote-group:not(.has-selection) > .quote-choice--check:has(input:checked) .quote-choice-check::after { content: none; }
.quote-group.has-selection > .quote-choice--check { background: rgba(237,107,13,0.06); }
.quote-group.has-selection > .quote-choice--check .quote-choice-check { background: var(--color-primary); border-color: var(--color-primary); }
.quote-group.has-selection > .quote-choice--check .quote-choice-check::after {
  content: '';
  width: 14px; height: 14px;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.quote-sublist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
  border: 1.5px solid var(--color-primary);
  border-top: none;
  border-radius: 0 0 12px 12px;
  background: rgba(237,107,13,0.03);
  animation: qwFade 0.25s ease both;
}
.quote-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.quote-subitem:has(input:checked) { border-color: var(--color-primary); background: rgba(237,107,13,0.06); }
.quote-subitem input {
  width: 18px; height: 18px;
  margin: 0;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  cursor: pointer;
}
.quote-subitem-label {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-heading);
  line-height: 1.3;
}
.quote-subitem-price {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}
.quote-subitem.modal-check-included { cursor: default; }
.quote-subitem.modal-check-included input { cursor: default; }
.quote-subitem.modal-check-included .quote-subitem-label::after {
  content: ' — incluido en Combo Premium';
  color: var(--color-primary);
  font-size: 0.8em;
}
/* Wizard */
.wizard-steps {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 40px 1.25rem 0;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.wizard-step:not(:last-child)::after {
  content: '';
  width: 18px; height: 1.5px;
  background: var(--color-border);
  margin-left: 2px;
}
.wizard-step-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.wizard-step.is-active { color: var(--color-heading); }
.wizard-step.is-active .wizard-step-dot { border-color: var(--color-primary); color: var(--color-primary); }
.wizard-step.is-done .wizard-step-dot { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.wizard-recap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  margin-bottom: 1.25rem;
  border-radius: 10px;
  background: rgba(237,107,13,0.06);
  border: 1px solid rgba(237,107,13,0.25);
  font-size: 0.85rem;
}
.wizard-recap-title { font-weight: 600; color: var(--color-heading); margin-right: 2px; }
.wizard-chip {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  padding: 2px 10px;
  color: var(--color-text);
}
.wizard-recap-edit {
  margin-left: auto;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}
.wizard-actions { display: flex; gap: 10px; margin-top: 1.5rem; }
.wizard-actions .btn-outline { flex: 0 0 auto; cursor: pointer; }
.wizard-actions .btn-primary {
  flex: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.wizard-actions .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.phone-field { display: flex; align-items: stretch; }
.phone-prefix {
  display: flex; align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(0,0,0,0.18);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  background: rgba(0,0,0,0.04);
  color: var(--color-heading);
  font-weight: 600;
  white-space: nowrap;
}
.phone-field input { border-radius: 0 var(--radius) var(--radius) 0 !important; }
.form-group.has-error input, .form-group.has-error select { border-color: #d93025; }
.field-error { color: #d93025; font-size: 0.8rem; margin-top: 6px; }
/* styles.css quita la flecha nativa de los select; la reponemos dentro del modal */
#quoteWizard .form-group select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}
.quote-feedback {
  background: rgba(217,48,37,0.08);
  border: 1px solid rgba(217,48,37,0.3);
  color: #b3261e;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}
.quote-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--color-muted);
  cursor: pointer;
}
.quote-consent input { width: 18px; height: 18px; accent-color: var(--color-primary); flex-shrink: 0; margin-top: 1px; }
.quote-privacy { font-size: 0.78rem; color: var(--color-muted); margin-top: 1rem; text-align: center; }
.quote-privacy a { color: var(--color-muted); text-decoration: underline; }
.quote-toast {
  position: fixed;
  left: 50%; bottom: 28px;
  transform: translate(-50%, 20px);
  opacity: 0;
  z-index: 10000;
  background: #111;
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  font-size: 0.92rem;
  max-width: calc(100% - 32px);
  transition: opacity 0.3s, transform 0.3s;
}
.quote-toast.show { opacity: 1; transform: translate(-50%, 0); }
.quote-toast strong { color: var(--color-primary); margin-right: 4px; }
@media (max-width: 600px) {
  .modal-box { padding: 2rem 1.25rem 1.5rem; }
  .wizard-step-label { display: none; }
}
