/* =========================================
   1. VARIABLES Y RESET BÁSICO
========================================= */
:root {
    --primary-color: #ff6600; /* Naranja corporativo */
    --primary-hover: #e65c00;
    --dark-bg: #1a1a1a;
    --light-bg: #f9f9f9;
    --text-color: #333333;
    --text-light: #ffffff;
}

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

/* Seguro de vida contra el scroll horizontal (Grid Blowout) */
html, body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--text-light);
    overflow-x: hidden; 
    max-width: 100vw; 
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

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

/* =========================================
   2. CABECERA Y NAVEGACIÓN
========================================= */
.main-header {
    background-color: var(--text-light);
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    position: relative;
    z-index: 100;
}

.flex-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark-bg);
    text-decoration: none;
}
/* Esto controla el tamaño de tu nuevo logo en imagen */
.main-logo {
    height: 60px; /* Altura ideal para la barra de navegación de ordenador */
    width: auto;
    display: block;
    margin: 0;
    transition: transform 0.3s ease;
}

.main-logo:hover {
    transform: scale(1.05); /* Pequeño efecto al pasar el ratón */
}
.nav-list {
    list-style: none;
    display: flex;
    align-items: center;
}

.nav-list li { 
    margin-left: 30px; 
}

.nav-list a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: color 0.3s;
}

.nav-list a:hover, 
.nav-list a.active { 
    color: var(--primary-color); 
}

.btn-nav {
    background-color: var(--dark-bg);
    color: var(--text-light) !important;
    padding: 10px 20px;
    border-radius: 5px;
}

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

/* MENÚ MÓVIL (Hamburguesa) */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle .bar {
    width: 25px; 
    height: 3px;
    background-color: var(--dark-bg);
    margin: 4px 0;
    transition: 0.3s;
}

/* =========================================
   3. PÁGINA DE INICIO (HOME)
========================================= */
.hero-section {
    position: relative;
    background-image: url('../assets/img/hero_bg.webp'); 
    background-size: cover;
    background-position: center;
    padding: 160px 0;
    text-align: center;
    color: var(--text-light);
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 { 
    font-size: 3.5rem; 
    line-height: 1.1; 
    margin-bottom: 20px; 
}

.hero-content p { 
    font-size: 1.2rem; 
    margin-bottom: 40px; 
}

.btn-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 5px;
    transition: 0.3s;
}

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

/* Autoridad (Logos) */
.trust-section { 
    background-color: var(--light-bg); 
    padding: 40px 0; 
    text-align: center; 
}

.trust-title { 
    font-size: 0.9rem; 
    color: #666; 
    margin-bottom: 20px; 
}

.logos-grid { 
    display: flex; 
    justify-content: center; 
    align-items: center;
    gap: 50px; 
    flex-wrap: wrap; 
}

.logos-grid img {
    height: 65px; 
    width: auto;
    filter: grayscale(100%); 
    opacity: 0.6;
    transition: all 0.3s ease;
}

.logos-grid img:hover {
    filter: grayscale(0%); 
    opacity: 1;
}

