/* Envíos Pronto — mini-app landing (mobile first) */
:root {
  --brand:        #F2A057;
  --brand-strong: #D9691F;
  --brand-dark:   #C45E1A;
  --brand-bg:     #FFF7F0;
  --brand-mid:    #FFE4C8;
  --brand-grad:   linear-gradient(135deg, #FB9E50, #FF4F7B);

  --bg:     #FAFAFA;
  --card:   #FFFFFF;
  --hover:  #F3F2EF;
  --tx:     #0A0A0A;
  --tx-2:   #3D3D3D;
  --muted:  #6B6B6B;
  --faint:  #C2C2C2;
  --border: #E4E2DC;

  --ok:      #16A34A;
  --ok-bg:   #F0FDF4;
  --bad:     #DC2626;
  --bad-bg:  #FEF2F2;
  --info-bg: #EFF6FF;
  --info-tx: #1E3A8A;

  --chat-bg:   #EFEAE2;
  --chat-user: #FFE3CC;

  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.05);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.18);

  --head-h: 56px;
  --tab-h: 64px;
  --app-w: 480px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--tx);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ── Shell ─────────────────────────────── */
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: var(--app-w);
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
}

.topbar {
  flex: none;
  height: var(--head-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; }
.logo img { display: block; height: 30px; width: auto; }

.dots { display: flex; gap: 5px; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: all .2s; }
.dots span.is-on { width: 16px; border-radius: 3px; background: var(--brand); }

.track {
  position: relative;
  flex: 1;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }
.track:focus, .panel:focus { outline: none; }

/* Abajo deja lugar a la barra de tabs y a la burbuja de Sofi */
.panel {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 20px 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 88px);
}

/* ── Tab bar ───────────────────────────── */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}
.tab svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab.is-on { color: var(--brand-strong); font-weight: 700; }
.tab.is-on svg { stroke-width: 2.3; }

/* ── Tipografía ────────────────────────── */
.title {
  margin: 8px 0 6px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.03em;
}
.title-xl { font-size: 36px; }
.title-section { margin-top: 32px; }
.accent { color: var(--brand-strong); }
.lead { margin: 0 0 18px; font-size: 16px; color: var(--muted); }
.kicker { margin: 22px 0 10px; font-size: 14px; font-weight: 700; color: var(--tx-2); }
.fine { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }

.pill {
  display: inline-block;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--brand-bg);
  border: 1px solid var(--brand-mid);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-strong);
}

/* ── Botones ───────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  transition: transform .1s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; }
.btn.is-loading:disabled { opacity: 1; cursor: wait; }
.btn.is-loading::before {
  content: '';
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin .7s linear infinite;
}
.btn-primary { background: var(--brand-strong); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: var(--card); color: var(--brand-strong); border: 1.5px solid var(--brand-mid); }
.btn-ghost:hover { background: var(--brand-bg); }
.btn-block { display: flex; width: 100%; margin-top: 14px; }
.btn-lg { min-height: 56px; font-size: 17px; }
.btn-link {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--brand-strong);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Campos (cotizador, cobertura, formularios) ── */
.addr-row input, .field input, .cob-search input, .form input, .form select {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 13px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 16px;
}
.addr-row input:focus, .field input:focus, .cob-search input:focus, .form input:focus, .form select:focus {
  outline: none;
  border-color: var(--brand-strong);
}

/* ── Inicio (máx. dos pantallas) ───────── */
.hero { position: relative; padding-right: 104px; }
.hero-art {
  position: absolute;
  top: 44px;
  right: 0;
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--brand-mid), var(--brand-bg));
  font-size: 54px;
}
.hero-art span { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }

