/* ============================================
   AZTECA DRIVE — Sistema de diseño
   Paleta estilo Matik Gate: blanco, negro, rojo
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@300;400;500;600;700;800&family=Barlow+Condensed:wght@400;500;600;700;800&display=swap');

:root {
  --blanco: #ffffff;
  --blanco-off: #fafafa;
  --gris-claro: #f4f4f4;
  --gris-medio: #e5e5e5;
  --gris-linea: #d1d1d1;
  --gris-texto: #666666;
  --gris-oscuro: #333333;
  --negro: #111111;
  --negro-puro: #000000;

  --rojo: #7fc41c;
  --rojo-oscuro: #5a9912;
  --rojo-claro: #a3dc3e;

  --fuente-display: 'Barlow Condensed', sans-serif;
  --fuente-body: 'Barlow', sans-serif;

  --max-width: 1400px;
  --header-height: 90px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--fuente-body);
  background-color: var(--blanco);
  color: var(--negro);
  line-height: 1.6;
  overflow-x: hidden;
  font-weight: 400;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* TOP BAR */
.top-bar {
  background: var(--negro);
  color: var(--blanco);
  padding: 10px 0;
  font-size: 0.8rem;
}
.top-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-bar-left span { margin-right: 2rem; opacity: 0.9; }
.top-bar-right a {
  color: var(--blanco);
  text-decoration: none;
  margin-left: 1.5rem;
  opacity: 0.9;
  transition: color 0.2s;
}
.top-bar-right a:hover { color: var(--rojo-claro); opacity: 1; }

/* HEADER */
.header {
  background: var(--negro);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--blanco);
  height: 100%;
}

/* Logo como imagen real (altura controlada) */
.logo img {
  height: 60px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* PLACEHOLDER DEL LOGO - se usa solo si no hay imagen subida */
.logo-mark {
  width: 52px;
  height: 52px;
  background: var(--blanco);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.logo-mark::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--rojo);
}
.logo-mark span {
  color: var(--negro);
  font-family: var(--fuente-display);
  font-size: 1.6rem;
  font-weight: 800;
}
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-text strong {
  font-family: var(--fuente-display);
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--blanco);
}
.logo-text small {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.15em;
  margin-top: 3px;
  text-transform: uppercase;
}

.nav-main { display: flex; gap: 2.5rem; align-items: center; }
.nav-main a {
  color: var(--blanco);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: relative;
  padding: 8px 0;
  transition: color 0.2s;
}
.nav-main a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--rojo);
  transition: width 0.3s;
}
.nav-main a:hover { color: var(--rojo-claro); }
.nav-main a:hover::after, .nav-main a.active::after { width: 100%; }
.nav-main a.active { color: var(--rojo-claro); }

.nav-cta {
  background: var(--rojo);
  color: var(--negro) !important;
  padding: 12px 24px !important;
  font-weight: 700 !important;
}
.nav-cta:hover { background: var(--rojo-claro) !important; color: var(--negro) !important; }
.nav-cta::after { display: none !important; }

.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { display: block; width: 26px; height: 2px; background: var(--blanco); margin: 6px 0; }

/* BOTONES */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  font-family: var(--fuente-body);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn-primary { background: var(--rojo); color: var(--blanco); border-color: var(--rojo); }
.btn-primary:hover { background: var(--rojo-oscuro); border-color: var(--rojo-oscuro); }
.btn-dark { background: var(--negro); color: var(--blanco); border-color: var(--negro); }
.btn-dark:hover { background: var(--rojo); border-color: var(--rojo); }
.btn-outline { background: transparent; color: var(--negro); border-color: var(--negro); }
.btn-outline:hover { background: var(--negro); color: var(--blanco); }
.btn-outline-white { background: transparent; color: var(--blanco); border-color: var(--blanco); }
.btn-outline-white:hover { background: var(--blanco); color: var(--negro); }
.btn .arrow { transition: transform 0.25s; }
.btn:hover .arrow { transform: translateX(4px); }

/* SECCIONES */
.section { padding: 100px 0; }
.section-gris { background: var(--gris-claro); }
.section-dark { background: var(--negro); color: var(--blanco); }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 2rem; }

.section-label {
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--rojo);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1.5rem;
}
.section-label::before {
  content: '';
  width: 40px;
  height: 2px;
  background: var(--rojo);
}
.section-title {
  font-family: var(--fuente-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  color: var(--negro);
}
.section-title em { font-style: normal; color: var(--rojo); }
.section-dark .section-title { color: var(--blanco); }
.section-subtitle {
  font-size: 1.1rem;
  color: var(--gris-texto);
  max-width: 650px;
  line-height: 1.7;
}
.section-dark .section-subtitle { color: rgba(255,255,255,0.75); }

/* FOOTER */
.footer { background: var(--negro); color: var(--blanco); padding: 80px 0 30px; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}
.footer-brand h3 {
  font-family: var(--fuente-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 1rem;
  text-transform: uppercase;
}
.footer-brand h3 em { color: var(--rojo); font-style: normal; }
.footer-brand p {
  color: rgba(255,255,255,0.65);
  margin-bottom: 1.5rem;
  max-width: 350px;
  line-height: 1.7;
}
.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blanco);
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.75rem;
}
.footer-col h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 30px;
  height: 2px;
  background: var(--rojo);
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.75rem; }
.footer-col a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--rojo-claro); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}
.footer-social { display: flex; gap: 0.75rem; margin-top: 1rem; }
.footer-social a {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blanco);
  text-decoration: none;
  border-radius: 50%;
  transition: all 0.3s ease;
}
.footer-social a svg { display: block; }
.footer-social a:hover {
  background: var(--rojo);
  border-color: var(--rojo);
  color: var(--negro);
  transform: translateY(-2px);
}

