/*
  CALLIO STYLESHEET
  -----------------
  Tabla de Contenidos:
  1. Variables Globales
  2. Reseteo y Estilos Base
  3. Clases de Utilidad
  4. Componentes Reutilizables
  5. Layout Principal
  6. Estilos de Secciones
  7. Animaciones
  8. Media Queries (Diseño Responsivo)
*/

/* =========================================
   1. VARIABLES GLOBALES
   ========================================= */
:root {
  /* Paleta de Colores */
  --color-primary: #00C49A;
  --color-primary-dark: #00A37E;
  --color-heading: #1A202C;
  --color-text: #333333;
  --color-text-light: #f0f0f0;
  --color-background-light: #F7FAFC;
  --color-dark: #1A202C;
  --color-white: #ffffff;
  --color-border: #E2E8F0;
  /* Tipografía */
  --font-primary: 'Poppins', sans-serif;
  --font-secondary: 'Inter', sans-serif;
  /* Espaciado */
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;
  /* Otros */
  --border-radius: 5px;
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s ease;
  --box-shadow-light: 0 2px 10px rgba(0, 0, 0, 0.08);
  --box-shadow-medium: 0 4px 15px rgba(0, 196, 154, 0.3);
  --box-shadow-heavy: 0 1rem 1.875rem rgba(26, 32, 44, 0.1);
}

/* =========================================
   2. RESETEO Y ESTILOS BASE
   ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  font-size: 16px;
}
/* RECOMENDACIÓN: Mueve la importación de fuentes a tu archivo HTML para un mejor rendimiento.
   Coloca esta línea en la sección <head> de tu home.php:
   <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&family=Inter:wght@400;500&display=swap">
*/
body {
  font-family: var(--font-secondary);
  color: var(--color-text);
  background-color: var(--color-white);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  color: var(--color-heading);
  line-height: 1.2;
  font-weight: 700;
}
h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); }
h3 { font-size: 1.25rem; }
p {
  margin-bottom: var(--spacing-md);
}
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-smooth);
}
ul, ol {
  list-style: none;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* =========================================
   3. CLASES DE UTILIDAD
   ========================================= */
.text-primary {
  color: var(--color-primary);
}
.container {
  width: min(90%, 1100px);
  margin-left: auto;
  margin-right: auto;
}
.section {
  padding-top: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
}
.section__title {
  text-align: center;
  margin-bottom: var(--spacing-sm);
}
.section__subtitle {
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--spacing-lg);
  color: #555;
}

/* =========================================
   4. COMPONENTES REUTILIZABLES
   boton de contactanos del navbar
   ========================================= */
.cta-button {
  display: inline-block;
  padding: 0.9rem 1.8rem;
  border-radius: var(--border-radius);
  background-image: linear-gradient(45deg, var(--color-primary-dark), var(--color-primary));
  color: var(--color-white);
  font-family: var(--font-primary);
  font-weight: 600;
  text-align: center;
  border: none;
  cursor: pointer;
  box-shadow: var(--box-shadow-medium);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 196, 154, 0.4);
}
.contact-form {
  display: grid;
  gap: var(--spacing-md);
  max-width: 600px;
  margin: 0 auto;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background-color: var(--color-white);
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 196, 154, 0.2);
}
.grid {
  display: grid;
  gap: var(--spacing-lg);
}
.grid--3-cols {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid--4-cols {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* =========================================
   5. LAYOUT PRINCIPAL
   ========================================= */
header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(26, 32, 44, 0.95);
  padding: 1rem 0;
  transition: background-color var(--transition-smooth), box-shadow var(--transition-smooth), padding var(--transition-smooth);
}
header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header.scrolled {
  background-color: var(--color-white);
  box-shadow: var(--box-shadow-light);
  padding: 0.75rem 0;
}
.header__logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
  text-shadow: none;
  transition: color var(--transition-smooth);
}
header.scrolled .header__logo {
  color: var(--color-heading);
  text-shadow: none;
}
.header__nav {
  display: flex;
  align-items: center;
}
.header__nav-list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.header__nav-link {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-white);
  padding: 0.5rem 0;
  text-shadow: none;
  transition: color var(--transition-smooth);
}
header.scrolled .header__nav-link {
  color: var(--color-heading);
  text-shadow: none;
}
.header__nav-link:hover {
  color: var(--color-primary);
}
.header__nav-link.cta-button:hover {
  color: var(--color-white);
}
.header__nav-item { position: relative; }
.header__nav-link.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.header__nav-link.dropdown-toggle i {
  font-size: 0.8em;
  transition: transform var(--transition-smooth);
}
/* --- ESTILOS DEL DROPDOWN EN ESCRITORIO --- */
@media (min-width: 993px) {
  .header__nav-item.has-dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg);
  }

  .header__dropdown {
    position: absolute;
    top: calc(100% + 12px); /* Un poco más de espacio */
    left: 50%;
    min-width: 240px;
    background: var(--color-white);
    border-radius: 12px; /* Más redondeado */
    box-shadow: var(--box-shadow-heavy); /* Sombra más pronunciada */
    padding: 0.75rem;
    z-index: 2500;
    border: 1px solid var(--color-border);
    
    /* Animación */
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 10px);
    transition: opacity var(--transition-smooth), visibility var(--transition-smooth), transform var(--transition-smooth);
  }

  /* Flecha hacia arriba */
  .header__dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    border-left: 1px solid var(--color-border);
    z-index: -1;
  }

  .header__dropdown li { padding: 0; }

  .header__dropdown .dropdown-link {
    display: block;
    padding: 0.8rem 1.2rem;
    color: var(--color-heading);
    font-weight: 500;
    border-radius: 8px; /* Redondeo para los items */
    transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  }

  .header__dropdown .dropdown-link:hover { 
    background: var(--color-primary); 
    color: var(--color-white);
    transform: translateX(4px);
  }

  /* Mostrar dropdown en hover (desktop) */
  .header__nav-item.has-dropdown:hover > .header__dropdown { 
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }
}

