/* ==========================================================================
   1. VARIABLES DE MARCA Y CONFIGURACIÓN GENERAL (Tailwind-like colors)
   ========================================================================== */
:root {
  --primary-color: #4f46e5;      /* Indigo / Primario principal */
  --primary-hover: #4338ca;
  --secondary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); /* Degradado Premium Morado */
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);        /* Fondos suaves */
  --dark-slate: #0f172a;         /* Color oscuro slate */
  --text-muted-dark: #64748b;
  --transition-fast: all 0.3s ease;
}
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  overflow-x: hidden;
}

/* ==========================================================================
   2. BARRA DE NAVEGACIÓN (Navbar)
   ========================================================================== */
.navbar-custom {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition-fast);
}

.navbar-custom .nav-link {
  color: rgba(255, 255, 255, 0.75) !important;
  transition: var(--transition-fast);
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
  color: #ffffff !important;
}

/* ==========================================================================
   3. SECCIONES HERO (Inicio y Categorías Internas)
   ========================================================================== */
/* Hero Principal (index.html) */
.hero-premium {
  background: var(--secondary-gradient);
  color: white;
  padding: 180px 0 100px 0;
}

.hero-premium h1 {
  font-weight: 900;
  letter-spacing: -0.03em;
}

/* Hero de Categorías e Internas */
.hero-category {
  background: var(--secondary-gradient);
  padding: 160px 0 100px 0;
  color: white;
  text-align: center;
}

.hero-category h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   4. COMPONENTES DE INTERFAZ Y EFECTOS (UI & CRO)
   ========================================================================== */
/* Efectos en botones */
.btn-hover-effect {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-hover-effect:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Carrusel y Envoltorios de Ofertas (Horizontal scroll continuo vía JS) */
.deals-wrapper {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 1rem 0.25rem 2rem 0.25rem;
  scrollbar-width: none;        /* Firefox: oculta la barra, el JS controla el scroll */
  -ms-overflow-style: none;     /* IE/Edge legacy */
}

.deals-wrapper::-webkit-scrollbar {
  display: none;                /* Chrome/Safari: oculta la barra, el JS controla el scroll */
}

/* Tarjetas de Producto / Ofertas */
.deal-card {
  min-width: 280px;
  max-width: 280px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}

.deal-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.deal-card img {
  height: 180px;
  object-fit: cover;
  width: 100%;
}

/* Badges de Descuento */
.discount-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: #ef4444;
  color: white;
  padding: 0.25rem 0.75rem;
  font-weight: bold;
  border-radius: 2rem;
  font-size: 0.85rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.price-old {
  text-decoration: line-through;
  color: #94a3b8;
  font-size: 0.95rem;
}

/* Hitos / Línea de tiempo / Pasos en Quienes Somos */
.milestone-card {
  border-left: 4px solid var(--primary-color) !important;
  background: #ffffff;
  transition: var(--transition-fast);
}
.milestone-card:hover {
  background: #f1f5f9;
}

/* Tablas Comparativas CRO */
.table-responsive {
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.table-comparative th {
  background-color: var(--dark-slate);
  color: white;
  text-align: center;
  vertical-align: middle;
}

.table-comparative td {
  vertical-align: middle;
  text-align: center;
}

/* ==========================================================================
   5. BOTÓN VOLVER ARRIBA
   ========================================================================== */
#scrollToTop {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99;
  border: none;
  background-color: var(--primary-color);
  color: white;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 50%;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: background-color 0.3s, transform 0.2s;
}

/* El JS (componentes/cargador.js) añade la clase .show al hacer scroll
   pasados 300px; sin esta regla el botón nunca llega a mostrarse. */
#scrollToTop.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

#scrollToTop:hover {
  background-color: var(--primary-hover);
  transform: scale(1.1);
}

/* ==========================================================================
   6. COMPONENTE AVANZADO DE PRIVACIDAD Y COOKIES (NATIVO)
   ========================================================================== */
