/* ==========================================================================
   1. CONFIGURACIÓN GLOBAL Y VARIABLES
   ========================================================================== */
:root {  
  --color-principal-sane: #ff5a15;  
  --color-acento-sane: #ff5a15;  
  --color-texto-principal: #111827;  
  --color-texto-secundario: #4b5563;  
  --color-fondo: #f9fafb;  
  --color-blanco: #ffffff;  
  --color-sombra-suave: rgba(0, 0, 0, 0.05);  
  --color-sombra-fuerte: rgba(0, 0, 0, 0.1);  
  --font-principal: 'Inter', sans-serif;  

  /* Alto referencial del navbar (ajústalo si tu barra es más alta/baja) */
  --nav-h: 88px;
}
@media (max-width: 768px){
  :root { --nav-h: 72px; }
}

/* --- Estilos base y scroll suave --- */
html {  
  scroll-behavior: smooth;  
  -webkit-font-smoothing: antialiased;  
  -moz-osx-font-smoothing: grayscale;  
}

body {  
  font-family: var(--font-principal);  
  background-color: var(--color-fondo);  
  color: var(--color-texto-secundario);  
}

/* --- Scrollbar personalizado (para navegadores Webkit) --- */
::-webkit-scrollbar { width: 10px; }  
::-webkit-scrollbar-track { background: #f1f1f1; }  
::-webkit-scrollbar-thumb { background: var(--color-acento-sane); border-radius: 5px; }  
::-webkit-scrollbar-thumb:hover { background: var(--color-principal-sane); }

/* ==========================================================================
   2. COMPONENTES REUTILIZABLES
   ========================================================================== */

.section-title {  
  font-size: 2.8rem;  
  font-weight: 700;  
  color: var(--color-principal-sane);  
  line-height: 1.2;  
} 
.section-title::after {  
  content: '';  
  display: block;  
  width: 80px;  
  height: 4px;  
  background: var(--color-acento-sane);  
  margin: 1rem auto 0;  
  border-radius: 2px;  
}

.card-hover {  
  background: var(--color-blanco);  
  border-radius: 1rem;  
  box-shadow: 0 4px 15px var(--color-sombra-suave);  
  transition: transform 0.3s ease, box-shadow 0.3s ease;  
  padding: 2rem;  
}
.card-hover:hover {  
  transform: translateY(-10px);  
  box-shadow: 0 15px 30px var(--color-sombra-fuerte);  
}

/* ==========================================================================
   3. SECCIONES ESPECÍFICAS
   ========================================================================== */

/* --- Navegación --- */
nav {  
  backdrop-filter: blur(10px);  
  background: rgba(255, 255, 255, 0.95);  
  transition: background 0.3s ease;  
  z-index: 1000003; /* Superior al menú y hero */
}

.nav-link {
  position: relative;
  color: var(--color-principal-sane);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.5rem 1rem;
  transition: color 0.3s ease;
}
.nav-link:hover { color: var(--color-acento-sane); }

/* (fix: bloque duplicado eliminado) */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-principal-sane);
  transition: transform 0.3s ease-out;
  transform: scaleX(0);
  transform-origin: bottom right;
}
.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.dropdown-menu {
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  border-radius: 0.75rem;
  border: 1px solid rgba(249, 115, 22, 0.2);
  box-shadow: 0 10px 20px var(--color-sombra-suave);
}
.dropdown:hover .dropdown-menu {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* --- MENÚ MÓVIL MEJORADO --- */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  background: #ffffff;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 1000000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 2rem;
}
.mobile-nav-header {
  background: var(--color-principal-sane);
  color: var(--color-blanco);
  padding: 1rem;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000001;
}
.mobile-nav ul {
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 1rem;
}
.mobile-nav li { margin: 0.5rem 0; }
.mobile-nav.open { transform: translateX(0); }
.mobile-nav a {
  color: var(--color-texto-principal);
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  transition: background 0.2s ease, color 0.2s ease;
}
.mobile-nav a:hover {
  background: var(--color-principal-sane);
  color: var(--color-blanco);
}
.mobile-nav .close-btn {
  background: transparent;
  border: none;
  color: var(--color-blanco);
  font-size: 1.5rem;
  cursor: pointer;
}

/* --- SECCIÓN HERO (INICIO) --- */
/* FIX: ocupa exactamente el alto visible menos el navbar */
.hero-bg {
  position: relative;
  /* clave: usa svh para móviles con barra de navegador */
  min-height: calc(100svh - var(--nav-h));
  background: url('https://images.unsplash.com/photo-1522202176988-66273c2fd55f?auto=format&fit=crop&w=1600&q=80') no-repeat center / cover;
  color: var(--color-blanco);
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: clamp(16px, 6vh, 48px); /* evita que el padding estire el alto */
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 90, 21, 0.8) 0%, rgba(241, 99, 37, 0.5) 70%, rgba(241, 99, 37, 0.5) 100%);
  z-index: 0; /* overlay por encima del fondo pero debajo del contenido */
}
.hero-bg .content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  padding: 1rem;
  text-align: center;
  min-height: unset !important; /* neutraliza min-h-screen si está en el HTML */
}
.hero-bg h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}
.hero-bg p { text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }

/* --- Animaciones de entrada para el texto del Hero --- */
.animate-fadeIn { animation: fadeIn 1s ease-out forwards; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Sección Asesores (Carrusel) --- */
.advisor-container { overflow: hidden; position: relative; }
.advisor-grid { display: flex; transition: transform 0.5s ease-in-out; }
.advisor-card {
  flex: 0 0 22%;
  min-width: 22%;
  background: var(--color-blanco);
  border-radius: 1rem;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 10px 20px var(--color-sombra-suave);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin: 1rem;
}
.advisor-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px var(--color-sombra-fuerte); }
.advisor-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: top;
  border-bottom: 4px solid var(--color-principal-sane);
  border-radius: 1rem 1rem 0 0;
  transition: transform 0.3s ease;
}
.advisor-card:hover img { transform: scale(1.05); }

/* --- Carrusel --- */
.carousel-container { position: relative; overflow: hidden; }
.carousel-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
}
.carousel-controls button {
  background: rgba(255,90,21,1);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}
.carousel-controls button:hover { background: var(--color-principal-sane); }
.carousel-indicators {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.carousel-indicators span {
  width: 10px;
  height: 10px;
  background: var(--color-acento-sane);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}
.carousel-indicators span.active { background: var(--color-principal-sane); }

/* --- Sección CTA (Llamada a la Acción) --- */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-blanco);
  background: var(--color-principal-sane);
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 5px 20px rgba(249, 115, 22, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.btn-cta:hover { transform: translateY(-5px) scale(1.05); box-shadow: 0 10px 25px rgba(249, 115, 22, 0.5); }
.btn-cta svg { transition: transform 0.3s ease; }
.btn-cta:hover svg { transform: translateX(5px); }

/* --- Chatbot --- */
.chatbot {
  border-radius: 1.5rem;
  box-shadow: 0 10px 30px var(--color-sombra-fuerte);
  max-height: 70vh;
  z-index: 100; /* Menor que el menú */
}
.chatbot-messages { background: linear-gradient(180deg, #f9fafb 0%, #ffffff 100%); }
.bubble-bot, .bubble-user {
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  line-height: 1.5;
}
.bubble-bot::before { content: '🤖'; margin-right: 0.5rem; }
.bubble-user::before { content: '👤'; margin-right: 0.5rem; }

/* --- Pie de página (Footer) --- */
footer a { transition: color 0.3s ease; }
footer a:hover { color: var(--color-blanco); }

/* ==========================================================================
   4. ANIMACIONES Y UTILIDADES
   ========================================================================== */
.animate-slideIn { animation: slideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-pulse { animation: pulse-animation 2s infinite; }

.btn-float { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.btn-float:hover { transform: translateY(-5px); box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2); }

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-slideInUp { animation: slideInUp 1.2s ease-out forwards; }

.btn-hero-primary {
  display: inline-block;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border-radius: 9999px;
  background: var(--color-principal-sane);
  color: var(--color-blanco);
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
  transition: all 0.3s ease;
}
.btn-hero-primary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.6);
  background: #e94d0f;
}
.btn-hero-secondary {
  display: inline-block;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border-radius: 9999px;
  border: 2px solid var(--color-principal-sane);
  color: var(--color-blanco);
  background: transparent;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.2);
  transition: all 0.3s ease;
}
.btn-hero-secondary:hover {
  background: var(--color-principal-sane);
  color: var(--color-blanco);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

/* ===========================
   HERO RESPONSIVE (solo tipografías/espacios; no cambiamos el alto)
=========================== */
@media (max-width: 768px) {
  .hero-bg h1 { font-size: 2rem; line-height: 1.2; }
  .hero-bg p { font-size: 1rem; line-height: 1.5; }
  .hero-bg .content { padding: 1rem; }

  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .hero-bg .mt-8.flex { flex-direction: column; gap: 0.75rem; }
  .hero-bg .grid { grid-template-columns: 1fr; gap: 0.5rem; }
  .hero-bg .italic { font-size: 0.85rem; }
}

@media (max-width: 480px) {
  .hero-bg h1 { font-size: 1.6rem; }
  .hero-bg p { font-size: 0.9rem; }
  .btn-hero-primary, .btn-hero-secondary { font-size: 0.85rem; }
  .hero-bg .italic { font-size: 0.75rem; }
  .mobile-nav { width: 100%; }
}

/* Botón enviar (formulario) */
.btn-enviar { background-color: var(--color-principal-sane) !important; }