.price-hook {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--brand-grad);
  color: #fff;
}
.price-hook span { font-size: 15px; font-weight: 600; }
.price-hook b { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.price-hook small { margin-left: auto; font-size: 12.5px; line-height: 1.25; text-align: right; opacity: .95; }

.hero-ctas { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; margin-top: 10px; }

.perks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.perks li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--border);
}
.perks li > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.perk-ico { flex: none; font-size: 24px; line-height: 1; }
.perks b { font-size: 14px; line-height: 1.2; }
.perks small { font-size: 12px; color: var(--muted); line-height: 1.25; }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 14px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #2A2A2A;
}
.stats div { display: flex; flex-direction: column; padding: 14px; background: var(--tx); color: #fff; }
.stats b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--brand); }
.stats span { font-size: 12.5px; opacity: .8; }

.steps { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.step {
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--border);
}
.step-top { display: flex; align-items: center; gap: 12px; }
.step-top > span:last-child { display: flex; flex-direction: column; }
.step-top b { font-size: 16.5px; }
.step-top small { margin-top: 1px; font-size: 13.5px; color: var(--muted); }
.step-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 0 62px; padding: 0; list-style: none; }
.step-list li {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--tx-2);
}
.step-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--brand-bg);
  border: 1px solid var(--brand-mid);
  font-size: 13.5px;
  color: var(--tx-2);
}
.step-ico {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--brand-mid), var(--brand-bg));
  font-size: 26px;
}
.step-ico i {
  position: absolute;
  top: -3px;
  right: -3px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-strong);
  color: #fff;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}
.steps-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--brand-bg);
  color: var(--tx-2);
  font-size: 13px;
  line-height: 1.4;
}
.steps-note > span:first-child { flex: none; }

.row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--border);
  text-align: left;
}
.row-link-brand { background: var(--brand-bg); border-color: var(--brand-mid); }
.row-ico { font-size: 28px; line-height: 1; flex: none; }
.row-txt { flex: 1; display: flex; flex-direction: column; }
.row-txt b { font-size: 15.5px; }
.row-txt small { font-size: 13.5px; color: var(--muted); }
.chev { font-size: 24px; color: var(--faint); line-height: 1; transition: transform .2s; }

/* Tarjeta "siguiente paso" al final de cada sección */
.next-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 28px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--tx);
  color: #fff;
}
.next-card span { font-size: 15px; opacity: .85; }
.next-card b { font-size: 16px; color: var(--brand); white-space: nowrap; }
.next-card-cta { background: var(--brand-grad); }
.next-card-cta span { opacity: 1; font-weight: 600; }
.next-card-cta b { color: #fff; }

/* ── Precios: menú a los cotizadores ───── */
.quote-menu { display: flex; flex-direction: column; gap: 10px; }
.quote-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 2px solid var(--brand-mid);
  box-shadow: var(--shadow);
}
.quote-opt:hover { border-color: var(--brand-strong); }
.quote-opt-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-bg);
  font-size: 26px;
}
.quote-opt-price { display: flex; flex-direction: column; align-items: flex-end; flex: none; font-size: 22px; font-weight: 800; color: var(--brand-strong); line-height: 1.1; }
.quote-opt-price small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
/* Tarifa base 1 kg: lo primero que se ve en Precios */
.base-rates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.base-rate {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 2px solid var(--brand-mid);
  box-shadow: var(--shadow);
}
.base-rate:hover { border-color: var(--brand-strong); }
.base-rate-hot { background: var(--brand-bg); border-color: var(--brand); }
.base-rate-tag { font-size: 14px; font-weight: 700; color: var(--tx-2); }
.base-rate-price { font-size: 38px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; color: var(--brand-strong); }
.base-rate small { font-size: 13px; color: var(--muted); }
.link { color: var(--brand-strong); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.panel > .table-wrap { border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--border); }
.panel > .table-wrap tr:last-child td { border-bottom: 0; }
.fine-left { text-align: left; }

/* ── Pantallas (cotizadores) encima de las pestañas ── */
.screen {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  animation: screenIn .22s ease;
}
@keyframes screenIn { from { transform: translateX(24px); opacity: 0; } }
.screen-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--head-h);
  padding: 0 12px 0 4px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.screen-back { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: var(--tx); }