/* Barra inferior fija */
.cookie-bar {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: #ffffff;
  color: #1e293b;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 15px;
  border: 1px solid #e2e8f0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

@media (min-width: 768px) {
  .cookie-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
  }
}

.cookie-bar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(50px);
}

.cookie-text {
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 75%;
}

.cookie-text a {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 500;
}

.cookie-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Botones del Banner */
.cookie-btn-primary {
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.cookie-btn-primary:hover {
  background: var(--primary-hover);
}

.cookie-btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.cookie-btn-secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* Botón flotante permanente (Cookie Fab) */
.cookie-fab {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 45px;
  height: 45px;
  background: #1e293b;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 9998;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.cookie-fab.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.cookie-fab:hover {
  background: var(--primary-color);
  transform: scale(1.1);
}

/* Modal Avanzado de Configuración */
.cookie-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cookie-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cookie-modal {
  background: #ffffff;
  width: 90%;
  max-width: 600px;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: translateY(-30px);
  transition: transform 0.3s ease;
}

.cookie-modal-overlay.open .cookie-modal {
  transform: translateY(0);
}

.modal-header-cookies {
  padding: 20px 25px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body-cookies {
  padding: 25px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer-cookies {
  padding: 15px 25px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Bloque Informativo de Amazon */
.amazon-notice {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: #78350f;
  margin-bottom: 20px;
}

/* Filas de Categorías de Cookies */
.cat-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 15px 0;
  border-bottom: 1px solid #f1f5f9;
}

.cat-row:last-child {
  border-bottom: none;
}

.cat-info h5 {
  margin: 0 0 5px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
}

.cat-info p {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
}

/* Switches Desplazables (Toggles) */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 5px;
}

.cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .cookie-slider {
  background-color: var(--primary-color);
}

input:disabled + .cookie-slider {
  background-color: #94a3b8;
  opacity: 0.6;
  cursor: not-allowed;
}

input:checked + .cookie-slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   CORRECCIÓN DEL FOOTER (Visibilidad de textos y enlaces)
   ========================================================================== */
footer.bg-dark {
  background-color: #0f172a !important; /* Forzamos un tono Slate oscuro premium */
  color: #cbd5e1 !important;            /* Texto general en gris claro legible */
}

footer.bg-dark p, 
footer.bg-dark span {
  color: #94a3b8 !important;            /* Párrafos secundarios legibles */
}

footer.bg-dark a.text-muted {
  color: #94a3b8 !important;            /* Enlaces antes invisibles */
  transition: color 0.2s ease;
}

footer.bg-dark a.text-muted:hover {
  color: #ffffff !important;            /* Destacar en blanco al pasar el ratón */
  text-decoration: underline !important;
}

footer.bg-dark h5, 
footer.bg-dark h6 {
  color: #ffffff !important;            /* Encabezados en blanco puro */
}

footer hr.text-secondary {
  border-color: rgba(255, 255, 255, 0.15) !important; /* Línea divisoria sutil */
}

/* ==========================================================================
   11. FIX: bg-opacity-20 (Bootstrap solo trae 10/25/50/75/100 de fábrica)
   Sin esto, el badge "bg-white bg-opacity-20 text-white" de los banners
   queda con fondo blanco 100% opaco y texto blanco encima = invisible.
   ========================================================================== */
.bg-opacity-20 {
  --bs-bg-opacity: .15 !important; /* .2 daba contraste 4.19 (falla WCAG AA); .15 da 4.69 (pasa) */
}

/* ==========================================================================
   12. REDISEÑO MODERNO — Glassmorphism, degradados animados y micro-interacciones
   Inspirado en el lenguaje visual de leonardo.ai (glow, profundidad, cristal),
   adaptado a la paleta cálida de la marca (índigo/violeta + acento ámbar).
   No se ha tocado ningún HTML: todo se apoya en clases que ya existían.
   ========================================================================== */

:root {
  --accent-warm: #fb923c;                        /* Acento ámbar (detalle cálido, atardecer de campamento) */
  --accent-warm-soft: rgba(251, 146, 60, 0.35);
  --glow-primary: rgba(79, 70, 229, 0.45);
  --glow-violet: rgba(124, 58, 237, 0.4);
  --glass-border: rgba(255, 255, 255, 0.18);
  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);  /* easing "expo-out": sensación más fluida y cuidada */
  --radius-lg: 1.25rem;
}

/* --- 12.1 Curva de animación más premium para TODAS las animaciones AOS ya existentes --- */
[data-aos] {
  transition-timing-function: var(--ease-premium) !important;
}

/* --- 12.2 Fondo global con textura sutil de puntos (profundidad, sin ruido visual) --- */
body {
  background-image: radial-gradient(circle at 1px 1px, rgba(79, 70, 229, 0.08) 1px, transparent 0);
  background-size: 28px 28px;
}

/* --- 12.3 Hero: degradado animado + halos de luz difuminados (glow orbs) --- */
.hero-premium,
.hero-category {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #4338ca 0%, #6d28d9 45%, #7c3aed 75%, #4f46e5 100%);
  background-size: 250% 250%;
  animation: gradientFlow 12s ease-in-out infinite;
}

@keyframes gradientFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-premium::before,
.hero-premium::after,
.hero-category::before,
.hero-category::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  z-index: 0;
  pointer-events: none;
}

