/* css/main.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: var(--color-background);
  line-height: 1.6;
  font-size: 16px; /* CRÍTICO: Previene el zoom automático en iOS */
  -webkit-font-smoothing: antialiased; /* Texto más nítido en pantallas retina */
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Header / Nav */
header {
    background-color: var(--color-background);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}
.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}
.nav-links {
    display: flex;
    gap: 24px;
}
.nav-links a {
    font-weight: 600;
    color: var(--text-main);
    transition: color 0.3s ease;
}
.nav-links a:hover {
    color: var(--color-accent);
}
.brand-logo {
    height: 60px;
    width: auto;
    display: block;
    mix-blend-mode: multiply;
}
@media (max-width: 767px) {
    .brand-logo {
        height: 48px;
    }

    /* Nav layout en móvil: menú y CTA en columnas separadas */
    .nav-container {
        flex-wrap: wrap;
        align-items: flex-start;
        height: auto;
        row-gap: 8px;
    }

    .nav-links {
        flex: 1 1 100%;
        justify-content: center;
        flex-wrap: wrap;
        row-gap: 8px;
    }
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px; /* Padding seguro para evitar que el texto toque los bordes del móvil */
}

/* Ajuste específico del H1 del hero en home ES/EN para móvil */
@media (max-width: 767px) {
  section.hero h1 {
    font-size: 1.95rem; /* ~5% menos que el tamaño de h1 base en móvil */
  }
}

/* Componente: Botón de Alta Conversión (Mobile-First) */
.btn {
  display: block; /* Ancho completo en móvil para fácil toque */
  width: 100%;
  padding: 18px 24px; /* Touch target masivo */
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 8px; /* Bordes ligeramente más redondeados y modernos */
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-background);
  box-shadow: 0 4px 14px rgba(0, 107, 238, 0.25);
}

.btn-primary:hover {
  background-color: #0056CC;
  box-shadow: 0 6px 20px rgba(0, 107, 238, 0.4);
  transform: translateY(-2px);
}

/* Botón CTA específico del header */
.header-cta {
  width: auto;
  display: inline-block;
  padding: 10px 20px;
  font-size: 0.9rem;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .header-cta {
    width: 100%;
    margin-top: 4px;
    text-align: center;
    padding: 12px 20px;
    font-size: 1rem;
  }
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

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

/* =========================================
   SECCIONES DE LA LANDING PAGE
   ========================================= */
.section {
    padding: 64px 0; /* Espaciado generoso pero no excesivo en móvil */
}

.section-bg {
    background-color: var(--color-surface);
}

.section-title {
    text-align: center;
    font-size: 2rem; /* Tamaño optimizado para evitar palabras cortadas en móvil */
    margin-bottom: 16px;
}

.section-subtitle {
    text-align: center;
    color: var(--color-secondary);
    max-width: 700px;
    margin: 0 auto 40px;
    font-size: 1.05rem;
}

/* 1. Barra de Confianza (Trust Banner) */
.trust-banner {
    background-color: var(--color-primary);
    color: var(--color-background);
    padding: 32px 0;
}

.trust-grid {
    display: flex;
    flex-direction: column; /* Apilado en móvil para mayor impacto */
    align-items: center;
    gap: 32px;
    text-align: center;
}

.trust-item h3 {
    color: var(--color-accent);
    font-size: 2.2rem;
    margin-bottom: 4px;
}

.trust-item p {
    font-weight: 400;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 2. Tarjetas (Cards) para Problemas y Servicios */
.grid-3 {
    display: grid;
    grid-template-columns: 1fr; /* Una columna estricta en móvil para evitar scroll horizontal */
    gap: 24px;
}

.card {
    background-color: var(--color-background);
    padding: 32px 24px; /* Buen respiro visual interno */
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-top: 4px solid var(--color-accent);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.card h3 {
    font-size: 1.35rem;
    margin-bottom: 16px;
    color: var(--color-primary);
}

.card p {
    color: var(--text-light);
    margin-bottom: 16px;
}

.card ul {
    list-style: none;
    margin-bottom: 16px;
}

.card ul li {
    position: relative;
    padding-left: 28px; /* Más espacio para la viñeta */
    margin-bottom: 12px; /* Más espacio entre opciones para toque fácil */
    color: var(--text-main);
    font-size: 1rem;
}

.card ul li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: bold;
    font-size: 1.2rem;
}

.card-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--color-accent);
    font-weight: 700;
    font-family: var(--font-heading);
    padding: 8px 0; /* Facilita el toque en móviles */
}

