﻿/* VARIABLES DE MARCA PROFESIONAL */
:root {
    --primary: #2d218c;
    --primary-light: #4035a6;
    --accent: #f2c400;
    --text-dark: #1a1a1a;
    --text-muted: #666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Inter', -apple-system, sans-serif; 
    color: var(--text-dark); 
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* HEADER & NAVEGACI�"N */
header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #eee;
}

.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 5%; max-width: 1400px; margin: 0 auto;
}

.logo{
    font-size:34px;
    font-weight:800;
    color:var(--primary);
    text-decoration:none;
    letter-spacing:-1px;
}
.logo span { color: var(--accent); }

.logos{
    display:flex;
    justify-content:center;
    gap:40px;
    flex-wrap:wrap;
}

.logos img{
    height:50px;
    opacity:.8;
}

nav { display: flex; gap: 30px; }
nav a {
    text-decoration: none; color: var(--text-dark);
    font-weight: 600; font-size: 14px; text-transform: uppercase;
    transition: var(--transition);
}
nav a:hover { color: var(--primary); }

/* HERO SECTION - IMPACTO INICIAL */
.hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), 
                url('https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?q=80&w=2000') center/cover no-repeat;
    height: 80vh; display: flex; align-items: center; padding: 0 5%;
}

.overlay {
    background: var(--white); padding: 50px; border-radius: 4px;
    max-width: 600px; border-left: 10px solid var(--accent);
    box-shadow: 20px 20px 60px rgba(0,0,0,0.3);
}

.hero h1 { font-size: 45px; line-height: 1.1; color: var(--primary); margin-bottom: 20px; }
.hero p { font-size: 18px; color: var(--text-muted); margin-bottom: 30px; }

.hero button {
    background: var(--primary); color: white; border: none;
    padding: 16px 35px; border-radius: 4px; font-weight: 700;
    cursor: pointer; transition: var(--transition); text-transform: uppercase;
}
.hero button:hover { background: var(--primary-light); transform: translateY(-3px); }

/* SECCIONES GENERALES */
section { padding: 100px 5%; max-width: 1400px; margin: 0 auto; }
h2 { text-align: center; font-size: 32px; margin-bottom: 50px; color: var(--primary); }
h2::after { content: ''; display: block; width: 50px; height: 4px; background: var(--accent); margin: 15px auto; }

/* STATS - PRUEBA SOCIAL */
.stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px; text-align: center; margin-top: 40px;
}
.stats div { padding: 30px; background: var(--bg-light); border-radius: 8px; }
.stats h3 { font-size: 36px; color: var(--primary); }

/* SERVICIOS - GRID PROFESIONAL */
.cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px;
}
.card {
    padding: 40px; background: var(--white); border: 1px solid #eee;
    border-radius: 8px; transition: var(--transition);
}
.card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-5px); }
.card i { color: var(--accent); margin-bottom: 20px; font-size: 2rem; }
.card h3 { margin-bottom: 15px; color: var(--primary); }

/* FORMULARIO */
#formContacto {
    max-width: 600px; margin: 0 auto; display: grid; gap: 15px;
}
input, textarea {
    padding: 15px; border: 1px solid #ddd; border-radius: 4px; font-family: inherit;
}
input:focus, textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
button:disabled { cursor: not-allowed; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; }
.captcha-wrap { margin-top: 5px; }
#mensajeForm { min-height: 24px; }

