/* ============================================================
   RPH MOTORS - Sistema de diseno
   Paleta derivada del logo: carbon, cromo y tricolor aleman.
   ============================================================ */

:root {
  /* Base */
  --carbon-900: #0b0c0e;
  --carbon-800: #121417;
  --carbon-700: #1a1d21;
  --carbon-600: #24282d;
  --carbon-500: #33383e;

  /* Cromo / plata */
  --chrome-100: #f5f7f8;
  --chrome-200: #dfe3e7;
  --chrome-300: #b9c0c7;
  --chrome-400: #8b939b;

  /* Acentos (bandera alemana) */
  --red: #c8102e;
  --red-light: #e4243f;
  --gold: #f0b323;

  /* Semanticos */
  --bg: var(--carbon-900);
  --surface: var(--carbon-800);
  --surface-alt: var(--carbon-700);
  --border: rgba(255, 255, 255, .08);
  --text: var(--chrome-100);
  --text-muted: var(--chrome-400);

  --gradient-chrome: linear-gradient(160deg, #ffffff 0%, #dfe3e7 40%, #9aa1a9 55%, #f2f4f6 100%);
  --gradient-red: linear-gradient(135deg, var(--red) 0%, var(--red-light) 100%);

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --maxw: 1180px;
  --nav-h: 76px;

  --font-display: "Barlow Condensed", "Oswald", Impact, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(.16, .84, .44, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Tipografia ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .01em;
  text-transform: uppercase;
}
h1 { font-size: clamp(2.6rem, 7vw, 5rem); }
h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

p { color: var(--text-muted); }

/* ---------- Utilidades ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.section { padding: clamp(72px, 10vw, 128px) 0; }
.section--alt { background: var(--surface); }

/* ---------- Seccion clara ----------
   Redefine los tokens semanticos en el propio bloque, asi los componentes
   se adaptan solos sin duplicar reglas.
------------------------------------------------------------------------ */
.section--light {
  --surface-alt: #f2f4f6;
  --border: rgba(11, 12, 14, .10);
  --text: var(--carbon-900);
  --text-muted: #5a626a;
  --gold: #a2760c;            /* dorado oscurecido para contraste sobre blanco */
  background: #ffffff;
  color: var(--text);
}
.section--light h1,
.section--light h2,
.section--light h3,
.section--light h4 { color: var(--carbon-900); }

.section--light .card { box-shadow: 0 4px 16px rgba(11, 12, 14, .05); }
.section--light .card:hover {
  background: #ffffff;
  border-color: rgba(11, 12, 14, .18);
  box-shadow: 0 18px 36px rgba(11, 12, 14, .10);
}
.section--light .card__icon { background: rgba(200, 16, 46, .09); color: var(--red); }

.section--light .brand-chip { color: var(--carbon-500); }
.section--light .brand-chip:hover {
  color: var(--carbon-900);
  background: rgba(240, 179, 35, .16);
}

.section--light .feature__mark { background: rgba(200, 16, 46, .10); color: var(--red); }
.section--light .step::before { color: rgba(11, 12, 14, .07); }

.section--light .split__media,
.section--light .gallery__item { background: linear-gradient(140deg, #eef1f3, #dfe4e8); }

.section--light .cta {
  background: linear-gradient(120deg, #f7f9fa 0%, #eef1f3 100%);
}
.section--light .cta::before { background: radial-gradient(circle, rgba(200,16,46,.10) 0%, transparent 70%); }

.section--light .btn--ghost { border-color: rgba(11, 12, 14, .22); color: var(--carbon-900); }
.section--light .btn--ghost:hover { border-color: var(--red); color: var(--red); }

.section-head { max-width: 660px; margin-bottom: 56px; }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--red);
}
.section-head--center .eyebrow::before { display: none; }

.lead { font-size: 1.05rem; margin-top: 16px; }

.chrome-text {
  background: var(--gradient-chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Franja tricolor reutilizable */
.tricolor {
  height: 4px;
  background: linear-gradient(90deg,
      var(--carbon-500) 0 33.33%,
      var(--red) 33.33% 66.66%,
      var(--gold) 66.66% 100%);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--gradient-red);
  color: #fff;
  box-shadow: 0 10px 26px rgba(200, 16, 46, .32);
}
.btn--primary:hover { box-shadow: 0 16px 34px rgba(200, 16, 46, .45); }

.btn--ghost {
  border: 1px solid rgba(255, 255, 255, .22);
  color: var(--text);
  backdrop-filter: blur(6px);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ============================================================
   NAVEGACION
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background-color .35s var(--ease), box-shadow .35s var(--ease);
}
.nav.is-scrolled {
  background: rgba(11, 12, 14, .88);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}
.nav__brand { display: flex; align-items: center; gap: 12px; }
.nav__brand img { width: 46px; height: 46px; }
.nav__brand-text {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1;
}
.nav__brand-text small {
  display: block;
  font-size: .58rem;
  letter-spacing: .38em;
  color: var(--text-muted);
  font-weight: 500;
}

.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links a {
  position: relative;
  font-size: .9rem;
  font-weight: 500;
  color: var(--chrome-200);
  transition: color .2s;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--red);
  transition: width .25s var(--ease);
}
.nav__links a:hover { color: #fff; }
.nav__links a:hover::after { width: 100%; }

.nav__toggle { display: none; padding: 8px; }
.nav__toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  transition: transform .3s var(--ease), opacity .2s;
}
.nav__toggle span + span { margin-top: 6px; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  /* El padding inferior garantiza aire entre los botones y la franja
     tricolor, incluso en pantallas de poca altura. */
  padding-top: calc(var(--nav-h) + 24px);
  padding-bottom: clamp(72px, 12vh, 132px);
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    /* Velo lateral: protege la lectura del texto sobre el lado izquierdo */
    linear-gradient(100deg,
      rgba(11, 12, 14, .95) 0%,
      rgba(11, 12, 14, .88) 30%,
      rgba(11, 12, 14, .68) 48%,
      rgba(11, 12, 14, .28) 68%,
      rgba(11, 12, 14, .06) 100%),
    /* Velo inferior: funde la foto con la franja tricolor */
    linear-gradient(to top,
      rgba(11, 12, 14, .92) 0%,
      rgba(11, 12, 14, .22) 24%,
      transparent 48%),
    /* Foto del hero. La ruta es relativa a ESTE archivo, no al HTML. */
    url("../img/hero.jpg"),
    radial-gradient(circle at 70% 40%, #2a2f36 0%, #0b0c0e 70%);
  background-size: cover;
  background-position: center;
  /* La foto es muy saturada y clara para una paleta de carbon y cromo */
  filter: saturate(.82) contrast(1.06);
}

/* En pantallas anchas la foto se encuadra hacia el motor y el mecanico */
@media (min-width: 1200px) {
  .hero__media { background-position: center right; }
}

/* En movil el texto ocupa todo el ancho, asi que el velo pasa a ser vertical */
@media (max-width: 768px) {
  .hero__media {
    background:
      linear-gradient(to bottom,
        rgba(11, 12, 14, .90) 0%,
        rgba(11, 12, 14, .74) 45%,
        rgba(11, 12, 14, .93) 100%),
      url("../img/hero.jpg"),
      radial-gradient(circle at 70% 40%, #2a2f36 0%, #0b0c0e 70%);
    background-size: cover;
    background-position: center;
  }
}
.hero__glow {
  position: absolute;
  z-index: -1;
  width: 620px; height: 620px;
  right: -140px; top: 12%;
  background: radial-gradient(circle, rgba(200,16,46,.22) 0%, transparent 68%);
  filter: blur(30px);
  pointer-events: none;
}
.hero__content { max-width: 720px; }
.hero h1 {
  margin-bottom: 22px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .55);
}
.hero h1 span { display: block; }
.hero__sub {
  font-size: 1.12rem;
  max-width: 46ch;
  margin-bottom: 36px;
  color: var(--chrome-200);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .7);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ============================================================
   SERVICIOS
   ============================================================ */
.grid-services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 20px;
}
.card {
  position: relative;
  padding: 34px 28px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s, background-color .35s;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--gradient-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, .16);
  background: var(--carbon-600);
}
.card:hover::before { transform: scaleX(1); }

.card__icon {
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(200, 16, 46, .12);
  color: var(--red-light);
  margin-bottom: 22px;
}
.card__icon svg { width: 26px; height: 26px; }
.card h3 { margin-bottom: 10px; }
.card p { font-size: .95rem; }

/* ============================================================
   MARCAS
   ============================================================ */
.brands {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.brand-chip {
  padding: 12px 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--chrome-300);
  transition: color .25s, border-color .25s, background-color .25s;
}
.brand-chip:hover {
  color: #fff;
  border-color: var(--gold);
  background: rgba(240, 179, 35, .08);
}

/* ============================================================
   PROCESO
   ============================================================ */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 32px;
  counter-reset: step;
}
.step { position: relative; padding-top: 26px; }
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  top: -18px; left: -4px;
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .06);
  line-height: 1;
}
.step h3 { margin-bottom: 8px; position: relative; }
.step p { font-size: .95rem; }