.screen-back svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.screen-title { display: flex; flex-direction: column; line-height: 1.2; }
.screen-title b { font-size: 16.5px; }
.screen-title small { font-size: 12.5px; color: var(--muted); }
.screen-body { flex: 1; overflow-y: auto; overscroll-behavior-y: contain; padding: 16px 16px calc(28px + env(safe-area-inset-bottom)); }
.screen-inner { max-width: 640px; margin: 0 auto; }
.back-link { padding: 6px 0; border: 0; background: none; font-size: 15px; font-weight: 600; color: var(--brand-strong); }

.quote { display: flex; flex-direction: column; }
.quote .kicker { margin: 16px 0 8px; }

.addr + .addr { margin-top: 12px; }
.addr-label, .field span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--tx-2); }
.addr-row { display: flex; gap: 6px; }
.addr.is-set input { border-color: var(--ok); background: var(--ok-bg); }
.addr.is-error input { border-color: var(--bad); }
.addr.is-loading input {
  background: linear-gradient(90deg, var(--card), var(--brand-bg), var(--card)) 0 0 / 200% 100%;
  animation: shimmer 1s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.addr-gps {
  flex: none;
  width: 52px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--brand-mid);
  background: var(--brand-bg);
  font-size: 20px;
}
.addr-msg { margin: 6px 0 0; font-size: 13px; color: var(--bad); }
/* Sugerencias: un solo bloque tipo dropdown, calle + municipio */
.addr-opts {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
}
.addr-opts > small { padding: 8px 12px 2px; font-size: 12px; color: var(--muted); }
.addr-opts button {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 12px;
  border: 0;
  border-top: 1px solid var(--border);
  background: none;
  text-align: left;
}
.addr-opts button:first-child { border-top: 0; }
.addr-opts > small + button { border-top: 0; }
.addr-opts button b { font-size: 14px; font-weight: 600; color: var(--tx); }
.addr-opts button small { font-size: 12px; color: var(--muted); }
.addr-opts button:hover, .addr-opts button:focus-visible { background: var(--hover); outline: none; }

.cp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field { display: block; }
.measure { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.measure .field span { font-size: 12.5px; }

.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 2px 8px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--card);
}
.chip-ico { font-size: 24px; line-height: 1; }
.chip-kg { font-size: 12px; font-weight: 700; line-height: 1.15; text-align: center; }
.chip-sub { font-size: 10.5px; color: var(--muted); }
.chip.is-on { border-color: var(--brand-strong); background: var(--brand-bg); color: var(--brand-strong); }

.guide {
  margin-top: 12px;
  padding: 4px 14px 8px;
  border-radius: var(--r-md);
  background: var(--brand-bg);
  border: 1px solid var(--brand-mid);
}
.guide .kicker { margin-top: 10px; }
.guide ul { margin: 0; padding: 0; list-style: none; }
.guide li { border-bottom: 1px dashed var(--brand-mid); }
.guide li:last-child { border-bottom: 0; }
.guide li button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 0;
  border: 0;
  background: none;
  font-size: 14.5px;
  text-align: left;
}
.guide li button b { color: var(--brand-strong); white-space: nowrap; }

.quote-out { margin-top: 16px; }
.quote-zone { margin: 0 0 4px; font-size: 14.5px; color: var(--tx-2); }

.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 26px 14px 14px;
  border-radius: var(--r-lg);
  border: 2px solid var(--border);
  background: var(--card);
  text-align: left;
}
.price-card.is-on { border-color: var(--brand-strong); background: var(--brand-bg); }
.badge {
  position: absolute;
  top: -11px;
  left: 12px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--brand-strong);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.badge-soft { background: var(--tx); }
