/* ==========================================================
   Tramo Motor S.L. — "warm cards" brochure site
   Palette B (ochre) · slanted section dividers
   ========================================================== */

/* ---------- Design tokens ---------- */
:root {
  --site-primary: #e89b44;        /* brand ochre (backgrounds, accents) */
  --site-primary-deep: #8f5114;   /* darker ochre for white text (AA contrast) */
  --site-primary-soft: #fbe8d2;   /* light tone for hero chips / plates */
  --site-accent: #e8907a;         /* CTA */
  --site-on-primary: #2a1a0b;     /* text on ochre / accent */
  --site-bg: #fbf7f4;             /* warm off-white */
  --site-surface: #ffffff;
  --site-text: #2a221c;
  --site-muted: #6b5d52;
  --site-border: #eadfd5;
  --site-success: #2f7d4f;
  --site-warning: #a36a00;
  --site-error: #b3261e;
  --site-info: #2f5f8a;
  --site-notice-bg: #fde4dd;      /* rosy disclaimer plate */
  --site-notice-text: #6e2a1c;
  --site-img-fallback: linear-gradient(135deg, #f3dcc2, #e9c39a);

  --radius-card: 12px;
  --radius-btn: 8px;
  --container: 1100px;
  --section-y: clamp(72px, 9vw, 96px);
  --slant: 4.5vw;                 /* ≈ 2.6° slope for diagonal edges */
  --shadow: 0 1px 2px rgba(42, 26, 11, .06), 0 8px 24px rgba(42, 26, 11, .08);
  --shadow-hover: 0 2px 4px rgba(42, 26, 11, .08), 0 16px 36px rgba(42, 26, 11, .14);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --site-primary: #f0a654;
    --site-primary-deep: #5e3610;
    --site-primary-soft: #3a2a1b;
    --site-accent: #f09d88;
    --site-on-primary: #1f1308;
    --site-bg: #17130f;
    --site-surface: #221c17;
    --site-text: #f3ece6;
    --site-muted: #c3b4a7;
    --site-border: #3a3029;
    --site-success: #6fcf97;
    --site-warning: #f2c14e;
    --site-error: #ff8a80;
    --site-info: #8cbcea;
    --site-notice-bg: #3d2420;
    --site-notice-text: #ffcfc4;
    --site-img-fallback: linear-gradient(135deg, #3a2a1b, #5e3610);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    --shadow-hover: 0 2px 4px rgba(0,0,0,.35), 0 16px 36px rgba(0,0,0,.5);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--site-text);
  background: var(--site-bg);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(38px, 6vw, 58px); line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: clamp(28px, 3.6vw, 40px); }
h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
ul { padding-left: 1.2em; }
:focus-visible { outline: 3px solid var(--site-info); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--site-text); color: var(--site-bg);
  padding: 12px 16px; border-radius: var(--radius-btn); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.kicker {
  display: inline-block;
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--site-primary-deep); margin-bottom: 12px;
}
@media (prefers-color-scheme: dark) { .kicker { color: var(--site-primary); } }
.lead { font-size: 19px; color: var(--site-muted); max-width: 60ch; }
.small { font-size: 14px; color: var(--site-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px;
  border-radius: var(--radius-btn); border: 1px solid transparent;
  font: inherit; font-size: 16px; font-weight: 700; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--primary { background: var(--site-primary); color: var(--site-on-primary); }
.btn--accent { background: var(--site-accent); color: var(--site-on-primary); }
.btn--ghost { background: transparent; color: var(--site-text); border-color: currentColor; }
.btn--light { background: #fff; color: #2a1a0b; }
.btn--ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.8); }
.btn--sm { min-height: 44px; padding: 10px 14px; font-size: 15px; }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-weight: 800; text-decoration: none; color: var(--site-primary-deep);
}
.link:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (prefers-color-scheme: dark) { .link { color: var(--site-primary); } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--site-surface); border-bottom: 1px solid var(--site-border);
}
.site-header .container { max-width: 1240px; display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; flex-shrink: 0; }
.logo__mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--site-primary); color: var(--site-on-primary);
  display: grid; place-items: center; font-weight: 800; font-size: 17px;
}
.logo__text { display: flex; flex-direction: column; line-height: 1.05; }
.logo__name { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.logo__tag { font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--site-muted); }

