/* Hero de Inicio — Automotora. Mundo visual propio (siempre oscuro), independiente del tema. */

.ca-hero {
  --h-void: #0B0D2A;
  --h-void-2: #161936;
  --h-ink: #FFFFFF;
  --h-ink-60: #AFB1C7;
  --h-accent: #ED1C24;
  --h-accent-dim: #C62430;
  --h-line: rgba(255, 255, 255, 0.16);

  position: relative;
  width: 100%;
  min-height: clamp(560px, 82vh, 820px);
  max-height: clamp(560px, 82vh, 820px);
  flex: 0 0 auto;
  background: var(--h-void);
  color: var(--h-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}

.ca-hero * { box-sizing: border-box; }
.ca-hero :focus-visible { outline: 2px solid var(--h-accent); outline-offset: 3px; }

/* foto de fondo, a todo el ancho */
.ca-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.ca-hero__bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
  animation: ca-hero-zoom 26s ease-in-out infinite alternate;
}
@keyframes ca-hero-zoom {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

/* atmosphere — oscurece de izquierda a derecha para que el texto
   quede legible y la foto se vea limpia del lado derecho */
.ca-hero__atmosphere {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 82% 10%, rgba(237, 28, 36, 0.10), transparent 55%),
    linear-gradient(100deg, rgba(11, 13, 42, 0.95) 0%, rgba(11, 13, 42, 0.88) 28%, rgba(11, 13, 42, 0.60) 52%, rgba(11, 13, 42, 0.22) 74%, rgba(11, 13, 42, 0.06) 92%);
}
.ca-hero__sweep {
  position: absolute;
  top: -20%;
  left: -30%;
  width: 55%;
  height: 140%;
  background: linear-gradient(100deg, transparent, rgba(247, 243, 236, 0.05) 45%, transparent 70%);
  transform: rotate(8deg);
  animation: ca-hero-sweep 14s ease-in-out infinite;
}
@keyframes ca-hero-sweep {
  0%, 100% { transform: translateX(0) rotate(8deg); }
  50% { transform: translateX(240%) rotate(8deg); }
}

/* caja centrada que acota auto + contenido en pantallas muy anchas;
   el fondo (atmosphere/tread/sweep) queda afuera, a pantalla completa.
   position:absolute + inset:0 la ata exactamente al tamaño de .ca-hero,
   sin ambigüedad de flex anidado (eso era lo que estaba estirando la altura). */
.ca-hero__inner {
  position: absolute;
  inset: 0;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

/* content */
.ca-hero__content {
  position: relative;
  z-index: 2;
  padding: 140px 40px 64px;
  max-width: 640px;
}
.ca-hero__eyebrow {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--h-ink);
  margin: 0 0 16px;
  opacity: 0;
}
.ca-hero__title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 30px;
  text-wrap: balance;
  opacity: 0;
  color: var(--h-ink);
}
.ca-hero__cta { opacity: 0; margin: 0 0 30px; display: flex; gap: 14px; flex-wrap: wrap; }
.ca-hero__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 15px 30px;
  border-radius: 4px;
  border: 1.5px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.ca-hero__btn--solid {
  background: var(--h-accent);
  color: var(--h-ink);
}
.ca-hero__btn--solid:hover { background: var(--h-accent-dim); }
.ca-hero__btn--outline {
  background: transparent;
  color: var(--h-ink);
  border-color: var(--h-ink);
}
.ca-hero__btn--outline:hover { background: rgba(255, 255, 255, 0.1); }
.ca-hero__btn svg { width: 15px; height: 15px; transition: transform 0.18s ease; }
.ca-hero__btn:hover svg { transform: translateX(3px); }

/* buscador embebido */
.ca-hero__search {
  opacity: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--h-accent);
  border: none;
  border-radius: 6px;
  max-width: 560px;
  overflow: hidden;
  box-shadow: 0 18px 34px -16px rgba(237, 28, 36, 0.5);
}
.ca-hero__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 18px;
  flex: 1;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
  min-width: 0;
}
.ca-hero__field:last-of-type { border-right: none; }
.ca-hero__field label {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}
.ca-hero__field select,
.ca-hero__field input {
  background: none;
  border: none;
  color: var(--h-ink);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  padding: 0;
  width: 100%;
  font-family: inherit;
}
.ca-hero__field select:focus,
.ca-hero__field input:focus { outline: none; }
.ca-hero__field input::placeholder { color: rgba(255, 255, 255, 0.75); }
.ca-hero__field select option { background: var(--h-accent-dim); color: var(--h-ink); }

.ca-hero__submit {
  flex: none;
  width: 52px;
  height: auto;
  min-height: 0;
  background: var(--h-accent-dim);
  border: none;
  box-shadow: none;
  border-radius: 0;
  margin: 0;
  color: var(--h-ink);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease;
}
.ca-hero__submit:hover,
.ca-hero__submit:focus { background: #A31D27; color: var(--h-ink); }
.ca-hero__submit svg {
  width: 17px;
  height: 17px;
  flex: none;
  display: block;
  overflow: visible;
}

/* WhatsApp flotante — fijo a la ventana, no solo al hero */
.ca-hero-wa {
  position: fixed;
  z-index: 999;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: scale(0.6);
}
.ca-hero-wa svg { width: 27px; height: 27px; fill: #0B2E17; }

/* entrada escalonada */
.ca-hero.is-live .ca-hero__eyebrow  { animation: ca-hero-rise 0.7s cubic-bezier(.16,.84,.44,1) 0.15s forwards; }
.ca-hero.is-live .ca-hero__title    { animation: ca-hero-rise 0.8s cubic-bezier(.16,.84,.44,1) 0.30s forwards; }
.ca-hero.is-live .ca-hero__cta      { animation: ca-hero-rise 0.7s cubic-bezier(.16,.84,.44,1) 0.64s forwards; }
.ca-hero.is-live .ca-hero__search   { animation: ca-hero-rise 0.7s cubic-bezier(.16,.84,.44,1) 0.80s forwards; }
.is-live-wa .ca-hero-wa             { animation: ca-hero-pop 0.5s cubic-bezier(.34,1.56,.64,1) 1.0s forwards; }

@keyframes ca-hero-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ca-hero-pop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .ca-hero__sweep,
  .ca-hero__bg img { animation: none !important; }
  .ca-hero.is-live .ca-hero__eyebrow,
  .ca-hero.is-live .ca-hero__title,
  .ca-hero.is-live .ca-hero__cta,
  .ca-hero.is-live .ca-hero__search,
  .is-live-wa .ca-hero-wa {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 1100px) and (min-width: 781px) {
  .ca-hero__content { max-width: 54%; }
}

@media (max-width: 640px) {
  .ca-hero__content { padding: 110px 22px 70px; max-width: 100%; }
  .ca-hero__search { flex-direction: column; max-width: 100%; }
  .ca-hero__field { border-right: none; border-bottom: 1px solid var(--h-line); }
  .ca-hero__field:last-of-type { border-bottom: none; }
  .ca-hero__submit { width: 100%; padding: 12px 0; }
  .ca-hero-wa { right: 16px; bottom: 16px; }
  .ca-hero__atmosphere {
    background:
      linear-gradient(180deg, rgba(11, 13, 42, 0.35) 0%, rgba(11, 13, 42, 0.75) 55%, rgba(11, 13, 42, 0.92) 100%),
      linear-gradient(100deg, rgba(11, 13, 42, 0.92) 0%, rgba(11, 13, 42, 0.55) 55%, rgba(11, 13, 42, 0.25) 100%);
  }
}