/* FORMULARIO - MEJORAS VISUALES */
.contacto form {
    background: var(--white);
    border: 1px solid #e8e8e8;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.contacto form input,
.contacto form textarea {
    background: #fbfbfb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contacto form input:focus,
.contacto form textarea:focus {
    box-shadow: 0 0 0 3px rgba(45, 33, 140, 0.15);
}

.contacto form button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.contacto form button:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(45, 33, 140, 0.2);
}

.contacto form button:disabled {
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.captcha-wrap {
    padding: 10px 12px;
    border: 1px dashed #d2d2d2;
    border-radius: 6px;
    background: #f6f6f6;
}

#mensajeForm {
    font-size: 0.95rem;
}

/* FOOTER */
footer { background: #1a1a1a; color: #888; padding: 60px 5%; text-align: center; }

/* MOBILE */
@media(max-width: 900px) {
    .hero h1 { font-size: 30px; }
    .overlay { padding: 30px; }
    nav { display: none; } /* Implementar menú hamburguesa aquí */
}

/* --- ESTILOS DEL SIDEBAR --- */
.sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: #0a192f;
    z-index: 3000;
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    /* Quitamos flex innecesario para evitar problemas de alineación */
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    overflow-y: auto; /* El scroll va aquí mejor */
}

.sidebar.active {
    transform: translateX(-320px);
}

.sidebar-header {
    padding: 35px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-content {
    padding: 40px 25px;
}

/* Títulos */
.vertical-group h4 {
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.vertical-group h4::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(242, 196, 0, 0.2);
    margin-left: 15px;
}

/* Listado puramente VERTICAL */
.vertical-list {
    list-style: none;
    padding: 0;
    margin: 0;
    /* Eliminado Flexbox para evitar que se pongan en fila por error */
}

.vertical-list li {
    margin-bottom: 5px;
}

.vertical-list li a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
    display: block; /* Esto garantiza la verticalidad */
    padding: 12px 15px;
    border-radius: 6px;
    transition: 0.3s;
    border-left: 3px solid transparent;
}

.vertical-list li a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    border-left: 3px solid var(--accent);
    padding-left: 20px;
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(to right, rgba(255,255,255,0.1), transparent);
    margin: 15px 0 30px 0;
}

/* --- ANIMACIONES --- */
.vertical-group {
    opacity: 0;
    transform: translateX(10px);
    transition: 0.4s ease-out;
}

.sidebar.active .vertical-group {
    opacity: 1;
    transform: translateX(0);
}

/* Delays corregidos según orden de tu HTML */
.vertical-group:nth-child(1) { transition-delay: 0.2s; }
.vertical-group:nth-child(3) { transition-delay: 0.3s; }

/* Overlay */
.menu-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 25, 47, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    z-index: 2500;
}

.menu-overlay.active {
    display: block;
}

/* --- ESTILOS BASE (Asegúrate de que el vertical-group tenga esto) --- */
.vertical-group {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.5s ease-out;
}

.sidebar.active .vertical-group {
    opacity: 1;
    transform: translateX(0);
}

/* --- MEDIA QUERIES CORREGIDOS --- */

/* Ventana de ordenador reducida o Tablets */
@media (max-width: 1024px) {
    .sidebar {
        width: 300px;
        right: -300px; /* Alineado al nuevo ancho */
    }
    .sidebar.active {
        transform: translateX(-300px); /* Movemos exacto el ancho */
    }
}

/* Modo Móvil */
@media (max-width: 768px) {
    .sidebar {
        width: 280px; 
        right: -280px;
        /* Forzamos que el contenido sea visible */
        display: flex !important; 
        flex-direction: column;
    }

    .sidebar.active {
        transform: translateX(-280px);
    }

    /* Aseguramos que el contenido no se desborde */
    .sidebar-content {
        padding: 20px;
        width: 100%;
    }

    /* Si el contenido desaparece, puede ser por un delay muy largo. 
       Ajustamos los delays para móvil para que aparezcan más rápido */
    .vertical-group:nth-child(1) { transition-delay: 0.1s; }
    .vertical-group:nth-child(3) { transition-delay: 0.2s; }
}

/* Móvil muy pequeño (Pantalla completa) */
@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        right: -100%;
    }
    .sidebar.active {
        transform: translateX(-100%);
    }
}

/* 1. Asegura que el contenedor de contenido sea visible */
.sidebar-content {
    padding: 40px 25px;
    width: 100%;       /* Obligatorio */
    display: block;    /* Cambiamos de flex a block para evitar errores en móvil */
    position: relative;
    z-index: 3001;     /* Por encima del fondo del sidebar */
}

/* 2. REGLA CRÍTICA: Forzar la aparición del contenido */
.sidebar.active .vertical-group {
    opacity: 1 !important;
    transform: translateX(0) !important;
    visibility: visible !important;
}

/* 3. Ajuste del @media para móviles */
@media (max-width: 768px) {
    .sidebar {
        width: 280px; 
        right: -280px;
    }

    .sidebar.active {
        transform: translateX(-280px);
    }

    /* Reseteamos cualquier delay que pueda estar tardando demasiado en móvil */
    .vertical-group {
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .vertical-list li a {
        display: block;
        width: 100%;
        color: #ffffff; /* Aseguramos contraste total */
    }
}

.close-btn{
    color:white;
    font-size:22px;
    cursor:pointer;
}