.nav { margin: 0 auto; }
.nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; white-space: nowrap;
  border-radius: var(--radius-btn); text-decoration: none; font-weight: 600; font-size: 14px;
  color: var(--site-text);
}
.nav a:hover { background: var(--site-bg); }
.nav a[aria-current="page"] { background: var(--site-primary-soft); }
.header-cta { display: flex; gap: 8px; flex-shrink: 0; }

.burger {
  display: none; margin-left: auto;
  width: 44px; height: 44px; border-radius: var(--radius-btn);
  border: 1px solid var(--site-border); background: var(--site-surface); color: var(--site-text);
  cursor: pointer; align-items: center; justify-content: center;
}
.burger span, .burger span::before, .burger span::after {
  display: block; width: 18px; height: 2px; background: currentColor; position: relative; content: "";
}
.burger span::before { position: absolute; top: -6px; }
.burger span::after { position: absolute; top: 6px; }

.header-cta .btn { white-space: nowrap; }
@media (max-width: 1180px) {
  .burger { display: inline-flex; }
  .nav, .header-cta { display: none; }
  .site-header.is-open .nav,
  .site-header.is-open .header-cta {
    display: flex; position: absolute; left: 0; right: 0;
    background: var(--site-surface); padding: 12px 20px;
  }
  .site-header.is-open .nav { top: 64px; border-bottom: 1px solid var(--site-border); }
  .site-header.is-open .nav ul { flex-direction: column; width: 100%; }
  .site-header.is-open .header-cta { top: calc(64px + 5 * 48px + 24px); flex-wrap: wrap; border-bottom: 1px solid var(--site-border); box-shadow: var(--shadow); }
  .site-header.is-open .header-cta .btn { flex: 1 1 160px; }
}

/* ---------- Sections & bands ---------- */
.section { padding: var(--section-y) 0; }
.band--soft { background: var(--site-primary-soft); }
.band--primary { background: var(--site-primary-deep); color: #fff; }
.band--primary .kicker { color: #ffd9ae; }
.band--primary .lead, .band--primary .small { color: rgba(255,255,255,.85); }
.band--primary .card .kicker { color: var(--site-primary-deep); }
@media (prefers-color-scheme: dark) { .band--primary .card .kicker { color: var(--site-primary); } }
.band--ochre { background: var(--site-primary); color: var(--site-on-primary); }
.band--ochre .kicker { color: var(--site-on-primary); opacity: .8; }

/* Slanted edges: the clip-path cuts the top-left / bottom-right corners */
.slant {
  clip-path: polygon(0 var(--slant), 100% 0, 100% calc(100% - var(--slant)), 0 100%);
  padding-top: calc(var(--section-y) + var(--slant));
  padding-bottom: calc(var(--section-y) + var(--slant));
  margin: calc(var(--slant) * -0.5) 0;
  position: relative;
}
.slant--bottom {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--slant)), 0 100%);
  padding-bottom: calc(var(--section-y) + var(--slant));
}

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.section-head > div { max-width: 640px; }
.section-head h2 { margin-bottom: 0; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 calc(72px + var(--slant)); }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: 20px; }
.hero__text p { font-size: 19px; max-width: 54ch; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 16px; }
.hero__note { font-size: 13px; opacity: .85; max-width: 52ch; margin: 0; }
.hero__media { position: relative; padding: 8px 8px 40px; }
.frame {
  border: 8px solid var(--site-surface); border-radius: var(--radius-card);
  transform: rotate(1.5deg); box-shadow: 0 24px 48px rgba(42, 26, 11, .28);
  overflow: hidden; background: var(--site-img-fallback); aspect-ratio: 4 / 3.4;
}
.frame img { width: 100%; height: 100%; object-fit: cover; }
.hero__caption {
  position: absolute; left: -12px; bottom: 0; max-width: 300px;
  background: var(--site-surface); color: var(--site-text);
  border-radius: var(--radius-card); padding: 14px 18px; box-shadow: var(--shadow);
  font-size: 15px; line-height: 1.35;
}
.hero__caption strong { display: block; font-weight: 800; }
.band--ochre .btn--ghost { color: var(--site-on-primary); }
.band--ochre .btn--primary { background: var(--site-on-primary); color: #fff; }

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: 32px; }
  .hero__caption { left: 0; }
}

