/**
 * GLOBAL.CSS
 * Estilos base: tipografía, layout, utilidades y estructura común
 * (header, footer, botones, secciones). Mobile-first; los ajustes de
 * pantallas mayores viven en responsive.css.
 */

body {
  font-family: var(--font-base);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-background);
}

h1,
h2,
h3,
h4 {
  font-weight: var(--fw-black);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--fs-3xl);
}
h2 {
  font-size: var(--fs-2xl);
}
h3 {
  font-size: var(--fs-xl);
}
h4 {
  font-size: var(--fs-lg);
}

p {
  color: var(--color-text-muted);
}

.section--dark p,
.page-hero p,
.hero p {
  color: var(--color-text-muted-on-dark);
}

strong {
  font-weight: var(--fw-bold);
}

/* ---- Skip link (accesibilidad) ---- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-weight: var(--fw-semibold);
  z-index: 999;
  transition: top var(--t-fast);
}
.skip-link:focus {
  top: var(--space-4);
}

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.section {
  position: relative;
  padding-block: var(--space-9);
}

.section::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--color-accent);
}

.section--tight {
  padding-block: var(--space-7);
}

.section--dark {
  background: var(--color-background-dark);
  color: var(--color-text-on-dark);
}

.section--offwhite {
  background: var(--color-offwhite);
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  max-width: 680px;
  margin-inline: auto;
  text-align: center;
}

.section-head--title-only {
  margin-bottom: var(--space-7);
}

/* Eyebrow: pill/badge pequeño, mismo patrón repetido antes de cada sección */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
  border-radius: var(--radius-full);
  background: rgba(143, 112, 0, 0.1);
  border: 1px solid rgba(143, 112, 0, 0.22);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-contrast);
}

.eyebrow i {
  font-size: 0.85em;
}

.section--dark .eyebrow,
.page-hero .eyebrow,
.hero .eyebrow {
  color: var(--color-accent);
  background: rgba(255, 212, 0, 0.1);
  border-color: rgba(255, 212, 0, 0.28);
}

.section-title {
  font-size: var(--fs-2xl);
  text-transform: uppercase;
}

.section-title em,
h1 em {
  font-style: normal;
  color: var(--color-accent-contrast);
}

.section--dark .section-title em,
.page-hero .section-title em,
.hero .section-title em,
.section--dark h1 em,
.page-hero h1 em,
.hero h1 em {
  color: var(--color-accent);
}

.section-desc {
  color: var(--color-text-muted);
  font-style: italic;
  font-size: var(--fs-md);
  max-width: 60ch;
}

.section-head .section-desc {
  margin-top: calc(var(--space-2) * -1);
  margin-inline: auto;
}

.section--dark .section-desc,
.page-hero .section-desc,
.hero .section-desc {
  color: var(--color-text-muted-on-dark);
}

.text-center {
  text-align: center;
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Botones ---- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.95rem 1.85rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  transition: transform var(--t-fast) var(--ease), background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-base) var(--ease);
  min-height: 48px;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform var(--t-fast) var(--ease);
}

/* Brillo diagonal que recorre el botón al pasar el mouse */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 48%, transparent 66%);
  transform: translateX(-120%);
  transition: transform var(--t-slow) var(--ease);
}
.btn:hover::after {
  transform: translateX(120%);
}

.btn:hover {
  transform: translateY(-3px);
}

.btn:hover svg {
  transform: translateX(2px);
}

.btn:active {
  transform: scale(0.96) translateY(0);
}

.btn-primary {
  background: rgba(255, 212, 0, 0.82);
  color: var(--color-accent-ink);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--glass-highlight), 0 8px 22px -12px rgba(255, 212, 0, 0.5);
}
.btn-primary:hover {
  background: rgba(230, 191, 0, 0.92);
  box-shadow: var(--glass-highlight), 0 14px 28px -8px rgba(255, 212, 0, 0.55);
}

.btn-dark {
  background: rgba(10, 10, 10, 0.72);
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--glass-highlight-dark), 0 8px 22px -12px rgba(10, 10, 10, 0.4);
}
.btn-dark:hover {
  background: rgba(19, 19, 19, 0.85);
  box-shadow: var(--glass-highlight-dark), 0 14px 28px -10px rgba(10, 10, 10, 0.5);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.06);
  color: currentColor;
  border: 1.5px solid var(--color-border);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--color-accent);
  box-shadow: 0 10px 24px -10px rgba(10, 10, 10, 0.25);
}

.section--dark .btn-outline,
.page-hero .btn-outline,
.hero .btn-outline {
  border-color: var(--color-border-on-dark);
}
.section--dark .btn-outline:hover,
.page-hero .btn-outline:hover,
.hero .btn-outline:hover {
  border-color: var(--color-accent);
}

.btn-ghost {
  background: transparent;
  color: currentColor;
  padding-inline: var(--space-2);
  text-transform: none;
  font-weight: var(--fw-semibold);
  overflow: visible;
}
.btn-ghost::after {
  content: none;
}
.btn-ghost:hover {
  color: var(--color-accent-contrast);
  transform: none;
}

