/* ===== VARIABLES Y RESET ===== */
:root {
    --primary-color: #1a3c6e; /* Azul Bóreas */
    --primary-dark: #122a4d;
    --secondary-color: #333333; /* Gris oscuro */
    --text-light: #666666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --whatsapp-green: #25D366;
    --gradient-overlay: linear-gradient(135deg, rgba(26, 60, 110, 0.95) 0%, rgba(18, 42, 77, 0.85) 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--secondary-color);
    line-height: 1.6;
    background-color: #fff;
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
}

/* ===== NAVEGACIÓN ===== */
nav {
    background-color: var(--white);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.8rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.logo i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    transition: 0.3s;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.cta-nav {
    background-color: var(--primary-color);
    color: var(--white) !important;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.cta-nav:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

/* ===== HERO SECTION - VIDEO HEADER ===== */
.hero {
    position: relative;
    min-height: 70vh;
    overflow: hidden;
    padding: 0;
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay para mejorar contraste sobre el video */
/* .hero-overlay removed — video will display without dark overlay */

/* WhatsApp flotante: centro derecha */
.whatsapp-float {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--whatsapp-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: translateY(-50%) scale(1.05);
}

.btn-main {
    background-color: var(--whatsapp-green);
    color: var(--white);
    padding: 16px 32px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 50px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    border: none;
    cursor: pointer;
}

.btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    background-color: #20bd5a;
}

.btn-main i {
    font-size: 1.4rem;
}

/* ===== SECCIONES GENERALES ===== */
section {
    padding: 5rem 10%;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* ===== SOBRE MÍ ===== */
.about-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text h3 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: var(--secondary-color);
}

.about-text p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* ===== SERVICIOS ===== */
.services-bg {
    background-color: var(--bg-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.service-card {
    background: var(--white);
    padding: 3rem 2rem;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    text-align: center;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(26, 60, 110, 0.08);
    border-color: rgba(26, 60, 110, 0.1);
}

.service-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    background-color: rgba(26, 60, 110, 0.05);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-card h3 {
    margin-bottom: 1rem;
}

.service-list {
    list-style: none;
    text-align: left;
    margin-top: 1.5rem;
}

.service-list li {
    margin-bottom: 10px;
    padding-left: 24px;
    position: relative;
    color: var(--text-light);
    font-size: 0.95rem;
}

.service-list li::before {
    content: '✓';
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 0.9rem;
}

/* ===== POR QUÉ ELEGIRNOS ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    text-align: center;
    margin: 0 auto;
    max-width: 1200px;
    align-items: start;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feature-item i {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    transition: 0.3s;
    font-size: 3rem;
}

.feature-item img.feature-image {
    width: 9rem;
    height: 9rem;
    margin-bottom: 1.5rem;
    object-fit: contain;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: 0.3s;
}

.feature-item:hover i {
    transform: scale(1.1);
}

.feature-item:hover .feature-image {
    transform: scale(1.1);
}

.feature-item h3 {
    margin: 1rem 0;
    font-size: 1.3rem;
}

.feature-item p {
    color: var(--text-light);
}

.section-footer-image {
    margin-top: 4rem;
    text-align: center;
}

.footer-badge {
    max-width: 150px;
    height: auto;
    opacity: 0.8;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(26, 60, 110, 0.15));
    border-radius: 12px;
}

.footer-badge:hover {
    opacity: 1;
    transform: translateY(-3px);
    filter: drop-shadow(0 6px 12px rgba(26, 60, 110, 0.25));
}

/* ===== ZONA Y PAGOS ===== */
.info-bg {
    background-color: var(--bg-light);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.info-box {
    background: var(--white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.info-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--primary-color);
}

.info-box.dark {
    background: var(--secondary-color);
    color: var(--white);
}

.info-box.dark::before {
    background: #555;
}

.info-box h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.info-box.dark h3 {
    color: var(--white);
}

.info-box ul {
    list-style: none;
}

.info-box ul li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
}

.info-box.dark ul li {
    color: #ccc;
}

.info-box p {
    margin-bottom: 15px;
    color: var(--text-light);
}

.info-box.dark p {
    color: #ccc;
}

/* ===== FOOTER ===== */
footer {
    background-color: #1a1a1a;
    color: #888;
    text-align: center;
    padding: 4rem 2rem;
    border-top: 5px solid var(--primary-color);
}

footer h3 {
    color: var(--white);
    margin-bottom: 0.5rem;
}

.footer-subtitle {
    margin: 10px 0;
}

.footer-cta {
    margin: 30px 0;
}

footer p {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ===== ASISTENTE IA ===== */
.ai-section {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    border-top: 1px solid #ddd;
}

.ai-subtitle {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-light);
    font-size: 1rem;
}

.ai-container {
    max-width: 900px;
    margin: 0 auto;
}

.ai-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.ai-tab {
    background: white;
    border: 2px solid #ddd;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.ai-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(26, 60, 110, 0.2);
}

.ai-tab:hover:not(.active) {
    background: #f0f0f0;
    border-color: var(--primary-color);
}

.ai-tab i {
    font-size: 1.1rem;
}

.ai-content {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    display: none;
    animation: fadeIn 0.4s ease;
}

.ai-content.active {
    display: block;
}

.ai-input-group {
    margin-bottom: 20px;
}

.ai-input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 1rem;
}

.ai-input-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
    font-family: 'Roboto', sans-serif;
}

.ai-input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(26, 60, 110, 0.15);
}

.ai-btn-sparkle {
    width: 100%;
    margin-top: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0d1f3c 100%);
    box-shadow: 0 4px 15px rgba(26, 60, 110, 0.3);
}