/* Compact hero for inner pages */
.page-hero { padding: 48px 0 calc(48px + var(--slant)); }
.page-hero h1 { font-size: clamp(34px, 5vw, 50px); max-width: 18ch; }
.page-hero .lead { color: inherit; opacity: .85; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 20px 0 0; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--site-border); background: var(--site-surface);
  color: var(--site-text); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--site-primary); }
.chip[aria-pressed="true"] { background: var(--site-primary); border-color: var(--site-primary); color: var(--site-on-primary); }

/* ---------- Process strip ---------- */
.process { display: grid; grid-template-columns: repeat(3, 1fr); }
.process__step { padding: 8px 32px; border-left: 1px solid rgba(255,255,255,.3); }
.process__step:first-child { border-left: 0; padding-left: 0; }
.process__num { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: #ffd9ae; }
.process__step h3 { font-size: 22px; margin: 12px 0 6px; }
.process__step p { margin: 0; color: rgba(255,255,255,.85); }
@media (max-width: 760px) {
  .process { grid-template-columns: 1fr; gap: 28px; }
  .process__step { border-left: 0; border-top: 1px solid rgba(255,255,255,.3); padding: 24px 0 0; }
  .process__step:first-child { border-top: 0; padding-top: 0; }
}

/* ---------- Cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 960px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  display: flex; flex-direction: column; color: var(--site-text);
  background: var(--site-surface); border: 1px solid var(--site-border); border-radius: var(--radius-card);
  overflow: hidden; transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card[hidden] { display: none; }
.media { background: var(--site-img-fallback); aspect-ratio: 16 / 9; overflow: hidden; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media img.is-broken, .frame img.is-broken { visibility: hidden; }
.card__body { padding: 20px 22px 18px; display: flex; flex-direction: column; flex: 1; }
.card__body p { color: var(--site-muted); font-size: 16px; margin-bottom: 12px; }
.card__body .link { margin-top: auto; }
.card .kicker { margin-bottom: 8px; font-size: 11px; }

.counter { margin: 0 0 20px; font-weight: 600; color: var(--site-muted); }

/* Icon cards */
.icon-card {
  background: var(--site-surface); border: 1px solid var(--site-border); border-radius: var(--radius-card);
  padding: 22px;
}
.icon-card h3 { font-size: 18px; margin: 12px 0 6px; }
.icon-card p { margin: 0; color: var(--site-muted); font-size: 15px; }
.icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--site-primary-soft); color: var(--site-primary-deep);
  display: grid; place-items: center;
}
@media (prefers-color-scheme: dark) { .icon { color: var(--site-primary); } }
.icon svg { width: 22px; height: 22px; }

.split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 32px; } }

/* Scenario cards */
.scenarios { display: grid; gap: 14px; }
.scenario {
  display: grid; grid-template-columns: 56px 1fr; gap: 16px;
  background: var(--site-surface); border: 1px solid var(--site-border); border-radius: var(--radius-card); padding: 20px;
}
.scenario__num { font-size: 28px; font-weight: 800; color: var(--site-primary); line-height: 1; }
.scenario h3 { font-size: 18px; margin-bottom: 4px; }
.scenario p { margin: 0 0 4px; color: var(--site-muted); font-size: 15px; }

/* Disclaimer plate */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--site-notice-bg); color: var(--site-notice-text);
  border-radius: var(--radius-card); padding: 14px 18px; font-size: 15px; line-height: 1.45; margin-bottom: 24px;
}
.notice svg { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }

