/* --- Variables & Reset --- */
:root {
    /* PALETA DE COLORES SAEF */
    --primary-color: #0033CC;   /* Azul Fuerte */
    --secondary-color: #00C853; /* Verde Brillante */
    --accent-color: #d92027;    /* Rojo Urgencias */
    --warning-color: #FFC107;   /* Amarillo/Naranja */
    
    --text-color: #333;
    --light-bg: #f4f8fb;        /* Fondo muy claro azulado */
    --white: #ffffff;
    
    /* Tipografías */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- Layout Utils --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section { padding: 80px 0; }
.bg-light { background-color: var(--light-bg); }

.section-header {
    text-align: center;
    margin-bottom: 50px;
}
.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 700;
}
/* Divisor con degradado Azul a Verde */
.divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
    margin: 0 auto 20px;
    border-radius: 2px;
}
.divider.bg-white { background: var(--white); }

/* --- Header & Logo --- */
header {
    background: var(--white);
    box-shadow: 0 4px 20px rgba(0, 51, 204, 0.08);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: 90px;
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo a {
    display: flex;
    align-items: center;
}

.header-logo-img {
    height: 70px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s;
}

.header-logo-img:hover {
    transform: scale(1.05);
}

/* --- Navegación --- */
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a {
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary-color);
    font-family: var(--font-heading);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0; height: 2px;
    bottom: -5px; left: 0;
    background-color: var(--secondary-color);
    transition: 0.3s;
}
.nav-links a:hover::after { width: 100%; }

.nav-links .highlight { 
    color: var(--white);
    background-color: var(--accent-color);
    padding: 10px 20px;
    border-radius: 50px;
}
.nav-links .highlight::after { display: none; } 
.nav-links .highlight:hover { 
    background-color: #b9151b; 
    box-shadow: 0 4px 10px rgba(217, 32, 39, 0.3);
}

.hamburger { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: var(--primary-color); transition: 0.3s; }

/* --- Hero Section --- */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    margin-top: 90px;
}

.hero-bg-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: -2;
}

.hero-bg-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(
        135deg, 
        rgba(0, 51, 204, 0.8),  
        rgba(0, 200, 83, 0.7)   
    );
    z-index: -1; 
    backdrop-filter: blur(2px);
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    font-weight: 500;
}

.hero-btns { margin-top: 30px; display: flex; gap: 20px; justify-content: center; }

/* Botones */
.btn {
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 700;
    font-family: var(--font-heading);
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary { 
    background: var(--white); 
    color: var(--primary-color); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.btn-primary:hover { 
    background: var(--primary-color); 
    color: var(--white);
    transform: translateY(-3px);
}

.btn-secondary { 
    background: var(--warning-color); 
    color: #000; 
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}
.btn-secondary:hover { 
    background: #e0a800; 
    transform: translateY(-3px);
}

/* --- Section Nosotros --- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.card-info {
    text-align: center;
    padding: 40px 30px;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 51, 204, 0.05);
    transition: transform 0.3s;
    border-bottom: 4px solid transparent;
}
.card-info:hover { 
    transform: translateY(-10px); 
    border-bottom: 4px solid var(--secondary-color);
}
.card-info h3 { font-family: var(--font-heading); margin-bottom: 15px; color: var(--primary-color); }
.icon-large { font-size: 3.5rem; color: var(--secondary-color); margin-bottom: 25px; }

/* --- Servicios --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: 0.3s;
}
.service-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 15px 30px rgba(0, 51, 204, 0.15); 
}

.service-img {
    height: 220px;
    background-color: #ddd;
    position: relative;
    overflow: hidden;
}
.service-img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s;
}
.service-card:hover .service-img img { transform: scale(1.1); }

.service-text { padding: 30px; }
.service-text h3 { color: var(--primary-color); margin-bottom: 15px; font-family: var(--font-heading); font-size: 1.3rem;}
.service-text p { color: #666; font-size: 0.95rem; }

/* --- EMERGENCIAS (FONDO BLANCO / CLARO) --- */
.section-emergency {
    background-color: #ffffff; /* Fondo blanco */
    color: var(--text-color);
}
/* El título hereda el color pero aseguramos que sea azul */
.section-emergency .section-header h2 { 
    color: var(--primary-color); 
}

.emergency-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px; 
    margin-bottom: 70px;
    align-items: stretch;
    margin-top: 40px; 
}

.ef-col {
    flex: 1 1 240px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform 0.3s;
    margin-bottom: 20px;
}
.ef-col:hover { transform: translateY(-10px); }

.ef-img-header {
    height: 160px;
    width: 90%;
    margin: 0 auto -30px;
    z-index: 2;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15); /* Sombra ajustada */
    background-color: #fff;
}

.ef-img-header img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s;
}
.ef-col:hover .ef-img-header img { transform: scale(1.1); }

.ef-item {
    flex-grow: 1;
    padding: 50px 25px 30px;
    
    /* Diseño tarjeta sobre fondo blanco */
    background: #ffffff;
    border: 1px solid #f0f0f0;
    box-shadow: 0 5px 25px rgba(0,0,0,0.06); /* Sombra suave para dar profundidad */
    
    border-radius: 15px;
    position: relative;
    z-index: 1;
}

.ef-item h4 { 
    font-family: var(--font-heading); 
    margin: 15px 0; 
    font-size: 1.3rem; 
    color: var(--primary-color); /* Título azul */
    font-weight: 700;
}
.ef-item p { 
    font-size: 1rem; 
    line-height: 1.5; 
    color: #555; /* Texto gris */
}

