/* ==========================================================
   Triple A Autopartes — estilos base
   Complementa a Tailwind (CDN). Aquí viven las variables de
   color y los componentes que se repiten en todo el sitio.
   ========================================================== */

:root {
  /* Colores de marca en formato R G B (Tailwind los usa con opacidad).
     Tomados de las publicaciones de Triple A en Instagram. */
  --color-azul: 0 32 222;         /* #0020DE — azul rey: encabezado, portadas, franjas */
  --color-azul-oscuro: 6 26 140;  /* #061A8C — pie, degradados y hover */
  --color-rojo: 227 0 15;         /* #E3000F — botones y acentos */
  --color-rojo-oscuro: 184 0 14;  /* #B8000E — hover y presionado */
  --color-rojo-suave: 253 232 233;/* #FDE8E9 — fondos de acento */

  --color-carbon: #2B2B2B;
  --color-gris-claro: #F4F4F4;
  --color-whatsapp: #177F44;
  --color-whatsapp-oscuro: #12693A;

  --radio: 0.75rem;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--color-carbon);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-titulo {
  font-family: "Barlow Condensed", Barlow, "Arial Narrow", sans-serif;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

img, svg { max-width: 100%; }

:focus-visible {
  outline: 3px solid rgb(var(--color-rojo));
  outline-offset: 2px;
}
/* Sobre fondos azules el contorno de foco va en blanco para que se vea. */
.hero-fondo :focus-visible, .bg-azul :focus-visible, .bg-azul-oscuro :focus-visible,
.encabezado :focus-visible, .pie :focus-visible { outline-color: #fff; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.35rem;
  border-radius: 0.5rem;
  border: 2px solid transparent;
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

.btn-primario { background: rgb(var(--color-rojo)); color: #fff; }
.btn-primario:hover { background: rgb(var(--color-rojo-oscuro)); }

.btn-secundario { background: rgb(var(--color-azul)); color: #fff; }
.btn-secundario:hover { background: rgb(var(--color-azul-oscuro)); }

.btn-contorno { background: #fff; color: var(--color-carbon); border-color: var(--color-carbon); }
.btn-contorno:hover { background: var(--color-carbon); color: #fff; }

.btn-claro { background: #fff; color: var(--color-carbon); }
.btn-claro:hover { background: var(--color-gris-claro); }

.btn-whatsapp { background: var(--color-whatsapp); color: #fff; }
.btn-whatsapp:hover { background: var(--color-whatsapp-oscuro); }

.btn-sm { min-height: 44px; padding: 0.5rem 0.9rem; font-size: 0.95rem; }
.btn-bloque { width: 100%; }

/* ---------- Foto de muestra (placeholder) ---------- */
.foto-muestra {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #8A8A8A;
  background-color: var(--color-gris-claro);
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgb(0 0 0 / 0.025) 14px 28px);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.foto-muestra svg { width: 2.25rem; height: 2.25rem; opacity: .6; }

/* ---------- Detalle industrial: barra roja bajo títulos de sección ---------- */
.acento::after {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  margin-top: 0.75rem;
  background: rgb(var(--color-rojo));
  border-radius: 2px;
}
.acento-centro::after { margin-left: auto; margin-right: auto; }

/* ---------- Encabezado ---------- */
.saltar {
  position: absolute; left: 1rem; top: -4rem; z-index: 60;
  padding: .75rem 1rem; border-radius: .5rem;
  background: #fff; color: var(--color-carbon); font-weight: 600;
}
.saltar:focus { top: 1rem; }

.encabezado { transition: box-shadow .2s ease; }
.encabezado.con-sombra { box-shadow: 0 6px 20px rgb(0 0 0 / .25); }

.nav-enlace {
  position: relative;
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 .85rem;
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-size: 1.125rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: rgb(255 255 255 / .78);
  transition: color .15s ease;
}
.nav-enlace:hover, .nav-enlace.activo { color: #fff; }
.nav-enlace::after {
  content: ""; position: absolute; left: .85rem; right: .85rem; bottom: 4px;
  height: 3px; border-radius: 2px; background: rgb(var(--color-rojo));
  transform: scaleX(0); transition: transform .2s ease;
}
.nav-enlace:hover::after { transform: scaleX(.5); }
.nav-enlace.activo::after { transform: scaleX(1); }

/* ---------- Panel lateral del menú (celular) ---------- */
.panel-menu .panel-fondo { opacity: 0; transition: opacity .25s ease; }
.panel-menu .panel-contenido { transform: translateX(100%); transition: transform .25s ease; box-shadow: -10px 0 40px rgb(0 0 0 / .2); }
.panel-menu.abierto .panel-fondo { opacity: 1; }
.panel-menu.abierto .panel-contenido { transform: none; }

.panel-enlace {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; padding: 0 1rem; border-radius: .5rem;
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-size: 1.375rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  color: var(--color-carbon);
}
.panel-enlace:hover { background: var(--color-gris-claro); }
.panel-enlace.activo { color: rgb(var(--color-rojo)); box-shadow: inset 4px 0 0 rgb(var(--color-rojo)); }
.panel-enlace.activo svg { color: rgb(var(--color-rojo)); }

body.sin-scroll { overflow: hidden; }

/* ---------- Barra fija inferior (celular) ---------- */
.barra-movil { padding-bottom: calc(.5rem + env(safe-area-inset-bottom)); }
@media (max-width: 1023.98px) {
  body.con-barra-movil { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* ---------- Formularios ---------- */
.campo {
  display: block; width: 100%;
  min-height: 52px; padding: 0 2.5rem 0 1rem;
  border: 1.5px solid #D4D4D4; border-radius: .5rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F5F5F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .85rem center / 1.15rem;
  color: var(--color-carbon); font-size: 1rem;
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.campo:focus { outline: none; border-color: rgb(var(--color-rojo)); box-shadow: 0 0 0 3px rgb(var(--color-rojo) / .15); }
.campo:disabled { background-color: var(--color-gris-claro); color: #8A8A8A; cursor: not-allowed; }

.campo-sm { min-height: 48px; font-size: .9375rem; }
.campo-texto {
  display: block; width: 100%; min-height: 52px; padding: 0 1rem;
  border: 1.5px solid #D4D4D4; border-radius: .5rem; background: #fff;
  color: var(--color-carbon); font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.campo-texto::placeholder { color: #8A8A8A; }
.campo-texto:focus { outline: none; border-color: rgb(var(--color-rojo)); box-shadow: 0 0 0 3px rgb(var(--color-rojo) / .15); }
.pl-12.campo-texto { padding-left: 3rem; }

.campo-texto[aria-invalid="true"], .campo[aria-invalid="true"] { border-color: rgb(var(--color-rojo)); background-color: rgb(var(--color-rojo-suave)); }
.mensaje-error { display: block; margin-top: .375rem; font-size: .8125rem; font-weight: 500; color: rgb(var(--color-rojo-oscuro)); }
.mensaje-error[hidden] { display: none; }

/* ---------- Filtros del catálogo ---------- */
.titulo-filtro {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-size: 1.0625rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.opcion-filtro {
  display: flex; align-items: center; gap: .75rem;
  min-height: 44px; padding: 0 .5rem; margin: 0 -.5rem; border-radius: .375rem;
  cursor: pointer; font-size: .9375rem;
}
.opcion-filtro:hover { background: var(--color-gris-claro); }
.opcion-filtro input { width: 1.125rem; height: 1.125rem; accent-color: rgb(var(--color-rojo)); flex-shrink: 0; }
.opcion-filtro .conteo { font-size: .8125rem; color: #8A8A8A; }
.opcion-filtro:has(input:checked) { font-weight: 600; }
.chip-filtro {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 44px; padding: 0 .9rem; border-radius: 999px;
  background: rgb(var(--color-azul)); color: #fff; font-size: .875rem; font-weight: 500;
}
.chip-filtro:hover { background: rgb(var(--color-rojo)); }

/* ---------- Galería de producto ---------- */
.miniatura { border: 2px solid transparent; border-radius: .5rem; overflow: hidden; }
.miniatura[aria-current="true"] { border-color: rgb(var(--color-rojo)); }

/* ---------- Hero ---------- */
.hero-fondo {
  background-color: #0A1033;
  background-image:
    radial-gradient(ellipse 70% 90% at 85% 10%, rgb(var(--color-azul) / .45), transparent 65%),
    repeating-linear-gradient(135deg, rgb(255 255 255 / .03) 0 2px, transparent 2px 22px),
    linear-gradient(160deg, #0F1A4D 0%, #070B24 100%);
}

/* ---------- Carrusel ---------- */
.carrusel-pista { scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.carrusel-pista::-webkit-scrollbar { display: none; }
.carrusel-pista > * { scroll-snap-align: start; }
.carrusel-punto {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer;
}
.carrusel-punto::before {
  content: ""; width: 10px; height: 10px; border-radius: 999px; background: #CFCFCF;
  transition: width .2s ease, background-color .2s ease;
}
.carrusel-punto.activo::before { width: 26px; background: rgb(var(--color-rojo)); }

/* ---------- Aparición al hacer scroll ---------- */
.aparecer { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.aparecer.visible { opacity: 1; transform: none; }

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