.price-name { font-weight: 700; font-size: 15px; }
.price-amt { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.price-sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

.nac-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.nac-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  border: 2px solid var(--border);
  background: var(--card);
  text-align: left;
}
.nac-opt.is-on { border-color: var(--brand-strong); background: var(--brand-bg); }
.nac-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  background: var(--tx);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.nac-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nac-txt b { font-size: 15.5px; }
.nac-txt em {
  margin-left: 4px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--ok);
  color: #fff;
  font-style: normal;
  font-size: 11px;
  vertical-align: 2px;
}
.nac-txt small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nac-price { flex: none; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.quote-out .fine .typing { margin-right: 4px; vertical-align: middle; }

.note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
}
.note-info { background: var(--info-bg); color: var(--info-tx); }
.note-brand { background: var(--brand-bg); border: 1px solid var(--brand-mid); color: var(--tx-2); }
.note-bad { background: var(--bad-bg); color: var(--bad); }

.more { margin-top: 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--card); }
.more summary {
  list-style: none;
  padding: 14px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.more summary::-webkit-details-marker { display: none; }
.more > .fine, .more-body { padding: 0 14px 14px; }
.more-body p { margin: 0 0 8px; font-size: 14.5px; color: var(--tx-2); }
.formula {
  padding: 10px;
  border-radius: var(--r-sm);
  background: var(--hover);
  font-weight: 700;
  text-align: center;
}
.table-wrap { overflow-x: auto; padding: 0 14px; }
.rates { width: 100%; border-collapse: collapse; font-size: 14px; }
.rates th, .rates td { padding: 9px 6px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.rates th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rates small { color: var(--muted); }

.empty-card, .done {
  padding: 26px 20px;
  border-radius: var(--r-xl);
  background: var(--card);
  border: 1px solid var(--border);
  text-align: center;
}
.empty-card p, .done p { margin: 0; color: var(--muted); }
.empty-ico { font-size: 52px; margin-bottom: 8px; }

/* ── Cobertura: mapa primero ───────────── */
.cob-map {
  position: relative;
  height: 300px;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    repeating-linear-gradient(35deg, transparent 0 38px, #ECEAE4 38px 40px),
    repeating-linear-gradient(-55deg, transparent 0 52px, #ECEAE4 52px 54px),
    #F6F5F1;
}
/* Doble clase: Mapbox pone .mapboxgl-map { position: relative } al contenedor */
.cob-map .cob-canvas { position: absolute; inset: 0; }
.map-ph { position: absolute; inset: 0; pointer-events: none; }
.map-live .map-ph { display: none; }
.map-zone {
  position: absolute;
  inset: 22% 18%;
  border-radius: 42% 58% 50% 46%;
  background: rgba(242,160,87,.28);
  border: 2px solid var(--brand);
}
.map-bubble {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 5px 12px;
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 14px;
}
.map-hint {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 50px;
  z-index: 2;
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: rgba(10,10,10,.8);
  color: #fff;
  font-size: 13.5px;
  text-align: center;
  pointer-events: none;
}
.map-gps {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 2;
  transform: translateX(-50%);
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--card);
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}
.map-marker {
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--brand-strong);
  transform: rotate(-45deg);
  box-shadow: 0 3px 10px rgba(0,0,0,.3);
  cursor: grab;
}

.cob-search { margin-bottom: 12px; }
.cob-search-row { display: flex; gap: 8px; }
.cob-search-row input { flex: 1; min-width: 0; }
.cob-search .btn { flex: none; }
.cob-suggest { position: relative; z-index: 3; }

.cob-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 24px 16px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--border);
  text-align: center;
}
.quote-out .cob-loading { margin-top: 0; }