/* Anillo de pulso en los CTA de WhatsApp, para guiar el ojo hacia la acción principal */
@keyframes whatsapp-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}
.btn-whatsapp {
  background: rgba(37, 211, 102, 0.82);
  color: #04240f;
  border: 1px solid rgba(255, 255, 255, 0.4);
  animation: whatsapp-pulse 2.6s ease-out infinite;
}
.btn-whatsapp:hover {
  background: rgba(31, 185, 88, 0.92);
  animation-play-state: paused;
  box-shadow: var(--glass-highlight), 0 14px 28px -10px rgba(37, 211, 102, 0.55);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 1.1rem 2.25rem;
  font-size: var(--fs-sm);
}

/* ---- Links con flecha ---- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.link-arrow svg {
  width: 16px;
  height: 16px;
  transition: transform var(--t-fast);
}
.link-arrow:hover svg {
  transform: translateX(4px);
}

/* ---- Reveal on scroll ---- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--t-slow), transform var(--t-slow);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ================================================================
   HEADER
   ================================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--color-black);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 8px 32px -18px rgba(0, 0, 0, 0.5);
  color: var(--color-text-on-dark);
  transition: background-color var(--t-base) var(--ease), border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}

/* Sin backdrop-filter: un blur sobre un elemento sticky obliga al navegador a
   recalcular el desenfoque de todo el contenido detrás en cada frame de
   scroll — en mobile eso se nota como traba/freeze al deslizar. Se logra un
   efecto translúcido similar solo con degradé + opacidad, sin ese costo. */
.header--scrolled {
  background: linear-gradient(180deg, rgba(14, 14, 15, 0.97), rgba(8, 8, 8, 0.94));
  border-bottom-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 12px 32px -14px rgba(0, 0, 0, 0.6);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  height: var(--header-height-mobile);
}

.header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.header__logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.header__nav {
  display: none;
}

.header__cta {
  display: none;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header__menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--color-text-on-dark);
}
.header__menu-btn svg {
  width: 26px;
  height: 26px;
}
.header__menu-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Menú mobile */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: var(--color-black);
  color: var(--color-text-on-dark);
  display: flex;
  flex-direction: column;
  padding: var(--space-6) var(--container-padding) var(--space-8);
  transform: translateX(100%);
  transition: transform var(--t-slow);
  overflow-y: auto;
}
.mobile-nav.is-open {
  transform: translateX(0);
}

.mobile-nav__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.mobile-nav__close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.mobile-nav__close svg {
  width: 26px;
  height: 26px;
}
.mobile-nav__close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.mobile-nav__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.mobile-nav__links a {
  display: block;
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-on-dark);
}
.mobile-nav__links a.is-active {
  color: var(--color-accent);
}

.mobile-nav__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.mobile-nav__socials {
  display: flex;
  gap: var(--space-4);
}
.mobile-nav__socials a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-on-dark);
  border-radius: var(--radius-full);
}
.mobile-nav__socials svg {
  width: 20px;
  height: 20px;
}

body.nav-open {
  overflow: hidden;
}

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  background: var(--color-black);
  color: var(--color-text-on-dark);
  padding-block: var(--space-9) var(--space-6);
}

.footer__grid {
  display: grid;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.footer__logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.footer__wordmark {
  display: grid;
  gap: 0.1rem;
  line-height: 1;
  text-transform: uppercase;
}

.footer__wordmark strong {
  color: var(--color-text-on-dark);
  font-size: var(--fs-lg);
  letter-spacing: 0.1em;
}

.footer__wordmark span {
  color: var(--color-accent);
  font-size: 0.62rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.16em;
}

.footer__tagline {
  color: var(--color-text-muted-on-dark);
  max-width: 32ch;
}

.footer__heading {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: var(--fw-bold);
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__links a {
  color: var(--color-text-muted-on-dark);
  transition: color var(--t-fast);
}
.footer__links a:hover {
  color: var(--color-accent);
}

.footer__socials {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.footer__socials a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-on-dark);
  border-radius: var(--radius-full);
  transition: border-color var(--t-fast), color var(--t-fast);
}
.footer__socials a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.footer__socials svg {
  width: 18px;
  height: 18px;
}

.footer__bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border-on-dark);
  font-size: var(--fs-xs);
  color: var(--color-gray-400);
}

.footer__bottom a {
  color: var(--color-gray-400);
}
.footer__bottom a:hover {
  color: var(--color-accent);
}

.footer__credit,
.footer__credit a {
  color: var(--color-accent);
}

.footer__credit a {
  font-weight: var(--fw-bold);
  transition: color var(--t-fast), text-shadow var(--t-fast);
}

.footer__credit a:hover,
.footer__credit a:focus-visible {
  color: #fff07a;
  text-shadow: 0 0 14px rgba(255, 212, 0, 0.55);
}

/* Modificador puntual de pages/vehiculos.html: agrega el link de
   "Descargar catálogo completo" a la derecha de la barra inferior del
   footer (antes vivía como bloque aparte más arriba en la página). No
   afecta a .footer__bottom en el resto de las páginas. */
.footer__bottom--with-action {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  /* Deja aire debajo de la fila para que el botón flotante del asesor IA
     (.ai-float, fixed en la esquina inferior derecha en todas las páginas)
     nunca quede encima del link de descarga. */
  padding-bottom: var(--space-9);
}
.footer__bottom-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer__bottom-action {
  flex: none;
  color: var(--color-accent);
}
.footer__bottom-action:hover {
  color: #fff07a;
}

@media (max-width: 560px) {
  .footer__bottom--with-action {
    flex-direction: column;
    align-items: flex-start;
  }
}
