:root {
    --primary: #1e3a8a;
    --secondary: #475569;
    --accent: #d97706;
    --bg-color: #f8fafc;
    --white: #ffffff;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    color: #0f172a;
    line-height: 1.7;
    margin: 0;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
}

/* CABECERA UNIFICADA FIJA */
header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    font-family: 'Playfair Display', serif;
}

.logo-subtitle {
    font-size: 0.70rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.5px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ESTILOS BOTÓN HAMBURGUESA (Por defecto oculto en pantallas grandes) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    padding: 0;
    z-index: 1200;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

nav ul {
    display: flex;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
}

nav ul li {
    position: relative;
    margin-left: 15px;
}

nav ul li a {
    text-decoration: none;
    color: var(--secondary);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 10px;
    display: block;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--primary);
}

/* Mega Desplegable para las 15 Áreas de Ayuda */
nav ul li .dropdown-mega {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-radius: 12px;
    min-width: 500px;
    display: none;
    grid-template-columns: 1fr 1fr;
    padding: 15px;
    gap: 8px;
    z-index: 1100;
    border: 1px solid #e2e8f0;
    list-style: none;
}

nav ul li:hover .dropdown-mega {
    display: grid;
}

nav ul li .dropdown-mega li {
    margin: 0;
    width: 100%;
    list-style: none;
}

nav ul li .dropdown-mega li a {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--secondary);
    transition: all 0.2s;
    border-radius: 6px;
}

nav ul li .dropdown-mega li a:hover {
    background: var(--bg-color);
    color: var(--primary);
    padding-left: 16px;
}

/* SECCIONES Y BOTONES */
main section {
    padding: 70px 8%;
    max-width: 1100px;
    margin: 0 auto;
}

.hero-acogida {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 58, 138, 0.95)), url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1600&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 100px 8%;
    text-align: center;
    max-width: 100% !important;
}

.tarjeta-eleccion {
    background: white;
    border-radius: 16px;
    padding: 35px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: transform 0.3s;
    text-align: left;
}

.tarjeta-eleccion:hover {
    transform: translateY(-4px);
}

.btn-principal {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 14px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    border: none;
    cursor: pointer;
}

.btn-principal:hover {
    background: #b45309;
}

.btn-secundario {
    display: inline-block;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 12px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

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

.grid-15-areas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.area-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.area-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transform: translateY(-3px);
}

.area-card h4 {
    color: var(--primary);
    margin: 0 0 8px 0;
    font-size: 1.1rem;
}

.area-card p {
    font-size: 0.85rem;
    color: var(--secondary);
    margin: 0;
    line-height: 1.5;
}

footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 35px 20px;
    font-size: 0.9rem;
    margin-top: 60px;
}

.opcion-btn {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 14px 20px;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--secondary);
    transition: all 0.2s;
}

.opcion-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    padding-left: 25px;
}

/* RESPONSIVE / MÓVIL (Pantallas menores o iguales a 992px) */
@media screen and (max-width: 992px) {
    .menu-toggle {
        display: flex; /* Muestra el botón de hamburguesa a la derecha del logo */
    }

    header nav {
        position: fixed;
        top: 0;
        right: -100%; /* Oculto fuera de la pantalla a la derecha */
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: var(--white);
        box-shadow: -5px 0 25px rgba(0,0,0,0.1);
        transition: right 0.3s ease-in-out;
        padding-top: 80px;
        z-index: 1100;
        overflow-y: auto;
    }

    header nav.active {
        right: 0; /* Desliza el menú hacia adentro */
    }

    nav ul {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        padding: 0 20px;
    }

    nav ul li {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid #f1f5f9;
    }

    nav ul li a {
        padding: 15px 10px;
        font-size: 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* Ajuste para el mega desplegable en móvil */
    nav ul li .dropdown-mega {
        position: static;
        box-shadow: none;
        border: none;
        min-width: 100%;
        display: none; /* Se despliega mediante JS o interacción táctil */
        grid-template-columns: 1fr;
        padding: 0 0 10px 15px;
        background: #f8fafc;
        border-radius: 0;
    }

    /* Clase condicional para desplegar el submenú en móvil si se desea o dejarlo accesible */
    nav ul li.open-dropdown .dropdown-mega {
        display: grid;
    }
}

/* Animación de transformación del botón hamburguesa a "X" cuando esté activo */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
}