/* ==========================================================
   Autotendencias — hoja de estilos (clara y editorial)
   Fondo blanco, fotografía grande de autos, títulos en serif
   y un solo color de acento: azul.
   ========================================================== */

:root {
  --bg: #ffffff;
  --soft: #f3f4f6;        /* superficies suaves */
  --ink: #0e1116;
  --muted: #5b6270;
  --line: #e4e6ea;
  --accent: #1d4ed8;      /* azul de la marca */
  --accent-soft: #e8eefc;
  --dark: #0e1116;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;

  --m: clamp(16px, 3vw, 40px);       /* margen lateral */
  --max: 1320px;
  --r: 20px;                          /* radio de las fotos */
  --gap: clamp(72px, 9vw, 136px);     /* aire entre secciones */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--m); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; line-height: 1.02; }
h2 { font-size: clamp(2.4rem, 1.5rem + 3.2vw, 4.25rem); }
.kicker { font-size: 0.8125rem; font-weight: 600; color: var(--accent); }
.muted { color: var(--muted); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 0.9375rem/1 var(--sans);
  padding: 14px 22px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: transform .2s var(--ease), background-color .2s;
}
.btn:hover { background: #1640b4; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { background: var(--soft); }
.arrow { transition: transform .2s var(--ease); }
a:hover .arrow, .btn:hover .arrow { transform: translateX(4px); }

/* ---------- Cabecera ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
}
.top .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 72px;
}
.top nav { display: flex; gap: 28px; font-size: 0.9375rem; font-weight: 500; }
.top nav a { position: relative; padding: 6px 0; }
.top nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}
.top nav a:hover::after { transform: scaleX(1); }
.wordmark {
  font: 600 1.0625rem/1 var(--sans);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-align: center;
}
.wordmark b { color: var(--accent); font-weight: 600; }
.top .btn { justify-self: end; padding: 11px 18px; }

/* ---------- Portada ---------- */
.hero { padding: 8px 0 0; }
.hero-card {
  position: relative;
  height: min(64svh, 640px);
  min-height: 320px;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--soft);
}
.hero-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 70%;
}
/* carrusel: las fotos se superponen y cambian con un fundido */
.slide { position: absolute; inset: 0; display: block; opacity: 0; visibility: hidden; transition: opacity 1.2s ease, visibility 0s linear 1.2s; }
.slide.on { opacity: 1; visibility: visible; transition: opacity 1.2s ease; }
.slide.on img { animation: zoom 9s ease-out both; }
.slide-tag {
  position: absolute;
  left: clamp(16px, 2.5vw, 28px);
  bottom: clamp(16px, 2.5vw, 28px);
  max-width: calc(100% - 140px);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.9375rem;
}
.slide-tag small { color: var(--accent); font-size: 0.8125rem; font-weight: 600; }
.slide:hover .slide-tag { background: #fff; }
.dots { position: absolute; right: clamp(16px, 2.5vw, 28px); bottom: clamp(20px, 3vw, 34px); display: flex; gap: 8px; z-index: 2; }
.dots button {
  width: 10px; height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: width .3s var(--ease), background-color .3s;
}
.dots button[aria-selected="true"] { width: 28px; background: #fff; }
@keyframes zoom { from { transform: scale(1.06); } to { transform: scale(1); } }
/* el titular va debajo de la foto, para no tapar el auto */
.hero-text {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
  padding-top: clamp(28px, 4vw, 52px);
}
.hero-text h1 { font-size: clamp(2.8rem, 1.2rem + 6vw, 6.5rem); line-height: 0.95; }
.hero-text h1 em { font-style: italic; color: var(--accent); }
.hero-text p { font-size: 1.125rem; color: var(--muted); max-width: 44ch; margin-bottom: 22px; }

/* ---------- Artículos ---------- */
.section { padding: var(--gap) 0 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.section-head p { color: var(--muted); max-width: 40ch; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 2.6vw, 36px); }
.card { display: block; }
.card .ph { border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 3; background: var(--soft); }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover img { transform: scale(1.05); }
.card .kicker { display: block; margin: 18px 0 8px; }
.card h3 { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.1rem); line-height: 1.06; margin-bottom: 10px; }
.card:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.card p { color: var(--muted); font-size: 1rem; }
.card .read { display: inline-block; margin-top: 14px; font-weight: 600; font-size: 0.9375rem; }

/* artículo principal: foto grande a la izquierda, texto a la derecha */
.card.feature {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  margin-bottom: clamp(12px, 2vw, 28px);
}
.card.feature .ph { aspect-ratio: 16 / 10; }
.card.feature .kicker { margin-top: 0; }
.card.feature h3 { font-size: clamp(2.2rem, 1.4rem + 2.8vw, 3.6rem); line-height: 1; margin-bottom: 16px; }
.card.feature p { font-size: 1.125rem; max-width: 36ch; }

.soon {
  margin-top: clamp(40px, 5vw, 64px);
  background: var(--soft);
  border-radius: var(--r);
  padding: clamp(24px, 3vw, 40px);
  display: grid;
  grid-template-columns: 1fr 2.4fr;
  gap: 24px;
  align-items: start;
}
.soon h3 { font-size: 1.9rem; }
.soon ul { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.soon li strong { display: block; font-weight: 600; margin-bottom: 4px; }
.soon li span { color: var(--muted); font-size: 0.9375rem; }

/* ---------- Calculadora ---------- */
.calc {
  background: var(--accent-soft);
  border-radius: calc(var(--r) + 8px);
  padding: clamp(28px, 5vw, 72px);
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.calc h2 { margin: 10px 0 16px; }
.calc .lede { color: #33405c; max-width: 36ch; margin-bottom: 32px; }
.field { display: grid; gap: 8px; font-size: 0.9375rem; font-weight: 600; margin-bottom: 22px; }
.field output { font: 400 2.4rem/1 var(--serif); }
/* selector de tipo de gasolina */
.fuel-type { border: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; }
.fuel-type legend { float: left; width: 100%; font-size: 0.9375rem; font-weight: 600; margin-bottom: 8px; }
.fuel-type label { position: relative; cursor: pointer; }
.fuel-type input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fuel-type span {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #c9d3ee;
  background: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background-color .2s, color .2s, border-color .2s;
}
.fuel-type label:hover span { border-color: var(--accent); }
.fuel-type input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.fuel-type input:focus-visible + span { outline: 3px solid rgba(29, 78, 216, .35); outline-offset: 2px; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
input[type="range"] { width: 100%; height: 28px; accent-color: var(--accent); }
input[type="number"], input[type="email"] {
  width: 100%;
  font: 500 1rem/1.2 var(--sans);
  padding: 13px 16px;
  border: 1px solid #c9d3ee;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
input:focus { outline: 3px solid rgba(29, 78, 216, .25); border-color: var(--accent); }

.results { background: #fff; border-radius: var(--r); padding: clamp(22px, 3vw, 36px); }
.results h3 { font: 600 0.9375rem/1.3 var(--sans); letter-spacing: 0; margin-bottom: 20px; }
.bars { list-style: none; display: grid; gap: 18px; }
.bars .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.bars .name { font-weight: 600; }
.bars .name small { font-weight: 400; color: var(--muted); font-size: 0.875rem; margin-left: 6px; }
.bars .val { font: 400 1.9rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.bars .track { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.bars .fill { height: 100%; width: 0; border-radius: 999px; background: #b9c1d0; transition: width .7s var(--ease); }
.bars li.best .fill { background: var(--accent); }
.bars li.best .val { color: var(--accent); }
.saving {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.saving strong { font: 400 clamp(2.2rem, 1.6rem + 2vw, 3.2rem)/1 var(--serif); color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.note { font-size: 0.8125rem; color: #55607a; margin-top: 16px; }

/* ---------- Hecho en Ecuador ---------- */
.about { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 5vw, 80px); align-items: center; }
.about .ph { border-radius: var(--r); overflow: hidden; aspect-ratio: 5 / 4; }
.about .ph img { width: 100%; height: 100%; object-fit: cover; }
.about h2 { margin: 10px 0 18px; }
.about p { color: var(--muted); max-width: 44ch; margin-bottom: 14px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0; }
.facts dt { font: 400 2rem/1 var(--serif); }
.facts dd { color: var(--muted); font-size: 0.9375rem; margin-top: 4px; }

/* ---------- Boletín ---------- */
.news {
  background: var(--dark);
  color: #fff;
  border-radius: calc(var(--r) + 8px);
  padding: clamp(32px, 6vw, 88px);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
}
.news h2 em { font-style: italic; color: #8fb0ff; }
.news p { color: #b6bcc8; margin-top: 14px; max-width: 40ch; }
.news form { display: flex; gap: 10px; }
.news input { border-color: transparent; }
.news .btn { flex: none; }
.news small { display: block; color: #8a91a0; margin-top: 12px; font-size: 0.8125rem; }

/* ---------- Pie ---------- */
.foot { padding: clamp(48px, 6vw, 80px) 0 40px; }
.foot .wrap { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; }
.foot .wordmark { text-align: left; display: inline-block; margin-bottom: 14px; }
.foot p { color: var(--muted); max-width: 34ch; font-size: 0.9375rem; }
.foot h3 { font: 600 0.875rem/1.3 var(--sans); letter-spacing: 0; margin-bottom: 12px; }
.foot ul { list-style: none; display: grid; gap: 8px; font-size: 0.9375rem; }
.foot ul a:hover { color: var(--accent); }
.foot .legal { max-width: none; grid-column: 1 / -1; padding-top: 28px; margin-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8125rem; }

/* ---------- Aparición al hacer scroll ---------- */
.js [data-rise] { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js [data-rise].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slide.on img { animation: none; }
  .slide, .slide.on { transition: none; }
  .js [data-rise] { opacity: 1; transform: none; transition: none; }
  .bars .fill, .card img, .btn { transition: none; }
}

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
  .hero-text, .calc, .about, .news { grid-template-columns: 1fr; align-items: start; }
  .card.feature { grid-template-columns: 1fr; gap: 0; }
  .card.feature .kicker { margin-top: 18px; }
  .soon { grid-template-columns: 1fr; }
  .foot .wrap { grid-template-columns: 1fr 1fr; }
  .foot .wrap > div:first-child { grid-column: 1 / -1; }
}

/* ---------- Teléfono ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .top .wrap { grid-template-columns: 1fr auto; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 6px; }
  .top nav { grid-column: 1 / -1; grid-row: 2; gap: 22px; font-size: 0.875rem; }
  .wordmark { text-align: left; font-size: 0.875rem; letter-spacing: 0.2em; }
  .top .btn { padding: 10px 14px; font-size: 0.875rem; }
  .hero-card { height: 46svh; border-radius: 16px; }
  .slide-tag { max-width: calc(100% - 100px); padding: 10px 14px; font-size: 0.875rem; }
  .cards { grid-template-columns: 1fr; gap: 36px; }
  .card.feature .ph { aspect-ratio: 4 / 3; }
  .soon ul { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: start; }
  .pair { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .saving { flex-direction: column; }
  .news form { flex-direction: column; }
  .news .btn { justify-content: center; }
  .foot .wrap { grid-template-columns: 1fr; }
}

/* ==========================================================
   Páginas interiores: artículos, Acerca de, Contacto, Gracias
   ========================================================== */
.page-head { padding: clamp(32px, 5vw, 72px) 0 clamp(28px, 4vw, 48px); max-width: 900px; }
.page-head h1 { font-size: clamp(2.6rem, 1.2rem + 5vw, 5.5rem); line-height: 0.98; margin: 12px 0 20px; }
.byline { font-size: 0.9375rem; font-weight: 600; margin: -6px 0 18px; }
.byline a { color: var(--accent); }
.byline a:hover { text-decoration: underline; text-underline-offset: 3px; }
.page-head .lead { font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem); color: var(--muted); max-width: 52ch; }
.page-photo { border-radius: var(--r); overflow: hidden; aspect-ratio: 21 / 9; background: var(--soft); }
.page-photo img { width: 100%; height: 100%; object-fit: cover; }
.doc { max-width: 700px; margin: 0 auto; padding-top: clamp(40px, 5vw, 72px); font-size: 1.125rem; line-height: 1.65; }
.doc h2 { font-size: clamp(1.9rem, 1.5rem + 1.2vw, 2.5rem); line-height: 1.05; margin: 2.2em 0 0.5em; }
.doc p { margin-bottom: 1.1em; }
.doc ul { margin: 0 0 1.1em 1.2em; }
.doc li { margin-bottom: 0.5em; }
.doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.doc blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--accent);
  font: italic 400 clamp(1.5rem, 1.2rem + 1vw, 2rem)/1.2 var(--serif);
}
.doc form { display: grid; gap: 18px; margin-top: 28px; }
.doc label { display: grid; gap: 8px; font-size: 0.9375rem; font-weight: 600; }
.doc input[type="text"], .doc input[type="email"], .doc textarea {
  width: 100%;
  font: 400 1rem/1.4 var(--sans);
  padding: 13px 16px;
  border: 1px solid #c9ced8;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
.doc textarea { min-height: 170px; resize: vertical; }
.doc .btn { justify-self: start; color: #fff; text-decoration: none; }
figure.page-photo { margin: 0; }
.photo-note { font-size: 0.8125rem; color: var(--muted); margin-top: 10px; }
.doc .sources { font-size: 0.9375rem; }
.photo-note a, .doc-photo figcaption a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.doc-photo { margin: 2em 0; }
.doc-photo img { width: 100%; border-radius: 16px; aspect-ratio: 16 / 10; object-fit: cover; }
.doc-photo figcaption { font-size: 0.8125rem; color: var(--muted); margin-top: 8px; }
.back { display: inline-block; margin-top: 12px; font-weight: 600; font-size: 0.9375rem; }
.back:hover { color: var(--accent); }
@media (max-width: 640px) {
  .page-photo { aspect-ratio: 4 / 3; border-radius: 16px; }
  .doc { font-size: 1.0625rem; }
}

/* ---------- Anúnciate / formularios ---------- */
.doc input[type="tel"], .doc select {
  width: 100%;
  font: 400 1rem/1.4 var(--sans);
  padding: 13px 16px;
  border: 1px solid #c9ced8;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
.doc .opt { font-weight: 400; color: var(--muted); }
.doc code { font-size: 0.9em; background: var(--soft); padding: 1px 6px; border-radius: 6px; }
.offers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.offer { background: var(--soft); border-radius: var(--r); padding: clamp(24px, 3vw, 36px); }
.offer h2 { font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem); margin: 10px 0 12px; }
.offer p { color: var(--muted); font-size: 1rem; }
@media (max-width: 860px) { .offers { grid-template-columns: 1fr; } }