/* Resultados Reales (Antes y Después) */
.portfolio-section {
    padding: 80px 0;
    background-color: var(--text-light);
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.comparison-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.comparison-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.badge {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 15px;
    font-weight: 800;
    border-radius: 4px;
    color: white;
    font-size: 0.9rem;
    letter-spacing: 1px;
    z-index: 10;
}

.badge-antes { background-color: #dc3545; } 
.badge-despues { background-color: #28a745; } 

/* Datos */
.stats-section { padding: 80px 0; }

.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 40px; 
    text-align: center; 
}

.stat-box h2 { 
    font-size: 3.5rem; 
    color: var(--primary-color); 
    line-height: 1; 
}

/* Proceso */
.process-section { 
    background-color: var(--dark-bg); 
    color: var(--text-light); 
    padding: 100px 0; 
}

.section-title { 
    text-align: center; 
    font-size: 2.5rem; 
    margin-bottom: 60px; 
}

.process-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 40px; 
}

.step { 
    background-color: rgba(255,255,255,0.05); 
    padding: 40px; 
    border-radius: 8px; 
    border-top: 4px solid var(--primary-color); 
}

.step-number { 
    font-size: 3rem; 
    font-weight: 800; 
    color: rgba(255,102,0,0.3); 
    margin-bottom: 10px; 
}

/* =========================================
   4. PÁGINA DE CONTACTO Y FORMULARIO
========================================= */
.contact-section { 
    padding: 80px 0; 
}

.contact-wrapper {
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 60px;
    align-items: flex-start; 
    max-width: 1100px; 
    margin: 0 auto;
}

.contact-info h1 { 
    font-size: 2.5rem; 
    color: var(--dark-bg); 
    margin-bottom: 20px; 
    line-height: 1.2; 
}

.contact-info p { 
    font-size: 1.1rem; 
    color: #555; 
    margin-bottom: 30px; 
}

.contact-details {
    background-color: #fff; 
    padding: 30px; 
    border-radius: 8px;
    border-left: 4px solid var(--primary-color); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.detail-item { 
    display: flex; 
    align-items: center; 
    margin-top: 15px; 
    font-size: 1.2rem; 
    color: var(--dark-bg); 
}

.detail-item .icon { 
    margin-right: 15px; 
    font-size: 1.5rem; 
}

.contact-form-card {
    background-color: #fff; 
    padding: 40px; 
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.form-group { 
    margin-bottom: 20px; 
    display: flex; 
    flex-direction: column; 
}

.form-group label { 
    font-weight: 600; 
    margin-bottom: 8px; 
    color: var(--dark-bg); 
    font-size: 0.95rem; 
}

.form-group input[type="text"], 
.form-group input[type="tel"], 
.form-group input[type="email"], 
.form-group select {
    padding: 12px 15px; 
    border: 1px solid #ccc; 
    border-radius: 6px; 
    font-size: 1rem; 
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus, 
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.file-upload-group input[type="file"] {
    padding: 10px; 
    background-color: #f4f4f4; 
    border: 1px dashed #bbb; 
    border-radius: 6px; 
    cursor: pointer;
    font-family: inherit;
}

.file-upload-group small {
    color: #888;
    margin-top: 5px;
    font-size: 0.85rem;
}

.checkbox-group { 
    flex-direction: row; 
    align-items: flex-start; 
    gap: 10px; 
    margin-top: 30px; 
}

.checkbox-group input {
    margin-top: 4px;
    cursor: pointer;
}

.checkbox-group label {
    font-size: 0.9rem;
    color: #666;
}

.checkbox-group a {
    color: var(--primary-color);
}

.btn-submit { 
    width: 100%; 
    margin-top: 20px; 
    border: none; 
    cursor: pointer; 
    font-size: 1.2rem; 
}

/* =========================================
   5. PÁGINAS LEGALES
========================================= */
.legal-content { 
    padding: 60px 0; 
    max-width: 800px; 
    margin: 0 auto; 
}
.legal-content h1 { 
    margin-bottom: 30px; 
    font-size: 2rem; 
    color: var(--primary-color); 
}
.legal-content h2 { 
    margin-top: 30px; 
    margin-bottom: 10px; 
    font-size: 1.2rem; 
}
.legal-content p, .legal-content ul { 
    margin-bottom: 15px; 
    color: #555; 
}
.legal-content ul {
    margin-left: 20px;
}

/* =========================================
   6. FOOTER
========================================= */
.main-footer { 
    background-color: #111; 
    color: #777; 
    padding: 40px 0; 
    text-align: center; 
}
.legal-links a { 
    color: #777; 
    text-decoration: none; 
    margin: 0 10px; 
    transition: 0.3s;
}
.legal-links a:hover {
    color: var(--text-light);
}

/* =========================================
   7. BOTÓN FLOTANTE WHATSAPP (OCULTO EN PC)
========================================= */
.whatsapp-float {
    display: none; /* Oculto por defecto en ordenadores */
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25d366; 
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    box-shadow: 0px 4px 15px rgba(0,0,0,0.15);
    z-index: 1000; 
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #1ebe57; 
    transform: scale(1.1); 
}

.whatsapp-icon {
    width: 35px;
    height: 35px;
    fill: white;
}

/* =========================================
   8. ADAPTACIÓN MÓVIL (RESPONSIVE)
========================================= */
@media (max-width: 900px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    /* Menú móvil */
    .menu-toggle { display: flex; }
    
    /* Ajuste del logo principal en móvil */
    .main-logo { height: 35px; }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background-color: var(--text-light);
        border-bottom: 1px solid #eee;
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.05);
    }
    
    .main-nav.active { display: block; }
    
    .nav-list { flex-direction: column; align-items: center; gap: 20px; }
    .nav-list li { margin: 0; }
    
    /* Textos Inicio: Subimos el botón y forzamos tamaños fijos */
    .hero-section { padding: 80px 0; }
    .hero-content h1 { font-size: 32px !important; }
    .hero-content p { font-size: 16px; margin-bottom: 25px; }
    
    .section-title {
        font-size: 26px !important;
        padding: 0 10px;
        word-wrap: break-word;
    }
    
    /* Logos y Fotos en móvil */
    .logos-grid img { height: 25px; }
    .comparison-grid { grid-template-columns: 1fr; }

    /* Reducción de espacios blancos entre secciones */
    .trust-section { padding: 30px 0; }
    .portfolio-section { padding: 40px 0; }
    .stats-section { padding: 40px 0; }
    .process-section { padding: 50px 0; }
    
    /* =======================================================
       CONTACTO: BLINDAJE EXTREMO CONTRA EL DESBORDAMIENTO
       ======================================================= */
    .contact-section { 
        padding: 40px 0; 
        overflow: hidden; 
    }
    
    .contact-info, 
    .contact-form-card { 
        min-width: 0; 
        width: 100%; 
        overflow: hidden;
    }
    
    .contact-info h1 {
        font-size: 28px !important; 
        line-height: 1.2 !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    .contact-form-card { padding: 20px; }
    .contact-details { padding: 15px; }

    .detail-item strong {
        font-size: 16px;
        word-wrap: break-word; 
        white-space: pre-wrap;
    }

   /* =======================================================
       WHATSAPP: MOSTRAR SOLO EN MÓVIL (CON DELAY DE 2.5 SEGUNDOS)
       ======================================================= */
    .whatsapp-float {
        display: flex;
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        
        /* Empezamos con el botón invisible y encogido */
        opacity: 0;
        transform: scale(0);
        pointer-events: none; /* Evita clics accidentales mientras es invisible */
        
        /* La animación dura 0.5s, tiene un delay de 2.5s y se queda visible al terminar (forwards) */
        animation: aparecerWhatsApp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 2.5s forwards;
    }
    
    .whatsapp-icon {
        width: 30px;
        height: 30px;
    }

    /* Definimos cómo es la animación de aparición (Efecto "Pop" suave) */
    @keyframes aparecerWhatsApp {
        0% {
            opacity: 0;
            transform: scale(0);
        }
        100% {
            opacity: 1;
            transform: scale(1);
            pointer-events: auto; /* Vuelve a ser clicable */
        }
    }

/* =========================================
   9. BARRA DE PROGRESO ANIMADA
========================================= */
.progress-wrapper {
    display: none; /* Oculta por defecto */
    margin-top: 20px;
    text-align: center;
}

.progress-container {
    width: 100%;
    height: 22px;
    background-color: #eee;
    border-radius: 12px;
    overflow: hidden;
    margin: 10px 0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    /* Efecto de rayas diagonales */
    background-image: linear-gradient(
        45deg, 
        rgba(255,255,255,0.2) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255,255,255,0.2) 50%, 
        rgba(255,255,255,0.2) 75%, 
        transparent 75%, 
        transparent
    );
    background-size: 30px 30px;
    /* Animación de las rayas moviéndose */
    animation: moveStripes 1s linear infinite;
    /* Transición suave al crecer */
    transition: width 0.3s ease, background-color 0.3s ease;
}

@keyframes moveStripes {
    0% { background-position: 30px 0; }
    100% { background-position: 0 0; }
}
}