.cob-result { margin-top: 12px; padding: 18px 16px; border-radius: var(--r-lg); animation: fadeUp .3s ease; }
.quote-out .cob-result { margin-top: 0; }
.cob-result p { margin: 6px 0 0; font-size: 14.5px; }
.cob-ok { background: var(--ok-bg); border: 1.5px solid #BBF7D0; }
.cob-no, .cob-error { background: var(--bad-bg); border: 1.5px solid #FECACA; }
.cob-title { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.cob-addr { color: var(--muted); font-size: 13.5px; }
.cob-visit {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--card);
}
.cob-visit span { font-size: 13px; color: var(--muted); }
.cob-visit b { font-size: 18px; }
.cob-days { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 10px; font-size: 13.5px; color: var(--tx-2); }
.cob-days i {
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--ok);
  color: #fff;
  font-style: normal;
  font-weight: 700;
  font-size: 12.5px;
}
.cob-price b { font-size: 18px; }

/* ── Listas con check ──────────────────── */
.checks { margin: 10px 0 0; padding: 0; list-style: none; }
.checks li { position: relative; padding: 5px 0 5px 28px; font-size: 15px; }
.checks li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 5px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

/* ── Servicios ─────────────────────────── */
.services { display: flex; flex-direction: column; gap: 10px; }
.svc-card {
  padding: 16px;
  border-radius: var(--r-xl);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.svc-head { display: flex; align-items: center; gap: 12px; }
.svc-head h3 { margin: 0; font-size: 18px; }
.svc-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--brand-bg);
  font-size: 26px;
}
.svc-price { font-size: 14px; font-weight: 700; color: var(--brand-strong); }
.svc-card > p { margin: 10px 0 0; color: var(--tx-2); font-size: 14.5px; }
.svc-points { margin: 10px 0 0; padding: 10px 0 0; list-style: none; border-top: 1px solid var(--border); }
.svc-points li { position: relative; padding: 3px 0 3px 20px; font-size: 14px; color: var(--tx-2); }
.svc-points li::before { content: '✓'; position: absolute; left: 0; top: 3px; font-weight: 800; color: var(--brand-strong); }
.svc-cta {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--brand-strong);
  font-size: 15px;
  font-weight: 700;
}

.biz-block {
  margin-top: 22px;
  padding: 22px 18px;
  border-radius: var(--r-xl);
  background: var(--brand-bg);
  border: 1.5px solid var(--brand-mid);
}
.biz-block h3 { margin-top: 10px; font-size: 24px; }
.biz-block > p { margin: 0; color: var(--muted); }

/* ── Ayuda / FAQ ───────────────────────── */
.faq-cat { margin: 22px 0 10px; font-size: 17px; }
.faq-group:first-child .faq-cat { margin-top: 4px; }
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details { border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  list-style: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] .chev { transform: rotate(90deg); }
.faq details p { margin: 0; padding: 0 14px 14px; color: var(--tx-2); font-size: 15px; }

