/* EV Cargo, almacén de Madrid. Tokens extraídos de evcargo.com (ver DESIGN.md) */
:root {
  --orange: #EE7203;
  --orange-dark: #D46300;
  --ink: #3F3B3A;
  --graphite: #373738;
  --black: #222222;
  --card-dark: #1A1A1A;
  --grey: #EBEBEB;
  --line: #D6D3D2;
  --muted: #6B6665;
  --white: #FFFFFF;
  --radius: 8px;
  --shadow-btn: 0 6px 16px rgba(93, 93, 93, .2);
  --shadow-card: 0 18px 48px rgba(0, 0, 0, .28);
  --font: Tahoma, "Segoe UI", Arial, Helvetica, sans-serif;
  --wrap: 1200px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
}
img, video, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; }
h1, h2, h3 { font-weight: 700; line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 4.3vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.3vw, 2.9rem); }
h3 { font-size: 1.25rem; line-height: 1.25; }
[id] { scroll-margin-top: 112px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -80px; z-index: 100; background: var(--white); color: var(--ink); padding: 12px 16px; border-radius: var(--radius); }
.skip:focus { top: 16px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 26px;
  font: 700 1.0625rem/1.2 var(--font);
  text-decoration: none; text-align: center;
  border: 2px solid transparent; border-radius: var(--radius);
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn--primary { background: var(--orange); color: var(--white); box-shadow: var(--shadow-btn); }
.btn--primary:hover { background: var(--orange-dark); }
.btn--outline { border-color: var(--white); color: var(--white); }
.btn--outline:hover { background: var(--white); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--sm { min-height: 44px; padding: 8px 18px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link { color: var(--orange-dark); font-weight: 700; text-underline-offset: 4px; }

/* ---------- Navegación ---------- */
.nav { position: fixed; inset: 16px 0 auto 0; z-index: 50; pointer-events: none; }
.nav__bar {
  pointer-events: auto;
  width: min(100% - 32px, 1312px); margin-inline: auto;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 20px 14px 28px;
  background: rgba(55, 55, 56, .9);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-radius: var(--radius);
  color: var(--white);
}
.nav__logo img { width: 165px; height: 36px; }
.nav__links { display: flex; gap: 28px; margin-left: auto; }
.nav__links a { text-decoration: none; font-size: 1rem; padding: 8px 0; }
.nav__links a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--orange); text-decoration-thickness: 2px; }
.nav__actions { display: flex; align-items: center; gap: 20px; }
.nav__phone { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 1rem; white-space: nowrap; }
.nav__phone svg { width: 20px; height: 20px; fill: none; stroke: var(--orange); stroke-width: 1.8; stroke-linejoin: round; }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; color: var(--white); background: var(--black); padding: 164px 0 56px; overflow: hidden; }
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__media img, .hero__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__media video { opacity: 0; transition: opacity .8s; }
.hero__media video.is-on { opacity: 1; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(26, 26, 26, .88) 0%, rgba(26, 26, 26, .66) 48%, rgba(26, 26, 26, .42) 100%),
    linear-gradient(0deg, rgba(26, 26, 26, .7) 0%, rgba(26, 26, 26, 0) 38%);
}
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: 56px; align-items: start; }
.hero__copy { padding-top: 28px; }
.hero__lead { margin-top: 24px; font-size: 1.25rem; max-width: 34em; }
.hero__points { margin-top: 28px; display: grid; gap: 12px; }
.hero__points li { position: relative; padding-left: 30px; font-weight: 700; }
.hero__points li::before {
  content: ""; position: absolute; left: 2px; top: .38em;
  width: 16px; height: 9px; border-left: 3px solid var(--orange); border-bottom: 3px solid var(--orange);
  transform: rotate(-45deg);
}
.hero__cta { display: none; margin-top: 32px; }