/* ============================================================
   NOSOTROS
   ============================================================ */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(36px, 6vw, 72px);
  align-items: center;
}
.split__media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(140deg, var(--carbon-600), var(--carbon-800));
  border: 1px solid var(--border);
}
.split__media img { width: 100%; height: 100%; object-fit: cover; }
.split__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: linear-gradient(90deg,
      var(--carbon-500) 0 33.33%,
      var(--red) 33.33% 66.66%,
      var(--gold) 66.66% 100%);
}

.features { display: grid; gap: 20px; margin-top: 30px; }
.feature { display: flex; gap: 16px; }
.feature__mark {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(240, 179, 35, .14);
  color: var(--gold);
  font-size: .8rem;
  margin-top: 3px;
}
.feature h4 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 2px;
}
.feature p { font-size: .92rem; }

/* ============================================================
   GALERIA
   ============================================================ */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.gallery__item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(140deg, var(--carbon-600), var(--carbon-800));
  border: 1px solid var(--border);
}
.gallery__item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.gallery__item:hover img { transform: scale(1.07); }

/* ============================================================
   CTA
   ============================================================ */
.cta {
  position: relative;
  padding: clamp(56px, 8vw, 88px) clamp(28px, 5vw, 64px);
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--carbon-700) 0%, var(--carbon-800) 100%);
  border: 1px solid var(--border);
  overflow: hidden;
  text-align: center;
}
.cta::before {
  content: "";
  position: absolute;
  width: 480px; height: 480px;
  left: -120px; top: -180px;
  background: radial-gradient(circle, rgba(200,16,46,.20) 0%, transparent 70%);
  pointer-events: none;
}
.cta > * { position: relative; }
.cta p { max-width: 56ch; margin: 16px auto 32px; }

