:root {
  --primary: #ff6b1a;
  --primary-dark: #e55a0c;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1d2330;
  --muted: #6b7280;
  --border: #e3e6eb;
  --wa: #25d366;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: #1d2330; color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 30px; }
.brand h1 { margin: 0; font-size: 20px; }
.brand p { margin: 0; font-size: 13px; color: #b8c0cc; }
.btn-wa-sm {
  background: var(--wa); color: #fff; text-decoration: none;
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px;
}

.layout { flex: 1; display: grid; grid-template-columns: 420px 1fr; min-height: 0; }
.panel { overflow-y: auto; padding: 20px; background: var(--card); border-right: 1px solid var(--border); }
.panel h2 { margin: 0 0 16px; }
.map-wrap { position: relative; }
#map { position: absolute; inset: 0; }
.map-status {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: #1d2330; color: #fff; padding: 8px 16px; border-radius: 999px;
  z-index: 1000; font-size: 14px;
}

.step { display: flex; gap: 12px; margin-bottom: 18px; }
.step-num {
  flex: 0 0 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 700;
  display: grid; place-items: center; font-size: 14px;
}
.step-body { flex: 1; min-width: 0; }
label { display: block; font-size: 13px; font-weight: 600; margin: 8px 0 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; font: inherit;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

.search { position: relative; }
.suggestions {
  position: absolute; z-index: 2000; left: 0; right: 0; top: 100%;
  list-style: none; margin: 4px 0 0; padding: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 240px; overflow-y: auto;
}
.suggestions:empty { display: none; }
.suggestions li { padding: 10px 12px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--border); }
.suggestions li:last-child { border-bottom: none; }
.suggestions li:hover { background: #fff4ec; }

.vehiculos { display: grid; gap: 8px; }
.vehiculo {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 2px solid var(--border); border-radius: 12px; cursor: pointer; background: #fff;
  text-align: left; font: inherit; color: inherit;
}
.vehiculo.active { border-color: var(--primary); background: #fff4ec; }
.vehiculo .ico { font-size: 28px; }
.vehiculo .info { flex: 1; }
.vehiculo strong { display: block; }
.vehiculo small { color: var(--muted); }
.vehiculo .desde { font-size: 12px; color: var(--muted); white-space: nowrap; }

.cotizacion { background: #1d2330; color: #fff; border-radius: var(--radius); padding: 16px; }
.cot-empty { color: #b8c0cc; text-align: center; padding: 10px; }
.cot-route { display: flex; gap: 16px; margin-bottom: 12px; }
.cot-route div { flex: 1; background: rgba(255,255,255,.07); padding: 10px; border-radius: 10px; }
.cot-route .muted { display: block; font-size: 12px; color: #b8c0cc; }
.cot-route strong { font-size: 18px; }
.desglose { list-style: none; padding: 0; margin: 0 0 10px; font-size: 14px; }
.desglose li { display: flex; justify-content: space-between; padding: 4px 0; color: #d6dbe3; }
.total {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px solid rgba(255,255,255,.15); padding-top: 10px; margin-bottom: 12px;
}
.total strong { font-size: 26px; color: var(--primary); }

.btn-primary, .btn-wa {
  width: 100%; border: none; border-radius: 12px; padding: 14px;
  font: inherit; font-weight: 700; font-size: 16px; color: #fff; cursor: pointer;
}
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-wa { background: var(--wa); margin-top: 14px; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 3000;
  display: grid; place-items: center; padding: 16px;
}
.modal-card {
  position: relative; background: #fff; border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
}
.modal-card h2 { margin-top: 0; }
.close { position: absolute; top: 10px; right: 14px; border: none; background: none; font-size: 28px; cursor: pointer; color: var(--muted); }
.resumen { background: var(--bg); border-radius: 10px; padding: 12px; margin-top: 12px; font-size: 13px; line-height: 1.5; }

.hidden { display: none !important; }

.pin { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: 45vh auto; }
  .map-wrap { order: -1; min-height: 45vh; }
  .panel { border-right: none; }
}

.btn-reset{margin-top:8px;background:none;border:1px solid #d1d5db;border-radius:8px;padding:6px 12px;cursor:pointer;font-size:.9rem;color:#374151}
.btn-reset:hover{background:#f3f4f6}
.btn-reset.hidden{display:none}

.btn-cotizar{width:100%;margin:6px 0 14px;font-size:1.05rem}
.cot-alerta{color:#b45309;font-weight:600}

/* ===== Ajustes responsive (2026-11-22) ===== */
html, body { height: auto; }
body { min-height: 100vh; min-height: 100dvh; }
input, select, textarea { font-size: 16px; min-width: 0; -webkit-appearance: none; appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%), linear-gradient(135deg, #6b7280 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input[type="datetime-local"] { min-height: 44px; }
button, a, .vehiculo { -webkit-tap-highlight-color: transparent; }

/* Escritorio: pantalla completa, mapa fijo y panel con scroll propio */
@media (min-width: 861px) {
  html, body { height: 100%; overflow: hidden; }
  .layout { grid-template-columns: clamp(360px, 32vw, 460px) 1fr; }
  .panel { padding: 24px; }
  .topbar { padding: 12px 28px; }
}

/* Tablet y celular: una sola columna, scroll normal de página */
@media (max-width: 860px) {
  .layout { display: flex; flex-direction: column; }
  .map-wrap { order: -1; height: 42vh; height: 42dvh; min-height: 260px; max-height: 420px; flex: none; }
  .panel { overflow: visible; padding: 18px 16px 24px; border-right: none; border-radius: 18px 18px 0 0; margin-top: -14px; position: relative; z-index: 500; box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
  .panel h2 { font-size: 20px; }
  .topbar { padding: 10px 16px; position: sticky; top: 0; z-index: 1500; }
  .brand h1 { font-size: 18px; }
  .logo { font-size: 26px; }
  .btn-cotizar { position: sticky; bottom: 10px; z-index: 600; box-shadow: 0 6px 18px rgba(255,107,26,.35); }
}

@media (max-width: 480px) {
  .brand p { display: none; }
  .btn-wa-sm { padding: 7px 12px; font-size: 13px; }
  .grid2 { grid-template-columns: 1fr; }
  .step { gap: 10px; }
  .step-num { flex-basis: 26px; height: 26px; font-size: 13px; }
  .vehiculo { padding: 10px; gap: 10px; }
  .vehiculo .ico { font-size: 24px; }
  .vehiculo .desde { font-size: 11px; white-space: normal; text-align: right; max-width: 70px; }
  .cot-route { gap: 8px; }
  .cot-route strong { font-size: 16px; }
  .desglose li { gap: 10px; }
  .desglose li span:last-child { white-space: nowrap; }
  .total strong { font-size: 22px; }
  .modal { padding: 0; place-items: end center; }
  .modal-card { border-radius: 18px 18px 0 0; max-height: 92dvh; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); }
}