.ai-btn-sparkle:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #05131f 100%);
    box-shadow: 0 6px 20px rgba(26, 60, 110, 0.4);
}

.ai-result {
    margin-top: 25px;
    padding: 25px;
    background: #f8faff;
    border-radius: 10px;
    border-left: 5px solid var(--primary-color);
    display: none;
    animation: slideInUp 0.4s ease;
}

.ai-result.display {
    display: block;
}

.ai-result h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.ai-result h4 i {
    font-size: 1.4rem;
}

#diag-text,
#calc-text {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 0.95rem;
}

#diag-text p,
#calc-text p {
    margin-bottom: 12px;
}

#diag-text strong,
#calc-text strong {
    color: var(--primary-color);
    font-weight: 700;
}

#diag-text ul,
#calc-text ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

#diag-text li,
#calc-text li {
    margin-bottom: 8px;
}

.ai-result-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    text-align: right;
}

.btn-small {
    padding: 10px 20px;
    font-size: 0.9rem;
    display: inline-flex;
    width: auto;
}

.ai-loading {
    display: none;
    text-align: center;
    margin-top: 20px;
    color: var(--primary-color);
    font-weight: 600;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.ai-loading i {
    font-size: 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideInUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    /* HERO: cambiar a diseño vertical en pantallas más pequeñas */
    .hero {
        flex-direction: column-reverse;
        min-height: auto;
    }

    .hero-image-side {
        min-height: 400px;
        background-attachment: scroll;
    }

    /* Mover el botón de WhatsApp a la esquina inferior para pantallas medianas */
    .whatsapp-float {
        right: 16px;
        top: auto;
        bottom: 20px;
        transform: none;
        width: 52px;
        height: 52px;
        font-size: 1.4rem;
    }

    .hero-text-side {
        min-height: 60vh;
        padding: 3rem 2rem;
    }

    .hero-text-side h1 {
        font-size: 2.2rem;
        max-width: 100%;
    }

    .hero-text-side p {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--white);
        padding: 20px;
        gap: 15px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .logo {
        justify-content: center;
        width: 100%;
    }

    section {
        padding: 4rem 5%;
    }

    .btn-main {
        width: 100%;
        justify-content: center;
    }

    .section-title {
        font-size: 2rem;
    }

    /* HERO: volver a centrar en móviles y oscurecer vidrio para legibilidad */
    .hero {
        flex-direction: column-reverse;
    }

    .hero-text-side {
        min-height: 50vh;
        padding: 2rem;
    }

    .hero-image-side {
        min-height: 300px;
    }

    /* AI Responsive */
    .ai-tabs {
        flex-direction: column;
        gap: 10px;
    }

    .ai-tab {
        width: 100%;
        justify-content: center;
    }

    .ai-content {
        padding: 1.5rem;
    }

    .ai-input-group textarea {
        min-height: 100px;
    }

    .ai-result {
        padding: 15px;
        border-left: 4px solid var(--primary-color);
    }

    .ai-result h4 {
        font-size: 1rem;
    }

    /* Ajustes para WhatsApp en móviles: tamaño reducido y ocultar en pantallas muy pequeñas */
    .whatsapp-float {
        right: 14px;
        bottom: 18px;
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    @media (max-width: 420px) {
        .whatsapp-float { display: none; }
    }

    #diag-text,
    #calc-text {
        font-size: 0.9rem;
    }

    .ai-result-footer {
        text-align: center;
    }

    .btn-small {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Ajustes adicionales para smartphones y tablets ===== */
/* Objetivo: asegurar buena visualización en Samsung, iPhone, Xiaomi, Motorola y tablets */

@media (max-width: 1200px) {
    .features-grid { max-width: 980px; }
    .service-card { padding: 2.2rem 1.5rem; }
}

@media (max-width: 992px) {
    .features-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    .feature-item img.feature-image { width: 5rem; height: 5rem; }
    .service-icon { width: 70px; height: 70px; font-size: 3rem; }
}

@media (max-width: 768px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
    .feature-item img.feature-image { width: 4rem; height: 4rem; }
    .footer-badge { max-width: 120px; }
    section { padding: 3.5rem 6%; }
    .section-title { font-size: 2rem; }
}

@media (max-width: 600px) {
    .features-grid { grid-template-columns: 1fr; gap: 1.6rem; }
    .feature-item img.feature-image { width: 3rem; height: 3rem; }
    .service-card { padding: 1.6rem 1rem; }
    .section { padding: 3rem 5%; }
    .btn-main { padding: 12px 20px; }
    .whatsapp-float { width: 46px; height: 46px; font-size: 1.1rem; }
    .footer-badge { max-width: 110px; }
}

/* Ajustes para pantallas pequeñas muy comunes (iPhone/Android pequeños) */
@media (max-width: 420px) {
    .feature-item img.feature-image { width: 2.6rem; height: 2.6rem; }
    .footer-badge { max-width: 100px; border-radius: 10px; }
    .hero { min-height: 40vh; }
    .section-title { font-size: 1.6rem; }
}

/* Ajustes puntuales para anchos de dispositivos reales */
@media (max-width: 412px) { /* Galaxy S/Some Android */
    .service-icon { width: 64px; height: 64px; font-size: 2.6rem; }
}

@media (max-width: 390px) { /* iPhone 12/13 mini */
    .nav-links a { font-size: 0.9rem; }
    .btn-main { font-size: 1rem; padding: 10px 18px; }
}

@media (max-width: 360px) { /* Small Android phones */
    .logo { font-size: 0.95rem; }
    .section { padding: 2.5rem 4%; }
    .ai-container { padding: 0 8px; }
}

/* Asegurar que los badges y las imágenes no rompan el layout */
.section-footer-image { word-break: normal; }

/* Ajustes generales de compatibilidad táctil y display */
img { max-width: 100%; height: auto; display: block; }
button, a.btn-main { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* Evitar que el badge o imágenes grandes empujen el contenido: altura mínima uniforme */
.feature-item { min-height: 200px; }

/* Ajustes para video header: mejor posición del objeto en distintos dispositivos */
.hero-video video { object-position: center 30%; }

/* Soporte para iOS safe-area (notch, home indicator) */
body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }

/* Mejoras en renderizado de imágenes en pantallas Retina */
.footer-badge { image-rendering: optimizeQuality; }

/* Pequeña animación por hardware (no invasiva) */
.footer-badge, .feature-item img.feature-image {
    will-change: transform, opacity;
}