/* ============================================================
   CONTACTO
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 44px;
}
.info-list { display: grid; gap: 26px; margin-top: 8px; }
.info-item { display: flex; gap: 16px; }
.info-item__icon {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--gold);
}
.info-item__icon svg { width: 20px; height: 20px; }
.info-item h4 {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.info-item a, .info-item span { color: var(--text); font-size: 1.02rem; }
.info-item a:hover { color: var(--gold); }

/* Bloque de acciones (reemplaza al formulario) */
.actions {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: clamp(28px, 4vw, 40px);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.actions h3 { margin-bottom: 4px; }
.actions p { font-size: .95rem; margin-bottom: 14px; }
.actions .btn { width: 100%; }
.actions__note {
  font-size: .82rem;
  margin-top: 6px;
  margin-bottom: 0;
}

.map {
  margin-top: 56px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  filter: grayscale(1) contrast(1.05) brightness(.82);
  transition: filter .4s var(--ease);
}
.map:hover { filter: none; }
.map iframe { display: block; width: 100%; height: 380px; border: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--carbon-800); padding-top: 64px; }
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 44px;
  padding-bottom: 48px;
}
.footer__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.footer__brand img { width: 52px; height: 52px; }
.footer h4 {
  font-family: var(--font-display);
  font-size: .95rem;
  letter-spacing: .18em;
  margin-bottom: 18px;
  color: var(--chrome-200);
}
.footer ul { display: grid; gap: 11px; }
.footer li a { font-size: .93rem; color: var(--text-muted); transition: color .2s; }
.footer li a:hover { color: var(--gold); }

.socials { display: flex; gap: 12px; margin-top: 22px; }
.socials a {
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--chrome-300);
  transition: color .25s, border-color .25s, transform .25s var(--ease);
}
.socials a:hover { color: var(--gold); border-color: var(--gold); transform: translateY(-3px); }
.socials svg { width: 19px; height: 19px; }

.footer__bottom {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: .85rem;
  color: var(--text-muted);
}

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 90;
  width: 58px; height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #25d366;
  color: #062a12;
  box-shadow: 0 10px 28px rgba(37, 211, 102, .38);
  transition: transform .25s var(--ease);
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 30px; height: 30px; }

/* ---------- Animacion de entrada ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 12px 24px 28px;
    background: rgba(11, 12, 14, .98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform .4s var(--ease);
  }
  .nav__links.is-open { transform: none; }
  .nav__links a { width: 100%; padding: 14px 0; font-size: 1.05rem; }
  .nav__links .btn { width: 100%; margin-top: 10px; }

  .footer__grid { grid-template-columns: 1fr; gap: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
