/* ============================================
   Hanly Turbo Diesel — v1
   Paleta del logo: azul Hanly + amarillo diésel.
   Elemento protagonista: la orden de trabajo (formulario de cita).
   ============================================ */

:root {
  --navy: #1F3566;
  --navy-deep: #16264A;
  --yellow: #FFD21F;
  --ink: #14213D;
  --steel: #E7EAEF;
  --paper: #FFF6C7;
  --paper-line: #E9DC9A;
  --muted: #4A5568;
  --red: #C0392B;
  --white: #FFFFFF;

  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', 'Segoe UI', sans-serif;

  --wrap: 1140px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--navy); }
h1, h2, h3 { font-family: var(--display); line-height: 1.02; letter-spacing: 0.005em; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.hero :focus-visible, .ticket :focus-visible { outline-color: var(--navy); }

.sr, .hp {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--yellow); color: var(--ink); padding: 8px 14px; font-weight: 600;
}
.skip:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: 0.02em;
  border: 2px solid transparent; border-radius: 4px;
  text-decoration: none; cursor: pointer;
}
.btn--go { background: var(--navy); color: var(--white); }
.btn--go:hover { background: var(--navy-deep); }
.btn--back { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--back:hover { background: rgba(31, 53, 102, 0.08); }
.btn--wa { background: #1F9D55; color: var(--white); }
.btn--wa:hover { background: #17834A; }

/* --- Cabecera --- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--white);
  border-bottom: 4px solid var(--yellow);
}
.top__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 8px var(--gutter);
  display: flex; align-items: center; gap: 28px;
}
.top__logo img { width: 84px; }
.top__nav { display: flex; gap: 24px; margin-left: auto; }
.top__nav a {
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  color: var(--ink); text-decoration: none;
}
.top__nav a:hover { color: var(--navy); text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.top__call {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  color: var(--white); background: #1F9D55; padding: 8px 14px; border-radius: 4px; text-decoration: none;
}

/* --- Inicio --- */
.hero {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 14px, transparent 14px 28px),
    var(--navy);
  color: var(--white);
  padding: clamp(32px, 6vw, 72px) 0 clamp(48px, 7vw, 88px);
}
.hero__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr minmax(0, 520px); gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.hero h1 {
  font-size: clamp(2.9rem, 7vw, 5.4rem);
  font-weight: 800;
  max-width: 11ch;
  margin-top: 12px;
}
.hero__lead { margin-top: 20px; font-size: 1.2rem; max-width: 34em; color: #DCE3F0; }
.hero__facts {
  margin-top: 32px; display: grid; gap: 14px; max-width: 30em;
  border-left: 6px solid var(--yellow); padding-left: 18px;
}
.hero__facts dt { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--yellow); }
.hero__facts dd { color: var(--white); }

/* --- Orden de trabajo --- */
.ticket { position: relative; }
.ticket__slot {
  height: 14px; border-radius: 7px; margin: 0 -10px;
  background: var(--navy-deep);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.45);
}
.ticket__paper {
  position: relative;
  margin: -6px 6px 0;
  background:
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--paper-line) 31px 32px),
    var(--paper);
  color: var(--ink);
  padding: 26px 24px 30px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  /* borde inferior perforado */
  -webkit-mask: radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) 0 0 / 22px 100% repeat-x;
          mask: radial-gradient(circle 7px at 50% 100%, transparent 98%, #000) 0 0 / 22px 100% repeat-x;
  padding-bottom: 38px;
  transform-origin: top center;
  animation: print 0.9s cubic-bezier(.2, .8, .2, 1) 0.15s both;
}
@keyframes print {
  from { transform: translateY(-40px); clip-path: inset(0 0 100% 0); }
  to   { transform: translateY(0);     clip-path: inset(0 0 0 0); }
}

.ticket__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ticket__head h2 { font-size: 2.1rem; font-weight: 800; color: var(--navy); }
.ticket__no { font-family: var(--display); font-weight: 600; color: var(--red); font-size: 1.05rem; white-space: nowrap; }

.steps {
  list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin: 16px 0 20px; counter-reset: s;
}
.steps__item {
  font-family: var(--display); font-weight: 600; font-size: 0.98rem;
  color: var(--muted); padding-top: 8px; border-top: 4px solid var(--paper-line);
}
.steps__item::before { content: attr(data-step-label) ". "; }
.steps__item.is-current { color: var(--navy); border-top-color: var(--navy); }
.steps__item.is-done { color: var(--navy); border-top-color: var(--yellow); }

.step { border: 0; min-width: 0; }
.step[hidden], .done[hidden] { display: none; }

.field { display: grid; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field label, .field__label { font-weight: 600; font-size: 0.98rem; }
.opt { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--white); border: 2px solid #C9C2A0; border-radius: 4px;
  padding: 10px 12px; min-height: 46px;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(31, 53, 102, 0.2); }
