/* ============================================================
   Red de Fletes Cajamarca — sistema de diseño
   Mobile-first, sin frameworks, performance-first.
   ============================================================ */

:root {
  --ink: #142338;
  --ink-soft: #44566f;
  --muted: #6b7b93;
  --line: #e2e9f2;
  --bg: #f3f6fb;
  --card: #ffffff;
  --brand: #123a5c;
  --brand-2: #1d5b88;
  --brand-soft: #e8f0f8;
  --wa: #1fa855;
  --wa-dark: #168a45;
  --amber: #f5a524;
  --ok: #12805c;
  --ok-bg: #e3f6ec;
  --warn: #a35a00;
  --warn-bg: #fdf0dd;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(18, 58, 92, .08);
  --shadow-lg: 0 14px 34px rgba(18, 58, 92, .16);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  padding-bottom: 96px; /* espacio para la barra fija de contacto */
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--brand-2); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 34px 20px 26px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(255, 255, 255, .16), transparent 60%),
    linear-gradient(165deg, #0f2f4c 0%, #164a72 55%, #1d5b88 100%);
  border-radius: 0 0 28px 28px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.avatar-wrap {
  position: relative;
  width: 116px;
  height: 116px;
  margin: 0 auto 14px;
}

.avatar {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, .35);
  background: #dfe7f1;
  box-shadow: var(--shadow-lg);
}

.verified {
  position: absolute;
  right: 2px;
  bottom: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--wa);
  border: 3px solid #fff;
  display: grid;
  place-items: center;
}

.verified svg { width: 14px; height: 14px; }

.hero h1 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  letter-spacing: .2px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .2px;
}

.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .18);
}

.status.disp { background: rgba(31, 168, 85, .18); color: #8ef0b8; }
.status.ocup { background: rgba(245, 165, 36, .18); color: #ffd38a; }

.hero .chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #eaf3fb;
  border: 1px solid rgba(255, 255, 255, .14);
  max-width: 100%;
}

.chip svg { width: 15px; height: 15px; flex: none; }

/* ---------- Layout ---------- */

main {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
}

section { margin: 22px 0; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}

.section-title .icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex: none;
}

.section-title .icon svg { width: 16px; height: 16px; }

/* ---------- Tarjetas ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card + .card { margin-top: 14px; }

/* ---------- Vehículos ---------- */

.vehiculo { margin: 0 0 16px; }

.galeria {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 0;
  background: #e9eef5;
}

.galeria img {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  scroll-snap-align: start;
}

.vehiculo .cuerpo { padding: 16px; }

.vehiculo h3 {
  margin: 0 0 2px;
  font-size: 1.08rem;
  text-transform: capitalize;
}

.placa {
  display: inline-block;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: 2px;
}

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
}

.specs div {
  background: #f7f9fc;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 0;
}

.specs dd { overflow-wrap: anywhere; }

.specs dt {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  margin-bottom: 2px;
}

.specs dd {
  margin: 0;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
}

.specs div.wide { grid-column: 1 / -1; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.tag {
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.neutral { background: #eef2f8; color: var(--ink-soft); }

/* ---------- Zona / info ---------- */

.info { padding: 16px; }

.info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 14px;
  margin: 0;
}

.info dt { color: var(--muted); font-size: .86rem; }
.info dd { margin: 0; font-size: .92rem; font-weight: 600; }

/* ---------- CTA fija ---------- */

.cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(243, 246, 251, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}

.cta-inner {
  max-width: 600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 10px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 54px;
  padding: 0 14px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.btn:active { transform: scale(.985); }

.btn svg { width: 21px; height: 21px; flex: none; }

.btn-wa { background: var(--wa); color: #fff; box-shadow: 0 6px 16px rgba(31, 168, 85, .32); }
.btn-wa:hover { background: var(--wa-dark); }

.btn-tel { background: #fff; color: var(--brand); border: 1.5px solid #cfdceb; }
.btn-tel:hover { background: #f2f7fd; }

.btn-block { width: 100%; }

/* ---------- Cómo funciona ---------- */

.pasos { padding: 16px; display: grid; gap: 14px; }

.paso { display: flex; gap: 12px; align-items: flex-start; }

.paso .num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

.paso p { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.paso b { color: var(--ink); }

/* ---------- Footer ---------- */

footer {
  max-width: 600px;
  margin: 28px auto 0;
  padding: 20px 20px 8px;
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
}

footer .serial {
  display: inline-block;
  font-family: ui-monospace, monospace;
  font-size: .72rem;
  letter-spacing: .1em;
  color: #8b98ad;
  border: 1px dashed #c9d4e3;
  border-radius: 8px;
  padding: 4px 10px;
  margin-bottom: 10px;
}

footer p { margin: 6px 0; }
footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Landing / directorio ---------- */

.landing { max-width: 640px; margin: 0 auto; padding: 0 16px 24px; }
.landing .hero { border-radius: 0 0 28px 28px; margin: 0 -16px 0; }

.marca {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 0 auto 10px;
  background: rgba(255, 255, 255, .14);
  display: grid;
  place-items: center;
  color: #fff;
}

.marca svg { width: 42px; height: 42px; }

.lista-drivers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }

.driver-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow .15s ease, transform .15s ease;
}

.driver-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }

.driver-card img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: #e9eef5;
  flex: none;
}

.driver-card .datos { min-width: 0; flex: 1; }
.driver-card .datos strong { display: block; font-size: 1rem; }
.driver-card .datos span { display: block; font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.driver-card .flecha { color: #b9c6d8; flex: none; }

.empty {
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed #cfdaea;
  border-radius: var(--radius);
  padding: 28px 18px;
}

/* ---------- Privacidad ---------- */

.legal { max-width: 640px; margin: 0 auto; padding: 24px 20px 40px; }
.legal h1 { font-size: 1.4rem; }
.legal h2 { font-size: 1rem; margin-top: 24px; }
.legal p, .legal li { color: var(--ink-soft); font-size: .92rem; }

/* ---------- Utilidades ---------- */

.skip {
  position: absolute;
  left: -9999px;
}

@media (min-width: 560px) {
  .hero { padding-top: 44px; }
  .avatar-wrap, .avatar { width: 128px; height: 128px; }
  .hero h1 { font-size: 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