/* ── Sofi: CTA, burbuja flotante y chat tipo WhatsApp ── */
.sofi-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 24px;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--brand-mid);
  background: var(--brand-bg);
  text-align: left;
}
.sofi-cta-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--card);
  font-size: 28px;
}
.sofi-cta-avatar i {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ok);
  border: 2px solid #fff;
}
.sofi-cta-go {
  flex: none;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  background: var(--brand-strong);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.chat {
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.chat::backdrop { background: rgba(10,10,10,.55); }
.chat-box {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: var(--app-w);
  margin: 0 auto;
  background: var(--chat-bg) radial-gradient(rgba(0,0,0,.04) 1px, transparent 1px) 0 0 / 18px 18px;
}
.chat[open] .chat-box { animation: sheetUp .25s ease; }
.chat-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px 4px;
  background: var(--brand-strong);
  color: #fff;
}
.chat-back { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; color: #fff; }
.chat-back svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chat-avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: #fff; font-size: 24px; }
.chat-who { display: flex; flex-direction: column; line-height: 1.25; }
.chat-who b { font-size: 16px; }
.chat-who small { font-size: 12.5px; opacity: .85; }

.chat-log { flex: 1; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; padding: 14px 12px; }
.chat-day {
  align-self: center;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.9);
  font-size: 12px;
  color: var(--muted);
}
.bubble {
  max-width: 84%;
  padding: 7px 10px 5px;
  border-radius: 10px;
  font-size: 15px;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
  animation: fadeUp .25s ease;
}
.bubble time { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); text-align: right; }
.bubble-bot { align-self: flex-start; background: #fff; border-top-left-radius: 2px; }
.bubble-user { align-self: flex-end; background: var(--chat-user); border-top-right-radius: 2px; }
.bubble-user time { color: var(--brand-dark); }
.bubble-action { align-self: flex-start; min-height: 42px; margin-top: 2px; font-size: 15px; animation: fadeUp .25s ease; }

.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .3; transform: translateY(-2px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

.sofi-quick { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.sofi-quick button {
  padding: 8px 12px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--brand-mid);
  background: #fff;
  color: var(--brand-strong);
  font-size: 13.5px;
  font-weight: 600;
}
.chat-form { flex: none; display: flex; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
.chat-form input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: #fff;
  font-size: 16px;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
}
.chat-form input:focus { outline: 2px solid var(--brand-mid); }
.chat-form button { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--brand-strong); }
.chat-form button svg { width: 22px; height: 22px; fill: #fff; }

/* ── Modales (bottom sheet en móvil) ───── */
.modal {
  width: 100%;
  max-width: 100%;
  max-height: 100dvh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.modal::backdrop { background: rgba(10,10,10,.55); backdrop-filter: blur(2px); }
.modal-box {
  position: relative;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--card);
}
.modal[open] .modal-box { animation: sheetUp .28s ease; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
.modal-close {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  margin: 0 0 -42px auto; /* sin float: el form (flex) no se encoge a la izquierda */
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--hover);
  font-size: 18px;
  font-weight: 700;
}
.modal .title { font-size: 26px; margin-top: 12px; }
.modal .lead { margin-bottom: 4px; }

.envio-resumen {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--brand-bg);
  border: 1px solid var(--brand-mid);
}
.envio-resumen b { font-size: 16px; }
.envio-resumen small { font-size: 13px; color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 12px; }
.form .checks { margin: 0 0 6px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--tx-2); }
.form .btn-block { margin-top: 4px; }
.form > .pill { align-self: flex-start; margin-right: 52px; }
.form > .title { padding-right: 36px; }
.form label em { font-style: normal; font-weight: 500; color: var(--muted); }
.form textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 16px;
  resize: vertical;
}
.form textarea:focus { outline: none; border-color: var(--brand-strong); }
.form-fields { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: grid; gap: 12px; }