.field [aria-invalid="true"] { border-color: var(--red); }
.field__error { color: var(--red); font-weight: 600; margin: -4px 0 12px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Marcas */
.brands { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.brand { cursor: pointer; }
.brand input { position: absolute; opacity: 0; pointer-events: none; }
.brand span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 12px;
  background: var(--white); border: 2px solid #C9C2A0; border-radius: 4px;
  font-weight: 600; font-size: 0.98rem;
}
.brand input:checked + span { border-color: var(--navy); background: var(--navy); color: var(--white); }
.brand input:focus-visible + span { outline: 3px solid var(--navy); outline-offset: 2px; }
.brand--scania { flex-basis: 100%; }
.brand--scania span {
  width: 100%; justify-content: space-between; min-height: 56px; padding: 8px 16px;
  border-width: 3px;
}
.brand--scania strong { font-family: var(--display); font-size: 1.7rem; font-weight: 800; letter-spacing: 0.04em; }
.brand--scania small { font-size: 0.92rem; font-weight: 600; }
.brand--scania input:checked + span { background: var(--navy); }
.brand--scania input:checked + span small { color: var(--yellow); }

/* Horas */
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slots__empty { color: var(--muted); font-size: 0.95rem; padding: 10px 0; }
.slot input { position: absolute; opacity: 0; pointer-events: none; }
.slot span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; cursor: pointer;
  background: var(--white); border: 2px solid #C9C2A0; border-radius: 4px; font-weight: 600;
}
.slot input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--white); }
.slot input:focus-visible + span { outline: 3px solid var(--navy); outline-offset: 2px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.ticket .actions .btn--go { flex: 1; }

.summary { font-size: 0.98rem; margin: 2px 0 14px; padding: 10px 12px; border: 2px dashed #C9C2A0; border-radius: 4px; background: rgba(255, 255, 255, 0.55); }
.summary:empty { display: none; }
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; }
.summary dt { font-weight: 600; }

/* Confirmación */
.done { text-align: left; position: relative; padding-top: 8px; }
.done:focus { outline: none; }
.done h3 { font-size: 2rem; color: var(--navy); margin-bottom: 8px; }
.done p { margin-bottom: 10px; }
.done__stamp {
  position: absolute; right: 0; top: -6px;
  font-family: var(--display); font-weight: 800; font-size: 1.4rem;
  color: var(--red); border: 3px solid var(--red); border-radius: 6px; padding: 2px 12px;
  transform: rotate(-8deg); opacity: 0.85;
  animation: stamp 0.35s ease-out both;
}
@keyframes stamp { from { transform: rotate(-8deg) scale(1.6); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 0.85; } }

/* --- Scania --- */
.scania { background: var(--yellow); padding: clamp(48px, 7vw, 88px) 0; }
.scania__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.scania h2 { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 800; color: var(--navy); max-width: 12ch; }
.scania p { margin: 16px 0 24px; max-width: 34em; font-size: 1.15rem; }

.spec { width: 100%; border-collapse: collapse; background: var(--white); border: 3px solid var(--navy); }
.spec th, .spec td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--steel); vertical-align: top; }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }
.spec th { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--navy); width: 34%; background: #F6F7F9; }

/* --- Servicios --- */
.services { padding: clamp(48px, 7vw, 88px) 0; }
.services h2, .visit h2 { font-size: clamp(2.3rem, 5vw, 3.4rem); font-weight: 800; color: var(--navy); }
.svc { list-style: none; margin-top: 28px; border-top: 3px solid var(--navy); }
.svc__row {
  display: grid; grid-template-columns: 15rem 1fr auto; gap: 8px 32px; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--steel);
}
.svc__row h3 { font-size: 1.7rem; font-weight: 700; color: var(--ink); }
.svc__row p { color: var(--muted); max-width: 40em; }
.svc__row a {
  font-family: var(--display); font-weight: 700; font-size: 1.1rem; white-space: nowrap;
  text-decoration-color: var(--yellow); text-decoration-thickness: 3px; text-underline-offset: 5px;
}
.brands-line { margin-top: 24px; font-size: 1.1rem; max-width: 46em; }

/* --- Visítanos --- */
.visit { background: var(--steel); padding: clamp(48px, 7vw, 88px) 0; }
.visit__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.visit address { font-style: normal; font-size: 1.2rem; margin: 16px 0 24px; }
.hours { width: 100%; border-collapse: collapse; background: var(--white); border-top: 6px solid var(--navy); }
.hours caption { text-align: left; font-family: var(--display); font-weight: 800; font-size: 1.6rem; color: var(--navy); padding-bottom: 10px; }
.hours th, .hours td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--steel); }
.hours th { font-weight: 600; }

/* --- Pie --- */
.foot { background: var(--navy-deep); color: #C9D2E3; padding: 32px 0; font-size: 0.95rem; }
.foot__inner { display: grid; gap: 6px; }
.foot a { color: var(--yellow); }
.foot__legal { color: #9AA6BD; font-size: 0.88rem; }
.foot__credit { color: #9AA6BD; font-size: 0.88rem; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero__inner, .scania__grid, .visit__grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: 14ch; }
  .svc__row { grid-template-columns: 1fr; }
  .top__nav { display: none; }
  .top__call { margin-left: auto; }
}

@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; gap: 0; }
  .ticket__paper { margin: -6px 0 0; padding: 22px 16px 36px; }
  .ticket__slot { margin: 0 -6px; }
  .ticket__head { flex-direction: column; gap: 2px; }
  .steps__item { font-size: 0.88rem; }
  .top__logo img { width: 68px; }
  .top__call span { font-size: 1.05rem; }
}

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

/* Botón de agendar del inicio: solo en móvil, donde el formulario queda más abajo */
.btn--yellow { background: var(--yellow); color: var(--ink); }
.btn--yellow:hover { background: #F2C400; }
.hero__cta { display: none; margin-top: 24px; }
@media (max-width: 900px) {
  .hero__cta { display: inline-flex; }
}