.hero-premium::before,
.hero-category::before {
  width: 380px;
  height: 380px;
  background: var(--accent-warm-soft);
  top: -120px;
  right: -80px;
  animation: floatOrb 9s ease-in-out infinite;
}

.hero-premium::after,
.hero-category::after {
  width: 320px;
  height: 320px;
  background: rgba(255, 255, 255, 0.18);
  bottom: -140px;
  left: -60px;
  animation: floatOrb 11s ease-in-out infinite reverse;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -25px) scale(1.08); }
}

.hero-premium > *,
.hero-category > * {
  position: relative;
  z-index: 2;
}

/* --- 12.4 Badges tipo "cristal": glassmorphism real sobre el bg-opacity-20 que ya arreglamos --- */
.hero-category .badge,
.hero-premium .badge {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.04em;
}

/* --- 12.5 Cards: elevación suave + resplandor de marca + zoom de imagen al pasar el ratón --- */
.card {
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
  transition: transform 0.45s var(--ease-premium), box-shadow 0.45s var(--ease-premium);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -12px var(--glow-primary), 0 8px 16px -8px rgba(15, 23, 42, 0.1) !important;
}

.card img.card-img-top {
  transition: transform 0.6s var(--ease-premium);
}

.card:hover img.card-img-top {
  transform: scale(1.08);
}

/* --- 12.6 Botones primarios: degradado de marca + brillo deslizante al pasar el ratón --- */
.btn-primary {
  background: linear-gradient(120deg, #4f46e5 0%, #6d28d9 45%, #7c3aed 100%, #4f46e5 130%) !important;
  background-size: 250% 100% !important;
  background-position: 0% 0%;
  border: none !important;
  transition: transform 0.3s var(--ease-premium), box-shadow 0.3s var(--ease-premium), background-position 0.7s var(--ease-premium);
}

.btn-primary:hover {
  background-position: 100% 0%;
  transform: translateY(-3px);
  box-shadow: 0 14px 24px -8px var(--glow-violet);
}

/* --- 12.7 Títulos de sección: acento con degradado de marca debajo --- */
.section-title {
  position: relative;
  letter-spacing: -0.02em;
}

.section-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin: 14px auto 0 auto;
  border-radius: 999px;
  background: var(--secondary-gradient);
}

/* --- 12.8 Scrollbar y selección de texto con la identidad de marca --- */
::selection {
  background: var(--primary-color);
  color: #ffffff;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: var(--secondary-gradient);
  border-radius: 999px;
}

/* --- 12.9 Enlaces internos (text-primary) con subrayado animado --- */
a.text-primary {
  background-image: linear-gradient(var(--primary-color), var(--primary-color));
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 0% 2px;
  transition: background-size 0.35s var(--ease-premium);
  padding-bottom: 1px;
}

