/* ============================================
   CEA NASSCAR SPORT — Tema de carreras (bandera a cuadros / rojo, azul, amarillo)
   Fondo claro, con el hero como única sección oscura (foto/video de fondo)
   Mobile-first
   ============================================ */

:root {
  --rojo: #e10600;
  --rojo-oscuro: #a80400;
  --azul: #0a3d91;
  --azul-oscuro: #072a66;
  --azul-claro: #1f5fd6;
  --amarillo: #ffc72c;
  --amarillo-oscuro: #e0a800;
  --negro: #0b0b0d;
  --carbon: #1a1a1d;
  --carbon-claro: #2a2a2e;
  --fondo: #ffffff;
  --fondo-alt: #f4f4f7;
  --tarjeta: #ffffff;
  --borde: #e5e5ea;
  --texto: #17171a;
  --texto-suave: #5b5b63;
  --blanco: #ffffff;
  --hueso: #f5f5f5;
  --exito: #1fae5f;
  --radio: 10px;
  --sombra: 0 8px 24px rgba(20, 20, 30, 0.08);
  --fuente: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --fuente-racing: 'Racing Sans One', var(--fuente);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--fuente);
  background: var(--fondo);
  color: var(--texto);
  line-height: 1.55;
}
img, video { max-width: 100%; display: block; }

/* --- Bandera a cuadros: franja divisoria entre secciones --- */
.franja-cuadros {
  height: 10px;
  background-image:
    linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%, #000),
    linear-gradient(45deg, #000 25%, #fff 25%, #fff 75%, #000 75%, #000);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

/* --- Barra tricolor bajo los títulos de sección --- */
h2.titulo-seccion {
  font-family: var(--fuente-racing);
  font-weight: 400;
  letter-spacing: .02em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 16px;
  color: var(--texto);
}
h2.titulo-seccion::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--rojo) 0 33%, var(--amarillo) 33% 66%, var(--azul) 66% 100%);
}
h2.titulo-seccion.alinear-izq::after { left: 0; transform: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
p { margin: 0 0 14px; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
section { padding: 56px 0; }
.text-center { text-align: center; }

/* --- Botones --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radio);
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-whatsapp {
  background: #25D366;
  color: #06210f;
}
.btn-whatsapp:hover { background: #1fb659; box-shadow: 0 6px 18px rgba(37,211,102,.35); }
.btn-primario {
  background: var(--rojo);
  color: var(--blanco);
}
.btn-primario:hover { background: var(--rojo-oscuro); box-shadow: 0 6px 18px rgba(225,6,0,.35); }
.btn-outline {
  background: transparent;
  border-color: var(--rojo);
  color: var(--texto);
}
.btn-outline:hover { background: var(--rojo); color: var(--blanco); }
.btn-bloque { width: 100%; }
.btn-sm { padding: 10px 18px; font-size: 0.9rem; }

/* --- Barra de urgencia --- */
.barra-urgencia-wrap { position: sticky; top: 0; z-index: 60; }
.barra-urgencia {
  background: var(--rojo);
  color: var(--blanco);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  padding: 10px 14px;
}
.barra-urgencia .container { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* --- Hero (fondo blanco; si hay foto/video, se difumina hacia blanco abajo) --- */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  background: var(--fondo);
  overflow: hidden;
  border-bottom: 6px solid;
  border-image: linear-gradient(90deg, var(--rojo), var(--amarillo), var(--azul)) 1;
}
.hero-fondo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.75) 55%, var(--fondo) 85%);
}
.hero-contenido { position: relative; z-index: 2; padding-bottom: 48px; width: 100%; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--fondo-alt);
  border: 1px solid var(--amarillo-oscuro);
  color: var(--texto);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  margin-bottom: 16px;
  box-shadow: var(--sombra);
}
.hero-badge .franja-cuadros { width: 22px; height: 16px; border-radius: 999px; flex: none; }
.hero h1 {
  font-family: var(--fuente-racing);
  font-weight: 400;
  letter-spacing: .01em;
  font-size: 2rem;
  color: var(--texto);
}
.hero p.subtitulo { font-size: 1.05rem; color: var(--texto-suave); max-width: 560px; }
.hero-ctas { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }

/* --- Prueba social --- */
.prueba-social { background: var(--fondo-alt); border-bottom: 1px solid var(--borde); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  text-align: center;
}
.stat-num { font-family: var(--fuente-racing); font-weight: 400; font-size: 2.1rem; color: var(--rojo); }
.stats-grid > div:nth-child(2) .stat-num { color: var(--amarillo-oscuro); }
.stats-grid > div:nth-child(3) .stat-num { color: var(--azul-claro); }
.stats-grid > div:nth-child(4) .stat-num { color: var(--rojo); }
.stat-label { font-size: 0.85rem; color: var(--texto-suave); }