/* ---------- Formulario de cotización ---------- */
.quote { background: var(--white); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 28px; }
.quote__head h2, .quote__done h2 { font-size: 1.6rem; }
.quote__head p { margin-top: 6px; font-size: .95rem; color: var(--muted); }
.quote__bar { margin-top: 14px; height: 6px; background: var(--grey); border-radius: 3px; overflow: hidden; }
.quote__bar span { display: block; height: 100%; width: 33.33%; background: var(--orange); transition: width .3s; }
.step { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 20px; }
.field { display: grid; gap: 6px; align-content: start; }
.field--full { grid-column: 1 / -1; }
.field label, .field__label { font-size: .95rem; font-weight: 700; }
.opt { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  font: 400 1rem/1.3 var(--font); color: var(--ink);
  background: var(--white); border: 1.5px solid #B9B5B4; border-radius: 6px;
}
.field textarea { resize: vertical; min-height: 72px; }
.field input::placeholder, .field textarea::placeholder { color: #8C8786; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(238, 114, 3, .22); }
.field.is-invalid input, .field.is-invalid select { border-color: #C62828; }
.field__error, .consent__error { font-size: .875rem; color: #B3261E; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { cursor: pointer; }
.checks input { position: absolute; opacity: 0; pointer-events: none; }
.checks span { display: block; padding: 9px 14px; font-size: .95rem; font-weight: 400; border: 1.5px solid #B9B5B4; border-radius: 6px; }
.checks input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--white); }
.checks input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }
.quote__note { font-size: .9rem; background: #FFF3E6; border-left: 4px solid var(--orange); padding: 10px 12px; border-radius: 4px; }
.quote__nav { display: flex; gap: 12px; margin-top: 6px; }
.quote__nav .btn--primary { flex: 1; }
.consent { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--orange); flex: none; }
.consent span { flex: 1; }
.consent__error { flex-basis: 100%; }
.consent a { color: var(--orange-dark); }
.hp { position: absolute; left: -9999px; }
.form-error { font-size: .95rem; color: #B3261E; background: #FDECEA; padding: 10px 12px; border-radius: 4px; }
.quote__done { text-align: center; padding: 28px 8px; display: grid; gap: 14px; justify-items: center; }
.quote__done:focus { outline: 0; }
.quote__done svg { width: 64px; height: 64px; fill: none; stroke: var(--orange); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.quote__done a { color: var(--orange-dark); font-weight: 700; }
.quote__demo { font-size: .875rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 4px; padding: 8px 12px; }

/* ---------- Datos clave: cartas sobre una viga de estantería ---------- */
.facts { margin-top: 64px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding-bottom: 14px; border-bottom: 6px solid var(--orange); }
.facts li { background: rgba(55, 55, 56, .88); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: var(--radius); padding: 22px 22px 24px; }
.facts svg { width: 28px; height: 28px; fill: none; stroke: var(--orange); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.facts h3 { margin-top: 12px; font-size: 1.2rem; }
.facts p { margin-top: 8px; font-size: 1rem; color: #E4E2E1; }

/* ---------- Secciones ---------- */
.section { padding: 104px 0; }
.section--grey { background: var(--grey); }
.section--dark { background: var(--black); color: var(--white); }
.head { max-width: 46rem; margin-bottom: 52px; }
.head p { margin-top: 18px; }

/* Para quién */
.split { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; }
.split__intro p { margin-top: 20px; }
.cases { display: grid; }
.cases article { padding: 24px 0; border-top: 1px solid var(--line); }
.cases article:first-child { border-top: 4px solid var(--orange); }
.cases article:last-child { padding-bottom: 0; }
.cases p { margin-top: 8px; max-width: 36em; }
.fit { margin-top: 72px; display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fit__col { padding: 32px 36px 36px; }
.fit__col + .fit__col { background: var(--grey); }
.list { margin-top: 18px; display: grid; gap: 12px; }
.list li { position: relative; padding-left: 34px; }
.list--yes li::before { content: ""; position: absolute; left: 0; top: .2em; width: 21px; height: 21px; background: url(../assets/brand/evcargo-icon.svg) center / contain no-repeat; }
.list--no li::before, .list--no li::after { content: ""; position: absolute; left: 3px; top: .72em; width: 16px; height: 2.5px; background: var(--muted); border-radius: 2px; transform: rotate(45deg); }
.list--no li::after { transform: rotate(-45deg); }
.fit__note { margin-top: 20px; font-size: .95rem; color: var(--muted); }

/* Servicios */
.services { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
.services__group { background: var(--white); border-radius: var(--radius); padding: 36px 40px 40px; }
.services__group--dark { background: var(--graphite); color: var(--white); display: flex; flex-direction: column; }
.services__group h3 { font-size: 1.5rem; padding-bottom: 20px; border-bottom: 4px solid var(--orange); }
.services dl > div { padding: 18px 0; border-bottom: 1px solid var(--line); }
.services__group--dark dl > div { border-bottom-color: rgba(255, 255, 255, .18); }
.services dl > div:last-child { border-bottom: 0; }
.services dt { font-weight: 700; font-size: 1.125rem; }
.services dd { margin-top: 4px; font-size: 1rem; }
.services__close { margin-top: auto; padding-top: 28px; font-size: 1.25rem; font-weight: 700; }

/* El almacén */
.warehouse { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.warehouse__main > p { margin-top: 18px; max-width: 36em; }
.rack { margin-top: 36px; }
.rack__control { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.rack__control label { font-weight: 700; }
.rack__control output { font-weight: 700; font-size: 1.5rem; min-width: 3.2ch; text-align: right; font-variant-numeric: tabular-nums; }
.rack input[type=range] { width: 100%; height: 44px; accent-color: var(--orange); cursor: pointer; }
.rack__grid {
  margin-top: 16px; padding: 4px 0 6px;
  display: grid; grid-template-columns: repeat(auto-fill, 12px); gap: 8px 3px; justify-content: space-between;
  background: repeating-linear-gradient(to bottom, transparent 0 14px, var(--orange) 14px 17px, transparent 17px 20px);
  background-position: 0 4px;
  border-left: 4px solid var(--graphite); border-right: 4px solid var(--graphite);
  padding-inline: 6px;
  border-bottom: 4px solid var(--graphite);
}
.rack__grid i { height: 12px; border-radius: 1px; background: #DDD9D7; transition: background-color .12s; }
.rack__grid i.on { background: var(--black); }
.rack__foot { margin-top: 28px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.rack__foot p { flex: 1 1 280px; }
.warehouse__photos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.warehouse__photos figure:nth-child(2) { margin-top: 56px; }
.warehouse__photos img { width: 100%; height: auto; border-radius: var(--radius); }
.warehouse__photos figcaption { margin-top: 10px; font-size: .9rem; color: var(--muted); }

/* Cómo funciona */
.flow { counter-reset: paso; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; border-top: 6px solid var(--orange); }
.flow li { counter-increment: paso; padding-top: 28px; position: relative; }
.flow li::before { content: counter(paso); display: block; font-size: 3rem; font-weight: 700; line-height: 1; color: var(--orange-dark); margin-bottom: 14px; }
.flow li::after { content: ""; position: absolute; top: -6px; left: 0; width: 6px; height: 22px; background: var(--graphite); }
.flow p { margin-top: 8px; font-size: 1rem; }

/* Grupo */
.group { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.group__copy p { margin-top: 22px; max-width: 32em; }
.group__slogan { font-style: italic; font-size: 1.5rem; color: var(--orange); }
.group__stats { display: grid; gap: 16px; }
.group__stats li { background: var(--card-dark); border-radius: var(--radius); padding: 26px 28px; font-size: 1.4rem; font-weight: 700; line-height: 1.25; }

/* Ubicación */
.location { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.location p { margin-top: 20px; max-width: 34em; }
.location__card { border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; }
.distance { display: flex; align-items: center; gap: 12px; }
.distance__a { width: 18px; height: 18px; border-radius: 3px; background: var(--orange); flex: none; }
.distance__line { flex: 1; height: 0; border-top: 3px dashed var(--line); position: relative; }
.distance__line b { position: absolute; left: 50%; top: -1px; transform: translate(-50%, -50%); background: var(--white); padding: 0 12px; font-size: 1.5rem; white-space: nowrap; }
.distance__b { width: 30px; height: 30px; fill: var(--graphite); flex: none; transform: rotate(90deg); }
.distance__labels { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; font-size: .875rem; color: var(--muted); }
.distance__labels span:last-child { text-align: right; }
.location address { margin: 28px 0 16px; font-style: normal; }

/* Preguntas */
.faq { display: grid; grid-template-columns: 4fr 8fr; gap: 64px; align-items: start; }
.faq > h2 { position: sticky; top: 128px; }
.faq__list { border-top: 4px solid var(--orange); }
.faq details { border-bottom: 1px solid #C9C5C4; }
.faq summary { cursor: pointer; list-style: none; padding: 22px 44px 22px 0; font-size: 1.2rem; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 18px; height: 3px; margin-top: -1.5px; background: var(--orange-dark); transition: transform .2s; }
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0); }
.faq details p { padding: 0 44px 24px 0; max-width: 44em; }

/* Cierre */
.closing { position: relative; isolation: isolate; color: var(--white); background: var(--black) url(../assets/img/almacen-pasillo.jpg) center 62% / cover no-repeat; }
.closing::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(26, 26, 26, .8); }
.closing__inner { padding: 112px 0; max-width: 44rem; margin-left: max(var(--gutter), calc((100% - var(--wrap)) / 2)); }
.closing p { margin-top: 20px; font-size: 1.2rem; }
.closing__actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px; }
.closing__contact { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 1.05rem !important; }
.closing__contact a { font-weight: 700; text-underline-offset: 4px; }

/* Pie */
.footer { background: var(--card-dark); color: #CFCCCB; padding: 48px 0 56px; font-size: .95rem; }
.footer__inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer p { margin-top: 18px; }
.footer nav { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.footer nav a { text-underline-offset: 4px; }

/* Barra fija en móvil */
.dock { display: none; }

/* Cookies */
.cookies { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 70; max-width: 720px; margin-inline: auto; background: var(--white); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 18px 20px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: .95rem; }
.cookies p { flex: 1 1 320px; }
.cookies div { display: flex; gap: 10px; }
.cookies a { color: var(--orange-dark); }

/* ---------- Página legal ---------- */
.legal { padding: 150px 0 96px; }
.legal .wrap { max-width: 46rem; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.legal h2 { font-size: 1.6rem; margin-top: 56px; padding-top: 20px; border-top: 4px solid var(--orange); }
.legal h3 { margin-top: 28px; }
.legal p, .legal ul { margin-top: 14px; }
.legal ul { list-style: disc; padding-left: 22px; }
.legal .draft { background: #FFF3E6; border-left: 4px solid var(--orange); padding: 14px 16px; border-radius: 4px; font-size: .95rem; }
.legal a { color: var(--orange-dark); }

/* ---------- Adaptación ---------- */
@media (max-width: 1100px) {
  .nav__links { display: none; }
  .nav__actions { margin-left: auto; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .hero__grid { gap: 40px; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); }
}

@media (max-width: 900px) {
  body { font-size: 17px; }
  [id] { scroll-margin-top: 92px; }
  .section { padding: 72px 0; }
  .hero { padding: 120px 0 40px; }
  .hero__grid, .split, .services, .warehouse, .group, .location, .faq { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero__copy { padding-top: 0; }
  .hero__lead { font-size: 1.1rem; }
  .hero__cta { display: inline-flex; }
  .hero__media::after { background: rgba(26, 26, 26, .78); }
  .facts { margin-top: 40px; }
  .fit { grid-template-columns: 1fr; margin-top: 48px; }
  .fit__col { padding: 28px 24px; }
  .services__group { padding: 28px 24px 32px; }
  .flow { grid-template-columns: 1fr 1fr; gap: 28px 24px; }
  .head { margin-bottom: 36px; }
  .closing__inner { padding: 80px 0; margin-inline: var(--gutter); }
  .warehouse__photos figure:nth-child(2) { margin-top: 32px; }
  .footer { padding-bottom: 110px; }
  .faq > h2 { position: static; }

  .dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: flex; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(34, 34, 34, .96);
    transform: translateY(110%); transition: transform .25s;
  }
  .dock.is-on { transform: none; }
  .dock .btn { flex: 1; min-height: 50px; }
  .dock__icon { width: 50px; height: 50px; flex: none; display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, .55); border-radius: var(--radius); }
  .dock__icon svg { width: 24px; height: 24px; fill: none; stroke: var(--white); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .nav { inset: 10px 0 auto 0; }
  .nav__bar { width: calc(100% - 20px); padding: 10px 10px 10px 16px; gap: 12px; }
  .nav__logo img { width: 128px; height: 28px; }
  .nav__phone span { display: none; }
  .nav__phone { width: 44px; height: 44px; justify-content: center; }
  .nav__actions { gap: 6px; }
  .nav .btn--sm { padding: 8px 12px; font-size: .95rem; white-space: nowrap; }
  .hero { padding-top: 104px; }
  .quote { padding: 22px 18px; }
  .step { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: 1fr; gap: 12px; }
  .facts li { padding: 18px; display: grid; grid-template-columns: 28px 1fr; column-gap: 14px; }
  .facts h3 { margin-top: 0; }
  .facts p { grid-column: 2; margin-top: 4px; }
  .flow { grid-template-columns: 1fr; gap: 4px; }
  .flow li { padding-top: 22px; }
  .flow li::after { display: none; }
  .flow li::before { font-size: 2.4rem; margin-bottom: 8px; }
  .group__stats li { font-size: 1.2rem; padding: 20px 22px; }
  .location__card { padding: 24px 20px; }
  .rack__grid { grid-template-columns: repeat(auto-fill, 9px); gap: 7px 2px; background: repeating-linear-gradient(to bottom, transparent 0 11px, var(--orange) 11px 13px, transparent 13px 16px); background-position: 0 4px; }
  .rack__grid i { height: 9px; }
  .closing__actions .btn { width: 100%; }
}

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