/* Selector de volumen (tarjetas) */
.vol { display: grid; gap: 8px; margin: 4px 0 0; padding: 0; border: 0; }
.vol legend { margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 700; color: var(--tx-2); }
.form .vol-opt {
  position: relative;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.vol-opt:hover { border-color: var(--brand-mid); }
.form .vol-opt input {
  flex: none;
  width: 20px;
  min-height: 0;
  height: 20px;
  margin: 0;
  padding: 0;
  accent-color: var(--brand-strong);
}
.vol-opt span { display: flex; flex-direction: column; }
.vol-opt b { font-size: 15.5px; color: var(--tx); }
.vol-opt small { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.vol-opt:has(input:checked) { border-color: var(--brand-strong); background: var(--brand-bg); }
.vol-opt:has(input:focus-visible) { outline: 2px solid var(--brand-mid); outline-offset: 2px; }
.form-msg { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bad-bg); color: var(--bad); font-size: 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.done { border: 0; }

/* Página de gracias (/gracias/<tipo>) */
.gracias {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 24px 16px;
}
.gracias .done { width: 100%; animation: success-in .38s cubic-bezier(.2, .8, .2, 1) both; }
.gracias .done .btn { margin-top: 20px; }
.gracias .empty-ico { animation: success-pop .58s .08s cubic-bezier(.2, .9, .25, 1.35) both; }
.gracias .done > :not(.empty-ico) { animation: success-content .35s .16s ease-out both; }

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
@keyframes success-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes success-pop {
  0% { opacity: 0; transform: scale(.55) rotate(-8deg); }
  70% { opacity: 1; transform: scale(1.12) rotate(3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes success-content {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Tablet / desktop: sitio a todo lo ancho, menú arriba ── */
@media (min-width: 768px) {
  :root { --head-h: 68px; --content-w: 1080px; --gutter: 32px; }

  .app { max-width: none; }
  .topbar { padding-inline: max(var(--gutter), calc((100% - var(--content-w)) / 2)); }
  .logo img { height: 36px; }
  .dots { display: none; }

  /* La barra inferior se vuelve menú superior */
  .tabbar {
    top: 0;
    bottom: auto;
    left: auto;
    right: max(var(--gutter), calc((100% - var(--content-w)) / 2));
    display: flex;
    align-items: center;
    gap: 4px;
    height: var(--head-h);
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    border: 0;
  }
  .tab { flex-direction: row; gap: 6px; padding: 9px 14px; border-radius: var(--r-pill); font-size: 15px; }
  .tab svg { display: none; }
  .tab:hover { background: var(--hover); color: var(--tx); }
  .tab.is-on { background: var(--brand-bg); }

  .panel { padding: 44px max(var(--gutter), calc((100% - var(--content-w)) / 2)) 96px; }
  .title { font-size: 42px; }
  .lead { font-size: 18px; }
  .title-section { margin-top: 56px; }

  /* Inicio */
  .hero { padding-right: 260px; min-height: 240px; }
  .title-xl { font-size: 58px; }
  .hero-art { top: 0; width: 230px; height: 230px; font-size: 116px; }
  .price-hook, .hero-ctas { max-width: 560px; }
  .perks { grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 32px; }
  .perks li { padding: 16px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stats div { padding: 22px; }
  .stats b { font-size: 34px; }
  .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .step { padding: 18px; }
  .step-list { margin-left: 0; }

  /* Cotizador y FAQ: columna más angosta para que se lea */
  #precios, #ayuda { --content-w: 760px; }
  .quote-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .chips { grid-template-columns: repeat(8, 1fr); }
  .measure { grid-template-columns: repeat(4, 1fr); }
  .screen-head { padding-inline: max(var(--gutter), calc((100% - 640px) / 2)); }
  .screen-body { padding-top: 32px; }

  /* Cobertura: buscador y resultado a la izquierda, mapa fijo a la derecha */
  #cobertura { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; align-content: start; }
  #cobertura > * { grid-column: 1; }
  #cobertura > .cob-map { grid-column: 2; grid-row: 1 / span 8; position: sticky; top: 0; height: 520px; margin-top: 8px; }
  #cobertura > .next-card { grid-column: 1 / -1; }

  /* Servicios en rejilla */
  .services { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .svc-card { display: flex; flex-direction: column; align-items: flex-start; }
  .svc-card .svc-cta { margin-top: auto; padding-top: 12px; }
  .biz-block { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; padding: 32px; }
  .biz-block > * { grid-column: 1; }
  .biz-block > .checks { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
  .biz-block > .btn { grid-column: 2; justify-self: stretch; }

  .next-card { padding: 22px 26px; }
  .next-card:hover b { text-decoration: underline; }

  /* Sofi: chat como ventana flotante */
  .chat { width: 400px; height: min(680px, calc(100dvh - 48px)); margin: auto 28px 28px auto; }
  .chat::backdrop { background: rgba(10,10,10,.25); }
  .chat-box { border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-lg); }
  .chat-head { padding-top: 10px; }

  /* Modal centrado */
  .modal { width: min(560px, calc(100% - 48px)); margin: auto; }
  .modal-box { max-height: calc(100dvh - 48px); padding: 28px; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }
  .form-row { grid-template-columns: 1fr 1fr; }
  .vol { grid-template-columns: repeat(3, 1fr); }
  .form .vol-opt { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (min-width: 1024px) {
  .tab svg { display: block; width: 18px; height: 18px; }
  .services { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