/* --- Cursos --- */
.cursos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.curso-card {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-top: 4px solid var(--rojo);
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra);
  display: flex;
  flex-direction: column;
}
.curso-card[data-categoria="B1"] { border-top-color: var(--azul-claro); }
.curso-card[data-categoria="C1"] { border-top-color: var(--amarillo); }
.curso-card[data-categoria="combo"] { border-top: 4px solid; border-image: linear-gradient(90deg, var(--rojo), var(--amarillo), var(--azul-claro)) 1; }
.curso-card__img { height: 190px; background: var(--fondo-alt); }
.curso-card__img img { width: 100%; height: 100%; object-fit: cover; }
.curso-card__body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.curso-card__categoria {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--fuente-racing);
  font-weight: 400;
  background: var(--rojo);
  color: var(--blanco);
  font-size: 0.78rem;
  letter-spacing: .04em;
  padding: 4px 12px;
  border-radius: 6px;
  text-transform: uppercase;
}
.curso-card[data-categoria="B1"] .curso-card__categoria { background: var(--azul-claro); }
.curso-card[data-categoria="C1"] .curso-card__categoria { background: var(--amarillo); color: #1a1300; }
.curso-card[data-categoria="combo"] .curso-card__categoria { background: linear-gradient(90deg, var(--rojo), var(--amarillo-oscuro), var(--azul-claro)); }
.curso-card__gancho { color: var(--texto); font-size: 0.95rem; }
.curso-card__meta { display: flex; gap: 16px; font-size: 0.82rem; color: var(--texto-suave); }
.curso-card__incluye { font-size: 0.85rem; color: var(--texto-suave); }
.curso-card__incluye ul { margin: 0; padding-left: 18px; }
.curso-card__cta { margin-top: auto; }

/* --- Sección CALE --- */
.cale { background: var(--fondo-alt); border-top: 1px solid var(--borde); border-bottom: 1px solid var(--borde); }
.cale h2 { color: var(--rojo); }
.cale-caja {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-left: 4px solid var(--rojo);
  padding: 20px;
  border-radius: var(--radio);
  margin: 20px 0;
  font-size: 0.95rem;
  box-shadow: var(--sombra);
}

/* --- Galería --- */
.galeria-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.galeria-tab {
  background: var(--fondo-alt);
  border: 1px solid var(--borde);
  color: var(--texto);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.galeria-tab.activo { background: var(--rojo); border-color: var(--rojo); color: var(--blanco); }
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.galeria-item { position: relative; border-radius: var(--radio); overflow: hidden; aspect-ratio: 4/3; background: var(--fondo-alt); cursor: pointer; border: 1px solid var(--borde); }
.galeria-item img, .galeria-item video { width: 100%; height: 100%; object-fit: cover; }
.galeria-item__play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35); font-size: 2rem; color: #fff;
}

/* --- Cómo funciona --- */
.pasos { display: flex; flex-direction: column; gap: 18px; }
.paso { display: flex; gap: 16px; align-items: flex-start; }
.paso-num {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--rojo);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fuente-racing);
  font-weight: 400;
  font-size: 1.1rem;
}
.paso:nth-child(3n+2) .paso-num { background: var(--azul-claro); }
.paso:nth-child(3n+3) .paso-num { background: var(--amarillo); color: #1a1300; }
.paso p { color: var(--texto-suave); }

/* --- Testimonios --- */
.testimonios { background: var(--fondo-alt); }
.testimonio-card {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--sombra);
}
.testimonio-estrellas { color: #e0a800; margin-bottom: 8px; }
.testimonio-nombre { font-weight: 700; margin-top: 8px; }

/* --- Formulario contacto --- */
.form-contacto {
  background: var(--fondo-alt);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-contacto input, .form-contacto select, .form-contacto textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--borde);
  background: var(--blanco);
  color: var(--texto);
  font-family: inherit;
  font-size: 0.95rem;
}
.form-contacto label { font-size: 0.85rem; color: var(--texto-suave); margin-bottom: 4px; display: block; }
.form-msg { font-size: 0.9rem; padding: 10px 12px; border-radius: 8px; display: none; }
.form-msg.ok { display: block; background: rgba(31,174,95,.12); color: #157a41; }
.form-msg.error { display: block; background: rgba(225,6,0,.1); color: var(--rojo-oscuro); }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; }

/* --- Footer --- */
footer { background: var(--fondo); padding-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; padding-top: 24px; }
.footer-col h3 { font-family: var(--fuente-racing); font-weight: 400; letter-spacing: .02em; text-transform: uppercase; font-size: 1rem; color: var(--rojo); }
.footer-col p { color: var(--texto-suave); }
.footer-redes { display: flex; gap: 12px; margin-top: 10px; }
.footer-redes a { color: var(--azul-claro); font-weight: 600; }
.footer-mapa { border-radius: var(--radio); overflow: hidden; border: 1px solid var(--borde); }
.footer-bottom { text-align: center; font-size: 0.8rem; color: var(--texto-suave); padding: 20px 0; border-top: 1px solid var(--borde); margin-top: 24px; }

/* --- Botón flotante WhatsApp --- */
.wsp-flotante {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  background: #25D366;
  color: #06210f;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  font-size: 1.8rem;
  animation: pulso 2.4s infinite;
}
@keyframes pulso {
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,.5); }
  70% { box-shadow: 0 0 0 14px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* --- Utilidades responsive --- */
@media (min-width: 640px) {
  .hero h1 { font-size: 2.6rem; }
  .hero-ctas { flex-direction: row; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .cursos-grid { grid-template-columns: repeat(2, 1fr); }
  .galeria-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  section { padding: 80px 0; }
  .hero h1 { font-size: 3.2rem; }
  .cursos-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .paso { align-items: center; }
}