/* ANIMACIONES */
.fade-in { opacity: 1; transform: none; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* Fallback: si el JS tarda o falla, forzar visibilidad después de 2s */
@keyframes forceVisible { from {opacity:1;} to {opacity:1;} }
.fade-in { animation: none; }
.fade-in.visible { animation: none; }

/* FIX CRÍTICO: Las imágenes de productos deben verse SIEMPRE,
   independientemente del estado de las animaciones del JavaScript */
.producto-img,
.producto-img img,
.ficha-img-main,
.ficha-img-main img,
.linea-card-img,
.linea-card-img img {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* WHATSAPP FLOTANTE */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blanco);
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  z-index: 999;
  transition: transform 0.2s;
}
.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-float svg { width: 32px; height: 32px; fill: white; }

/* PLACEHOLDER DE IMAGEN - indicador visual para fotos pendientes */
.img-placeholder {
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(
      45deg,
      var(--gris-claro),
      var(--gris-claro) 10px,
      var(--blanco-off) 10px,
      var(--blanco-off) 20px
    );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--gris-texto);
  font-family: var(--fuente-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  gap: 0.5rem;
  padding: 1rem;
  text-align: center;
}

.img-placeholder .placeholder-icon {
  width: 60px;
  height: 60px;
  border: 3px solid var(--gris-linea);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--rojo);
  margin-bottom: 0.5rem;
}

.img-placeholder .placeholder-model {
  font-size: 1.5rem;
  color: var(--negro);
  font-weight: 800;
  letter-spacing: 0.05em;
}

.img-placeholder .placeholder-note {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--gris-linea);
  letter-spacing: 0.2em;
}

/* RESPONSIVE */
@media (max-width: 968px) {
  .nav-main { display: none; }
  .menu-toggle { display: block; }
  .nav-main.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--negro);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: var(--shadow-lg);
  }
  .top-bar-left span:last-child { display: none; }
  .section { padding: 60px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

/* ===================================================================
   PAQUETE PREMIUM: ANIMACIONES Y EFECTOS 3D
   =================================================================== */

/* Cards con efecto tilt 3D (solo desktop con mouse) */
.tilt-card {
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: auto;
}

.tilt-card:hover {
  transition: transform 0.1s linear;
}

/* FIX CRÍTICO: Desactivar preserve-3d en cards con imágenes porque rompe el render */
.producto-card.tilt-card {
  transform-style: flat !important;
}

.producto-card.tilt-card .producto-img,
.producto-card.tilt-card .producto-img img {
  transform-style: flat !important;
}

/* Efecto de "reveal" en imágenes (estilo Apple) */
.image-reveal { clip-path: none; transform: none; }

.image-reveal.image-revealed {
  clip-path: inset(0 0 0 0);
  transform: scale(1);
}

/* Header dinámico al hacer scroll */
.header {
  transition: background 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

.header.header-scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Stagger: cada card entra con un delay escalonado para efecto cinematográfico */
.producto-card.fade-in,
.razon-card.fade-in,
.linea-card.fade-in {
  transition-duration: 1s;
  transition-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
}

/* Contador animado: estilo del número grande */
[data-count] {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

/* Hover premium en botones principales */
.btn-primary, .btn-outline, .form-submit {
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1) !important;
}

.btn-primary:hover, .form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(127, 196, 28, 0.3);
}

/* Hover premium en cards */
.producto-card, .razon-card, .linea-card {
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.producto-card:hover, .razon-card:hover, .linea-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Accesibilidad: respetar preferencia de reducir movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .tilt-card { transform: none !important; }
  .image-reveal { clip-path: none !important; transform: none !important; }
}

/* Desactivar tilt 3D en móvil automáticamente */
@media (max-width: 768px), (hover: none) {
  .tilt-card {
    transform: none !important;
  }
}

/* Smooth scroll global */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}


/* ============================================================
   OVERRIDE FINAL CRÍTICO - NO TOCAR
   Fuerza visibilidad total de cards de producto e imágenes
   ============================================================ */
.producto-card,
.producto-card *,
.producto-img,
.producto-img * {
  opacity: 1 !important;
  visibility: visible !important;
}

.producto-card {
  transform: none !important;
  transform-style: flat !important;
}

.producto-img img {
  display: block !important;
  width: 100% !important;
  max-width: 400px !important;
  height: auto !important;
  margin: 0 auto !important;
}