.cta-emergency { text-align: center; }
.btn-warning {
    background: var(--accent-color);
    color: var(--white);
    font-size: 1.3rem;
    padding: 18px 50px;
    box-shadow: 0 0 20px rgba(217, 32, 39, 0.6);
    border-radius: 50px;
    font-weight: 700;
}
.btn-warning:hover { background-color: #b9151b; }

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(217, 32, 39, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(217, 32, 39, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(217, 32, 39, 0); }
}
.pulse-anim { animation: pulse 2s infinite; }

/* --- CAPACITACIÓN EMPRESARIAL --- */
.training-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

/* Fuerza 4 columnas en PC */
@media (min-width: 1024px) {
    .training-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.training-card {
    background: var(--white);
    padding: 35px 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border-bottom: 4px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.training-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 51, 204, 0.15);
    border-bottom-color: var(--secondary-color);
}

.training-card .icon-box {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--light-bg) 0%, #eef2f5 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    color: var(--primary-color);
    font-size: 2rem;
    transition: all 0.4s ease;
}

.training-card:hover .icon-box {
    background: var(--primary-color);
    color: var(--white);
    transform: rotateY(180deg);
}
.training-card:hover .icon-box i { transform: rotateY(-180deg); }

.training-card h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--text-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.training-card p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
}

/* --- Galería --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 250px);
    gap: 15px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.gallery-item img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease;
}

.gallery-item.item-1 { grid-column: span 2; grid-row: span 2; }

.gallery-item .overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0, 51, 204, 0.9), transparent);
    width: 100%; height: 0;
    transition: .5s ease;
    display: flex; align-items: flex-end;
    padding-bottom: 20px; padding-left: 20px;
}

.gallery-item:hover .overlay { height: 100%; }
.gallery-item:hover img { transform: scale(1.1); }

.gallery-item .text { color: white; font-size: 1.2rem; font-family: var(--font-heading); font-weight: 700; }

/* --- Testimonios --- */
.carousel-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    padding: 60px 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    border-top: 5px solid var(--secondary-color);
}
.carousel-slide { display: none; }
.carousel-slide.active { display: block; animation: fadeEffect 0.8s; }
.testimonial-content i { font-size: 3rem; color: #ddd; margin-bottom: 25px; }
.testimonial-content p { font-style: italic; font-size: 1.3rem; margin-bottom: 25px; color: #444; }
.testimonial-content h4 { color: var(--primary-color); font-weight: 700; }

.carousel-btn {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: var(--light-bg); 
    border: none; 
    font-size: 1.5rem; 
    cursor: pointer; 
    color: var(--primary-color);
    width: 45px; height: 45px;
    border-radius: 50%;
    transition: 0.3s;
}
.carousel-btn:hover { background: var(--primary-color); color: var(--white); }
.prev { left: -20px; } .next { right: -20px; }
@keyframes fadeEffect { from {opacity: 0;} to {opacity: 1;} }

/* --- FAQ --- */
.faq-wrapper { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 15px; }
.faq-item {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow: hidden;
    border-left: 5px solid transparent;
    transition: 0.3s;
}
.faq-item:hover { border-left-color: var(--secondary-color); }

.faq-question {
    width: 100%; background: none; border: none; padding: 20px;
    text-align: left; font-size: 1.1rem; font-weight: 600;
    color: var(--primary-color); display: flex;
    justify-content: space-between; align-items: center;
    cursor: pointer; font-family: var(--font-heading);
}
.faq-question:hover { background: #f9f9f9; }
.faq-question i { transition: 0.3s; color: var(--secondary-color); }
.faq-question.active i { transform: rotate(180deg); }

.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; background-color: var(--white); }
.faq-answer p { padding: 0 20px 25px; color: #555; border-top: 1px solid #eee; }

/* --- Footer --- */
footer {
    background: #0d1b2a; 
    color: #ccc;
    padding: 80px 0 20px;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
}
.footer-col h3 { color: var(--white); margin-bottom: 25px; font-family: var(--font-heading); }
.footer-col p { margin-bottom: 12px; }
.footer-col i { color: var(--secondary-color); margin-right: 10px; width: 20px; text-align: center; }
.footer-col a:hover { color: var(--warning-color); text-decoration: underline; }
.footer-bottom { text-align: center; border-top: 1px solid #333; padding-top: 30px; margin-top: 50px; font-size: 0.9rem; }

/* --- WhatsApp Float --- */
.whatsapp-float {
    position: fixed;
    width: 65px; height: 65px;
    bottom: 30px; right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 35px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
}
.whatsapp-float:hover { background-color: #128C7E; transform: scale(1.1); }

/* --- Media Queries (Móvil) --- */
@media (max-width: 768px) {
    .header-content { justify-content: space-between; padding: 0 20px; }
    .header-logo-img { height: 50px; }
    
    .hamburger { display: block; }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .nav-links {
        position: fixed;
        left: -100%; top: 90px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
        padding: 20px 0;
        align-items: center;
    }
    .nav-links.active { left: 0; }
    .nav-links li { margin: 15px 0; }
    .nav-links .highlight { margin-top: 10px; }
    
    .hero-content h1 { font-size: 2.2rem; }
    .hero-btns { flex-direction: column; }
    .grid-3, .services-grid, .footer-content, .emergency-features { grid-template-columns: 1fr; }
    .carousel-btn { width: 35px; height: 35px; font-size: 1.2rem; }
    .prev { left: -10px; } .next { right: -10px; }

    /* Ajuste Galería Móvil */
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .gallery-item.item-1 { grid-column: span 1; grid-row: span 1; }
    .gallery-item { height: 250px; }

    /* Ajuste Emergencias Móvil */
    .ef-col {
        margin-bottom: 30px; 
        max-width: 100%;
    }
    
    /* Ajuste Capacitación Móvil */
    .training-grid {
        grid-template-columns: 1fr;
    }
}