/* CTA card */
.cta-card {
  background: var(--site-primary-deep); color: #fff; border-radius: 16px;
  padding: clamp(28px, 5vw, 48px);
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center;
}
.cta-card .kicker { color: #ffd9ae; }
.cta-card p { color: rgba(255,255,255,.88); margin: 0; }
.cta-card__actions { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 760px) { .cta-card { grid-template-columns: 1fr; } }

/* Single-card guide teaser */
.teaser-card { background: var(--site-surface); color: var(--site-text); border-radius: var(--radius-card); overflow: hidden; }

/* ---------- Service rows (servicios.html) ---------- */
.service-row {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: start;
  padding: 48px 0; border-top: 1px solid var(--site-border);
}
.service-row:first-of-type { border-top: 0; }
.service-row .media { border-radius: var(--radius-card); aspect-ratio: 4 / 3; position: sticky; top: 88px; }
.service-row h2 { font-size: clamp(26px, 3vw, 34px); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0 24px; }
.fact { background: var(--site-surface); border: 1px solid var(--site-border); border-radius: var(--radius-card); padding: 16px; }
.fact h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
.fact ul { margin: 0; padding-left: 1.1em; font-size: 15px; color: var(--site-muted); }
.fact--yes h3 { color: var(--site-success); }
.fact--no h3 { color: var(--site-error); }
.fact--tip h3 { color: var(--site-info); }
@media (max-width: 960px) { .facts { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .service-row { grid-template-columns: 1fr; gap: 20px; }
  .service-row .media { position: static; }
}

/* ---------- Articles (guias.html, proyectos.html) ---------- */
.article {
  background: var(--site-surface); border: 1px solid var(--site-border); border-radius: var(--radius-card);
  overflow: hidden; margin-bottom: 32px;
}
.article .media { aspect-ratio: 21 / 8; }
.article__body { padding: clamp(22px, 4vw, 40px); max-width: 780px; }
.article__body h2 { font-size: clamp(26px, 3vw, 34px); }
.article__body h3 { margin-top: 1.4em; font-size: 18px; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.steps3 > div { background: var(--site-bg); border-radius: var(--radius-card); padding: 16px; }
.steps3 h3 { margin-top: 0 !important; font-size: 13px !important; text-transform: uppercase; letter-spacing: .1em; color: var(--site-muted); }
.steps3 ul { margin: 0; font-size: 15px; }
@media (max-width: 760px) { .steps3 { grid-template-columns: 1fr; } }

/* ---------- Form (presupuesto.html) ---------- */
.builder { display: grid; grid-template-columns: 1.25fr .75fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .builder { grid-template-columns: 1fr; } }
.panel { background: var(--site-surface); border: 1px solid var(--site-border); border-radius: var(--radius-card); padding: clamp(20px, 3vw, 32px); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label, .field legend { font-weight: 700; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--site-muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  font: inherit; font-size: 16px; color: var(--site-text); background: var(--site-bg);
  border: 1px solid var(--site-border); border-radius: var(--radius-btn);
  min-height: 48px; padding: 10px 12px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--site-info); }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.check {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--site-border); border-radius: 999px; background: var(--site-bg); cursor: pointer; font-size: 15px;
}
.check input { width: 18px; height: 18px; accent-color: var(--site-primary-deep); }
.preview {
  white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; line-height: 1.5;
  background: var(--site-bg); border: 1px dashed var(--site-border); border-radius: var(--radius-btn);
  padding: 16px; min-height: 180px; max-height: 420px; overflow: auto; margin: 0 0 16px;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.status { min-height: 1.6em; margin-top: 12px; font-weight: 600; color: var(--site-success); }
.status.is-error { color: var(--site-error); }
.side-card { position: sticky; top: 88px; display: grid; gap: 16px; }
.contact-list { list-style: none; padding: 0; margin: 0 0 8px; }
.contact-list li { margin-bottom: 6px; }

/* ---------- Legal pages ---------- */
.legal { max-width: 780px; }
.legal h2 { font-size: 24px; margin-top: 1.6em; }
.legal li { margin-bottom: 6px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--site-primary-deep); color: #fff; padding: 64px 0 24px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-grid h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 14px; color: #ffd9ae; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.footer-grid li a:hover { text-decoration: underline; }
.footer-grid p { color: rgba(255,255,255,.88); font-size: 15px; }
.site-footer .logo__mark { background: #fff; color: var(--site-primary-deep); }
.site-footer .logo__tag { color: rgba(255,255,255,.75); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.25); margin-top: 40px; padding-top: 20px; font-size: 14px; color: rgba(255,255,255,.85); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Cookie banner ---------- */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
  max-width: 720px; margin: 0 auto;
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  background: var(--site-surface); color: var(--site-text);
  border: 1px solid var(--site-border); border-radius: var(--radius-card); box-shadow: var(--shadow-hover);
  padding: 14px 16px 14px 20px; font-size: 15px;
}
.cookie[hidden] { display: none; }
.cookie p { margin: 0; }
@media (max-width: 560px) { .cookie { flex-direction: column; align-items: stretch; } }

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