/* =========================================
   CASOS DE ÉXITO (PRUEBA SOCIAL)
   ========================================= */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr; /* Una columna en móvil */
    gap: 24px;
}

.metric-card {
    background-color: var(--color-background);
    padding: 32px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    text-align: center;
    border: 1px solid #E5E7EB;
}

.metric-card h4 {
    font-size: 3.5rem;
    color: var(--color-accent);
    margin-bottom: 12px;
    line-height: 1;
}

.metric-card p.metric-title {
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
    font-size: 1.15rem;
}

/* =========================================
   FAQ (ACORDEÓN NATIVO HTML5)
   ========================================= */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

details.faq-item {
    background-color: var(--color-background);
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 20px; /* Área de toque más grande */
    transition: all 0.3s ease;
}

details.faq-item[open] {
    border-color: var(--color-accent);
    box-shadow: 0 4px 15px rgba(0, 107, 238, 0.05);
}

summary.faq-question {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-primary);
    font-size: 1.15rem;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 32px; /* Evita que el texto choque con la flecha */
}

summary.faq-question::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-accent);
    font-size: 1.8rem;
    font-weight: 400;
}

details.faq-item[open] summary.faq-question::after {
    content: "−";
}

summary.faq-question::-webkit-details-marker {
    display: none;
}

.faq-answer {
    margin-top: 16px;
    color: var(--text-main);
    line-height: 1.6;
    padding-top: 16px;
    border-top: 1px solid #E5E7EB;
}

/* =========================================
   CTA FINAL (BOTTOM CTA)
   ========================================= */
.cta-final {
    background-color: var(--color-primary);
    color: var(--color-background);
    text-align: center;
    padding: 64px 20px;
}

.cta-final h2 {
    color: var(--color-background);
    font-size: 2.2rem;
    margin-bottom: 24px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.cta-final p {
    color: #D1D5DB;
    font-size: 1.1rem;
    margin-bottom: 32px;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background-color: #0A1940;
    color: #D1D5DB;
    padding: 48px 0 24px;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr; /* Apilado en móvil */
    gap: 40px;
    margin-bottom: 40px;
    text-align: center; /* Centrado en móvil queda mejor */
}

.footer-col h5 {
    color: var(--color-background);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px; /* Separación para toques táctiles */
}

.footer-col ul li a {
    transition: color 0.3s ease;
    padding: 4px 0;
    display: inline-block;
}

.footer-col ul li a:hover {
    color: var(--color-accent);
}

.footer-logo {
    height: 60px;
    width: auto;
    display: block;
    border-radius: 4px;
}
@media (max-width: 767px) {
    .footer-logo {
        height: 48px;
    }
}

/* =========================================
   NAV DROPDOWN
   ========================================= */
.nav-dropdown {
    position: relative;
    display: inline-block;
}
.nav-dropdown-trigger {
    font-weight: 600;
    color: var(--text-main);
    transition: color 0.3s ease;
}
.nav-dropdown-trigger:hover {
    color: var(--color-accent);
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    padding: 8px 0;
    z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-main);
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}
.nav-dropdown-menu a:hover {
    background: var(--color-surface);
    color: var(--color-accent);
}
.accent {
    color: var(--color-accent) !important;
}
.footer-bottom .accent {
    color: var(--color-accent) !important;
    text-decoration: underline;
}
.footer-col .contact-list li a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.footer-col .contact-list svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.footer-col .contact-list li a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

/* =========================================
   MEDIA QUERIES (COMPORTAMIENTO EN ESCRITORIO)
   ========================================= */