/* En móvil, el dropdown se muestra cuando la navegación está activa */
.header__nav.active .header__dropdown { 
  display: block; 
  position: static; 
  box-shadow: none; 
  padding-left: 1rem; 
}
.header__nav-cta {
  color: var(--color-white);
  margin-left: 1.5rem;
  /* Override padding from .header__nav-link to apply CTA button styles */
  padding: 0.2rem 0.9rem;
}
.header__menu-toggle {
  display: none;
  font-size: 2rem;
  color: var(--color-white);
  background: none;
  border: none;
  cursor: pointer;
}
header.scrolled .header__menu-toggle {
    color: var(--color-heading);
  }

footer {
  background-color: var(--color-dark);
  color: var(--color-text-light);
  padding: var(--spacing-xl) 0;
}
.footer-container {
  display: grid;
  gap: var(--spacing-lg);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.footer-column h4 {
  color: var(--color-white);
  margin-bottom: var(--spacing-md);
}
.footer-column a {
  color: var(--color-border);
  transition: color var(--transition-smooth);
}
.footer-column a:hover {
  color: var(--color-primary);
}
.footer-bottom {
  text-align: center;
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
  border-top: 1px solid #4A5568;
  font-size: 0.9rem;
}
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #25D366;
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 999;
  transition: transform var(--transition-fast);
}
.whatsapp-float:hover {
  transform: scale(1.1);
}

/* =========================================
   6. ESTILOS DE SECCIONES
   ========================================= */
.hero {
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0.2)), url('../images/hero-image.png') center/cover no-repeat;
  color: var(--color-white);
  padding: 8rem 1rem 6rem;
  text-align: center;
  min-height: 70vh;
  display: flex;
  align-items: center;
}
.hero__container {
  max-width: 800px;
  margin: 0 auto;
}
.hero__content {
  width: 100%;
}
.hero__title {
  color: var(--color-white);
  margin-bottom: 1rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
}
.hero__text {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.95);
  margin-bottom: 2rem;
}
.partners {
  padding: 2.5rem 0;
  background-color: var(--color-white);
  overflow: hidden;
}
.partners__title {
  color: #4A5568;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: var(--spacing-lg);
}
.logo-slider {
  display: flex;
  width: fit-content;
  animation: scroll 40s linear infinite;
}
.logo-slider img {
  height: 40px;
  margin: 0 2.5rem;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: filter var(--transition-smooth), opacity var(--transition-smooth);
}
.logo-slider:hover img {
  filter: grayscale(0);
  opacity: 1;
}
.why-us {
  background-color: var(--color-background-light);
}
.feature-item {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--color-white);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease;
}
.feature-item:hover {
  transform: translateY(-5px);
}
.feature-item__icon {
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
}
.pillar-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  text-align: center;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}
.pillar-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--box-shadow-heavy);
}
.pillar-card__icon {
  font-size: 3rem;
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
}
.pillar-card__link {
  display: inline-block;
  margin-top: var(--spacing-md);
  font-weight: 600;
}
.service-item {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 2rem;
  transition: box-shadow 0.3s ease;
}
.service-item:hover {
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}
.service-item h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--color-heading);
}
.service-item h3 i {
  color: var(--color-primary);
  font-size: 1.5rem;
}
.faq-item {
  border-bottom: 1px solid var(--color-border);
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 1.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
}
.faq-question:hover,
.faq-question.active {
  color: var(--color-primary);
}
.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--color-primary);
  transition: transform var(--transition-fast);
}
.faq-question.active::after {
  content: '−';
  transform: rotate(180deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-smooth), padding var(--transition-smooth);
}
.faq-answer p {
  padding-bottom: 1.5rem;
}
.contact {
  background-color: var(--color-background-light);
}
.final-cta {
  background-color: var(--color-dark);
  color: var(--color-white);
  text-align: center;
}
.final-cta h2 {
  color: var(--color-white);
}
.final-cta p {
  color: var(--color-text-light);
}