a.text-primary:hover {
  background-size: 100% 2px;
}

/* ==========================================================================
   13. TARJETAS DE PRODUCTO 100% CLICABLES (imagen, texto y botón)
   Técnica "stretched link": el ::after del propio botón "Ver Precio" se
   estira con position:absolute hasta cubrir toda la tarjeta (.card ya
   tiene position:relative por defecto en Bootstrap, así que el ::after
   "escapa" del botón y rellena la tarjeta entera). El botón NO lleva
   position:relative propio a propósito: si lo tuviera, el ::after se
   quedaría encerrado dentro del propio botón en vez de cubrir la tarjeta.
   No se toca ningún HTML ni JS: sigue siendo el mismo <a href="...">.
   ========================================================================== */
.card .btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.card:has(.btn-primary) {
  cursor: pointer;
}

/* ==========================================================================
   14. ACCESIBILIDAD — auditoría WCAG
   ========================================================================== */

/* 14.1 Compensar visualmente el cambio semántico h5->h4 (jerarquía de
   encabezados corregida para no saltar niveles). El tamaño visual debe
   quedar IDÉNTICO a como estaba en h5: nadie debe notar el cambio. */
.card h4,
h4.mt-3 {
  font-size: 1.25rem; /* mismo tamaño que tenía como h5 en Bootstrap 5.3 */
}

/* 14.2 Foco de teclado visible en todo el sitio (antes el botón
   #scrollToTop lo eliminaba con outline:none). Se usa :focus-visible para
   que solo aparezca al navegar con teclado, no al hacer click con ratón. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.card .btn-primary:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 4px;
}

#scrollToTop:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

/* 14.3 Enlace "Saltar al contenido principal" — invisible hasta que
   recibe foco por teclado (patrón estándar de accesibilidad). */
.skip-to-content {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 100000;
  background: var(--primary-color);
  color: #ffffff !important;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.25s var(--ease-premium, ease);
}

.skip-to-content:focus {
  top: 0;
}

/* ==========================================================================
   15. QUIÉNES SOMOS — estilos migrados desde el <style> interno de la
   página + galería adicional + interactividad extra (leonardo.ai)
   ========================================================================== */

/* 15.1 Contenedor de texto centrado (antes style="max-width: 900px") */
.container-narrow {
  max-width: 900px;
}

/* 15.2 Foto circular del fundador (antes style="width/height: 220px") */
.avatar-fundador {
  width: 220px;
  height: 220px;
  object-fit: cover;
}

/* 15.3 Tarjeta del fundador: además de la elevación que ya aplica .card al
   pasar el ratón (sección 12.5), añade un borde-degradado tipo "glow" que
   aparece en hover, en línea con la estética de leonardo.ai */
.team-card {
  position: relative;
}

.team-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: var(--secondary-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s var(--ease-premium, ease);
  pointer-events: none;
}

.team-card:hover::after {
  opacity: 1;
}

/* 15.4 Fotos del carrusel principal del fundador (antes
   style="height: 480px; object-fit: cover;" en cada <img>) */
.carrusel-foto {
  height: 480px;
  object-fit: cover;
}

/* 15.5 Galería adicional en grid (nuevo carrusel #carruselGaleria):
   zoom suave de la imagen al pasar el ratón por su celda */
.carrusel-galeria-foto {
  height: 280px;
  object-fit: cover;
  transition: transform 0.6s var(--ease-premium, ease);
}

.carrusel-galeria-item {
  border-radius: 0.75rem;
}

.carrusel-galeria-item:hover .carrusel-galeria-foto {
  transform: scale(1.06);
}

/* 15.6 Parallax sutil del hero (ver main.js): el JS mueve .hero-category
   y .hero-premium con translateY al hacer scroll. will-change avisa al
   navegador para que optimice esa animación. Se desactiva automáticamente
   si el usuario prefiere movimiento reducido (ver prefers-reduced-motion
   comprobado en JS antes de animar nada). */
.hero-premium,
.hero-category {
  will-change: transform;
}