@media (min-width: 768px) {
    /* Ajustes generales */
    .section { padding: 96px 0; }
    .section-title { font-size: 2.75rem; }
    .section-subtitle { font-size: 1.2rem; }
    
    /* Botones vuelven a tamaño compacto */
    .btn {
        display: inline-block;
        width: auto;
        padding: 16px 36px;
    }

    /* Grillas vuelven a su formato en columnas */
    .trust-grid {
        flex-direction: row;
        justify-content: space-around;
    }
    
    .grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .footer-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        text-align: left; /* Alineado a la izquierda en PC */
    }

    .cta-final h2 { font-size: 3rem; }
}

/* =========================================
   FORMULARIO DE CONTACTO B2B (Optimizado Móvil)
   ========================================= */
.contact-section {
    background-color: var(--color-surface);
    padding: 32px 16px; /* Menos espacio vacío en pantallas pequeñas */
}

.contact-container {
    max-width: 650px;
    margin: 0 auto;
    background-color: var(--color-background);
    padding: 32px 20px; /* Padding lateral cómodo para móvil */
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05); /* Sombra más suave y moderna */
    border-top: 5px solid var(--color-primary);
    width: 100%;
    box-sizing: border-box;
}

.form-group {
    margin-bottom: 28px; /* Separación amplia para evitar toques accidentales */
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--color-primary);
    font-size: 1.05rem; /* Letra un poco más grande para lectura rápida */
}

.form-control {
    width: 100%;
    padding: 18px 16px; /* ¡Campos enormes y fáciles de tocar! */
    border: 1.5px solid #E5E7EB;
    border-radius: 8px; 
    font-family: var(--font-body);
    font-size: 16px; /* CRÍTICO: 16px exactos evitan el zoom automático en iOS */
    transition: all 0.3s ease;
    background-color: #F9FAFB; /* Fondo gris súper claro para que resalte el input */
    box-sizing: border-box;
    color: var(--text-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(0, 107, 238, 0.15); /* Efecto glow azul B2B */
}

/* Mejora visual para el menú desplegable en móviles */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%230D2460" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 48px;
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 150px; /* Suficiente espacio inicial para el mensaje */
    line-height: 1.5;
}

/* Espacio para el widget de Turnstile */
.cf-turnstile-wrapper,
.turnstile-container {
    margin: 32px 0;
    display: flex;
    justify-content: center;
    width: 100%;
    overflow: hidden; /* Asegura que el iframe de Cloudflare no rompa el ancho del teléfono */
}

/* Botón gigante para conversión en móvil */
#submit-btn,
.contact-container .btn-primary {
    width: 100%;
    padding: 20px; /* Touch target masivo */
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(0, 107, 238, 0.3);
}

/* Ajustes para volver a verse compacto en Escritorio */
@media (min-width: 768px) {
    .contact-section {
        padding: 64px 20px;
    }
    .contact-container {
        padding: 48px;
    }
    .form-control {
        padding: 16px;
    }
}

/* =========================================
   CONSENT CARD (GDPR / Privacy)
   ========================================= */
#analytics-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 25, 64, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.consent-card {
  max-width: 560px;
  width: 100%;
  background: var(--color-background);
  border-radius: 16px;
  padding: 40px 32px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}
.consent-text {
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 28px;
}
.consent-text a {
  color: var(--color-accent);
  text-decoration: underline;
}
#consent-accept-btn {
  width: 100%;
  padding: 16px 32px;
  font-size: 1.1rem;
}

/* =========================================
   FLOATING WHATSAPP BUTTON
   ========================================= */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #25D366;
    color: white;
    padding: 14px 22px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--font-body);
    line-height: 1;
}
.whatsapp-float:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5);
    color: white;
}
.whatsapp-float:active {
    transform: translateY(-1px);
}
.whatsapp-float-text {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
}
@media (max-width: 767px) {
    .whatsapp-float {
        bottom: 16px;
        right: 16px;
        padding: 12px;
        border-radius: 50%;
        box-shadow: 0 4px 16px rgba(37, 211, 102, 0.5);
    }
    .whatsapp-float-text {
        display: none;
    }
}
