/* --- CONFIGURACIÓN PRINCIPAL --- */
:root {
    --primary: #0066cc;       /* Azul Principal */
    --dark: #0f172a;          /* Azul Oscuro (Footer/Hero) */
    --accent: #ffbc00;        /* Amarillo/Dorado (Destacados) */
    --bg: #f8fafc;            /* Fondo Web muy suave */
    --text: #334155;          /* Color texto gris oscuro */
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- HEADER & MENÚ (PC) --- */
header {
    background: white;
    padding: 15px 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: sticky; /* En PC se queda fijo todo */
    top: 0;
    z-index: 1000;
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text { font-size: 1.5rem; font-weight: bold; color: var(--dark); }
.logo-text strong { color: var(--primary); }
.main-logo { max-height: 50px; }

.menu-right { display: flex; gap: 15px; align-items: center; }

/* Botones del Menú */
.phone-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.1rem;
}

.btn-menu-contact {
    background: var(--dark);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}
.btn-menu-contact:hover { background: var(--primary); }

/* --- HERO (FONDO CON IMAGEN) --- */
.hero {
    /* Fondo oscuro + Imagen */
    background: linear-gradient(rgba(15, 23, 42, 0.85), rgba(0, 86, 179, 0.7)), 
                url('https://images.unsplash.com/photo-1585704032915-c3400ca199e7?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Efecto Parallax */
    color: white;
    text-align: center;
    padding: 140px 0;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 30px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    line-height: 1.1;
}

/* Botón Hero (Borde Blanco) */
.btn-outline-hero {
    background: transparent;
    border: 3px solid white;
    color: white;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.btn-outline-hero:hover {
    background: white;
    color: var(--primary);
    transform: scale(1.05);
}

/* --- SECCIÓN SERVICIOS --- */
.services { padding: 80px 0; }

.services h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--dark);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* Tarjeta Individual */
.card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: center;
    position: relative;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
}

.card:hover { transform: translateY(-10px); }

.card.highlight {
    border: 2px solid var(--accent);
    box-shadow: 0 15px 40px rgba(255, 188, 0, 0.15);
}

.badge-top {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #000;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 6px 15px;
    border-radius: 20px;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.icon-wrapper {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.service-emoji { font-size: 4rem; }
.service-img { max-height: 100%; width: auto; }

.card h3 {
    font-size: 1.5rem;
    margin: 0 0 15px;
    color: var(--dark);
}

.desc {
    flex-grow: 1;
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

.price-tag {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary);
    font-weight: 800;
    font-size: 1.3rem;
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.btn-sm {
    background: var(--dark);
    color: white;
    border: none;
    padding: 12px;
    width: 100%;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
}
.btn-sm:hover {
    background: var(--accent);
    color: black;
}

.condiciones-text {
    margin-top: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    border-top: 1px dashed #e2e8f0;
    padding-top: 15px;
}

/* --- FOOTER MODERNO --- */
.footer-modern {
    background: var(--dark);
    color: #cbd5e1;
    padding: 60px 0 30px;
    margin-top: 50px;
    border-top: 5px solid var(--primary);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    text-align: left;
}

.footer-modern h3 { color: white; margin-top: 0; font-size: 1.5rem; }
.footer-modern h4 { color: var(--accent); margin-bottom: 20px; text-transform: uppercase; font-size: 0.9rem; letter-spacing: 1px; }
.footer-modern p { margin-bottom: 10px; }

/* --- MODAL / POPUP --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: bajarModal 0.3s ease-out;
}

@keyframes bajarModal {
    from { transform: translateY(-100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #aaa;
}
.close-btn:hover { color: red; }

.modal-content input, 
.modal-content textarea {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
    background: #f9f9f9;
}

.btn-submit {
    background: var(--primary);
    color: white;
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    font-size: 1.1rem;
    margin-top: 15px;
    text-transform: uppercase;
}
.btn-submit:hover { background: var(--dark); }


/* =========================================================
   BOTONES FLOTANTES (WhatsApp + Contacto Azul)
   ========================================================= */
.whatsapp-container {
    position: fixed;
    bottom: 25px;       /* Distancia en PC */
    right: 25px;
    z-index: 2000;      /* Por encima de todo */
    display: flex;
    flex-direction: column-reverse; /* ESTO HACE LA MAGIA: Apila hacia arriba */
    align-items: center;
    gap: 15px;          /* Espacio entre botones */
}

/* 1. Botón Verde (WhatsApp) */
.btn-whatsapp {
    background-color: #25D366;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    text-decoration: none;
}
.btn-whatsapp:hover { transform: scale(1.1); }
.btn-whatsapp img { width: 35px; height: 35px; }

/* 2. Botón Azul (Contacto) - Flotante */
.btn-float-contact {
    background-color: #0066cc; /* Azul Corporativo */
    width: 50px;               /* Un poco más pequeño que WhatsApp */
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: none;
    cursor: pointer;
    color: white;
    font-size: 24px;          /* Icono sobre */
    transition: transform 0.3s ease;
}
.btn-float-contact:hover { transform: scale(1.1); background-color: #004494; }

/* La cajita de mensaje de ayuda */
.whatsapp-msg {
    background: white;
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    color: #333;
    font-weight: bold;
    font-size: 0.85rem;
    position: absolute;
    bottom: 5px;   /* Alineado con WhatsApp */
    right: 70px;   /* A la izquierda */
    width: 200px;
    
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.5s ease;
}

.whatsapp-msg.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.whatsapp-msg::after {
    content: '';
    position: absolute;
    right: -8px;
    bottom: 20px;
    border-left: 8px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}


/* =========================================================
   VERSION MÓVIL (Logo Fijo + Scroll Limpio + Botones)
   ========================================================= */
@media (max-width: 768px) {

    /* 1. HEADER: Espacio reservado para la barra fija */
    header {
        position: relative; /* Quitamos sticky general */
        padding: 0;
        padding-top: 80px;  /* Espacio para que el contenido no quede tapado por el logo */
        padding-bottom: 20px;
        background: transparent;
        box-shadow: none;
    }

    /* 2. LOGO: SE QUEDA FIJO SIEMPRE (App Style) */
    .logo-container {
        position: fixed;    
        top: 0;
        left: 0;
        width: 100%;
        height: 70px;       /* Barra blanca fija */
        background: white;
        z-index: 3000;      /* Capa superior */
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .main-logo { height: 45px; }

    /* 3. MENÚ RESTANTE: Hace scroll y desaparece */
    .nav-flex { 
        /* Flujo normal para que haga scroll */
    }

    .menu-right {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        width: 100%;
    }

    .phone-link {
        font-size: 1.3rem;
        color: #0066cc;
    }

    .btn-menu-contact {
        width: 85%;
        padding: 14px;
        font-size: 1rem;
    }

    /* 4. HERO */
    .hero {
        padding-top: 40px; 
        padding-bottom: 60px;
    }
    
    .hero h1 { 
        font-size: 2.2rem;
        line-height: 1.2;
        padding: 0 15px;
    }

    .footer-grid { text-align: center; }

    /* 5. AJUSTE BOTONES FLOTANTES EN MÓVIL */
    .whatsapp-container { 
        bottom: 90px; /* Subido para evitar barra de navegación móvil */
        right: 20px; 
    }
    
    .btn-whatsapp { width: 55px; height: 55px; }
    .btn-float-contact { width: 45px; height: 45px; font-size: 20px; }
    
    .whatsapp-msg { display: none; } /* Ocultar burbuja texto en móvil */
}