/* =========================================
   7. ANIMACIONES (KEYFRAMES)
   ========================================= */
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* =========================================
   8. MEDIA QUERIES (DISEÑO RESPONSIVO)
   ========================================= */
@media (max-width: 992px) {
  .header__menu-toggle {
    display: block;
    z-index: 4000;
  }

  .header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-white);
    box-shadow: var(--box-shadow-light);
    z-index: 1500;
  }

  .header__nav.active {
    display: block;
  }

  .header__nav-list {
    flex-direction: column;
    width: 100%;
    padding: var(--spacing-md) 0;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }
  
  .header__nav-item {
    width: 100%;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
  }
  .header__nav-item:first-child {
    border-top: 1px solid var(--color-border);
  }

  .header__nav-link {
    color: var(--color-heading);
    display: block;
    padding: var(--spacing-md) var(--spacing-lg);
    width: 100%;
  }
  
  /* Anula el color blanco del nav transparente del escritorio */
  header.scrolled .header__nav-link, 
  .header__nav-link {
    color: var(--color-heading);
  }
  
  .header__nav-cta {
    margin: var(--spacing-md) var(--spacing-lg);
  }

  /* --- ESTILOS DEL DROPDOWN EN MÓVIL --- */

  /* 1. Anular estilos de escritorio */
  .header__dropdown {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    min-width: unset;
    
    /* Prepara para la animación de acordeón */
    max-height: 0;
    overflow: hidden;
    opacity: 1; /* Opacidad siempre visible, solo se anima la altura */
    visibility: visible;
    background-color: var(--color-background-light); /* Fondo para distinguir */
    transition: max-height 0.4s ease;
  }
  
  .header__dropdown::before {
    display: none; /* Ocultar la flecha del escritorio */
  }

  /* 2. El item que contiene el dropdown */
  .header__nav-item.has-dropdown {
    padding: 0;
  }
  
  .header__nav-item.has-dropdown > .header__nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  /* 3. Cuando el dropdown está abierto */
  .header__nav-item.has-dropdown.open > .header__dropdown {
    max-height: 1000px; /* Altura suficiente para todos los items */
    border-top: 1px solid var(--color-border);
  }
  
  /* 4. Estilo de los enlaces dentro del dropdown móvil */
  .header__dropdown .dropdown-link {
    display: block;
    width: 100%;
    padding: 0.8rem var(--spacing-lg) 0.8rem 2.5rem; /* Indentación */
    font-weight: 400;
    color: #555;
    border-top: 1px solid var(--color-border);
    transition: background-color var(--transition-fast);
  }

  .header__dropdown .dropdown-link:hover {
    background-color: #e9ecef;
    transform: none; /* Anular efecto de escritorio */
    color: var(--color-primary);
  }
}

/* =========================================
   MODAL STYLES
   ========================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
  z-index: 2000;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--color-white);
  border-radius: 12px;
  padding: var(--spacing-xl);
  max-width: 600px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h2 {
  margin-bottom: var(--spacing-md);
  color: var(--color-heading);
}

.modal-content p {
  margin-bottom: var(--spacing-lg);
  color: var(--color-text);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  font-size: 2rem;
  color: var(--color-heading);
  cursor: pointer;
  transition: color var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--color-primary);
}

.modal-content .contact-form select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background-color: var(--color-white);
  transition: border-color var(--transition-smooth);
}

.modal-content .contact-form select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.header__nav-item.has-dropdown.open .dropdown-toggle i {
    transform: rotate(180deg);
}
