/* CASA ABU - Portal Institucional por la Igualdad */
/* Subvencionado por la Diputación Provincial de Málaga */
/* Estilo institucional profesional y accesible */

:root {
    /* COLORES INSTITUCIONALES - IGUALDAD */
    --color-bg: #FDFBFF;
    --color-bg-light: #F8F4FF;
    --color-primary: #9B59B6;
    --color-secondary: #E8A2D7;
    --color-accent: #DDA0DD;
    --color-tertiary: #C39BD3;
    --color-quaternary: #8E44AD;

    /* COLORES ADICIONALES PARA MOBILE */
    --color-primary-light: rgba(155, 89, 182, 0.1);
    --color-secondary-light: rgba(232, 162, 215, 0.08);

    /* GRADIENTES INSTITUCIONALES */
    --gradient-primary: linear-gradient(135deg, #9B59B6 0%, #C39BD3 50%, #E8A2D7 100%);
    --gradient-hero: linear-gradient(135deg, #9B59B6 0%, #C39BD3 25%, #E8A2D7 50%, #DDA0DD 75%, #F8F4FF 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(155, 89, 182, 0.1) 0%, rgba(232, 162, 215, 0.05) 100%);
    --gradient-card: linear-gradient(145deg, rgba(155, 89, 182, 0.03) 0%, rgba(232, 162, 215, 0.02) 100%);

    /* SUPERFICIES INSTITUCIONALES */
    --color-surface: #FFFFFF;
    --color-surface-light: #FAF7FC;
    --color-surface-elevated: #F8F4FF;
    --color-overlay: rgba(155, 89, 182, 0.08);

    /* TEXTO INSTITUCIONAL */
    --color-text: #2C2C3E;
    --color-text-primary: #2C2C3E;
    --color-text-secondary: #6B697A;
    --color-text-muted: #8E8C9D;
    --color-text-white: #FFFFFF;

    /* ESTADOS Y VALIDACIÓN */
    --color-success: #27AE60;
    --color-warning: #F39C12;
    --color-error: #E74C3C;
    --color-info: #3498DB;

    /* SOMBRAS INSTITUCIONALES */
    --shadow-sm: 0 1px 3px rgba(155, 89, 182, 0.08);
    --shadow-md: 0 4px 12px rgba(155, 89, 182, 0.12);
    --shadow-lg: 0 8px 24px rgba(155, 89, 182, 0.15);
    --shadow-xl: 0 16px 48px rgba(155, 89, 182, 0.18);

    /* BORDES INSTITUCIONALES */
    --border-radius: 8px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-color: rgba(155, 89, 182, 0.15);
    --border-light: 1px solid var(--border-color);

    /* ESPACIADOS */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 5rem;
    --spacing-xxxl: 7rem;

    /* TRANSICIONES */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    padding-top: 80px; /* Compensar header fijo */
}

/* CONTENEDOR RESPONSIVO */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }
}

/* FONDO SUTIL INSTITUCIONAL */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 20%, rgba(155, 89, 182, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(232, 162, 215, 0.02) 0%, transparent 50%);
    z-index: -1;
}

/* CONTENEDOR MODERNO */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    position: relative;
}

/* TIPOGRAFÍA INSTITUCIONAL */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--color-primary);
    margin-bottom: var(--spacing-lg);
}

h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--color-primary);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--color-text-primary);
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-secondary);
    font-weight: 400;
    line-height: 1.7;
}

a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    color: var(--color-accent);
    transform: translateY(-2px);
}

/* HEADER INSTITUCIONAL */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: var(--border-light);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.header:hover {
    box-shadow: var(--shadow-md);
}

/* Header oculto al hacer scroll down */
.header.header-hidden {
    box-shadow: none;
}

/* Header con scroll */
.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    min-height: 80px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
    transition: var(--transition-normal);
}

.logo-img:hover {
    transform: scale(1.02);
}

/* NAVEGACIÓN INSTITUCIONAL */
.nav-desktop {
    display: flex;
    align-items: center;
}

.nav-desktop ul {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
}

.nav-link {
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--border-radius);
    position: relative;
    transition: var(--transition-normal);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
    background-color: var(--color-overlay);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* MENÚ MÓVIL */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    margin: 3px 0;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* NAVEGACIÓN MÓVIL - SIMPLE COMO DEBUG */
.nav-mobile {
    display: none;
}

/* Nav mobile default content styles */
.nav-mobile ul {
    list-style: none;
    padding: var(--spacing-md) 0;
    margin: 0;
}

.nav-mobile li {
    border-bottom: 1px solid var(--border-color);
}

.nav-mobile .nav-link {
    display: block;
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-mobile .nav-link:hover,
.nav-mobile .nav-link.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.nav-mobile ul {
    list-style: none;
    padding: var(--spacing-md) 0;
}

.mobile-nav-container {
    position: relative;
    display: inline-block;
}

/* POSICIONAMIENTO DESKTOP PARA MÓVIL - NO INTERFIERE */
@media (min-width: 769px) {
    .mobile-nav-container .nav-mobile {
        position: absolute;
        top: 100%;
        right: 0;
        left: auto;
        width: 250px;
        min-width: 200px;
        z-index: 1000;
    }
}

.nav-mobile .nav-link {
    display: block;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
}

.hero {
    margin-top: 80px;
    padding: var(--spacing-xxl) 0;
    position: relative;
    overflow: hidden;
    min-height: 600px;
    display: flex;
    align-items: center;
}

/* FONDO DE IMAGEN HERO */
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(1.1) saturate(1.2);
}

/* OVERLAY SUTIL PARA LEGIBILIDAD */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    z-index: 2;
}

/* CONTENIDO DEL HERO */
.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.9);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-xl);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-xl);
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 700;
}

.hero p {
    font-size: 1.3rem;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
    line-height: 1.4;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.6;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* BOTONES INSTITUCIONALES */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: 2px solid transparent;
    min-height: 48px;
    font-family: inherit;
    transition: var(--transition-normal);
}

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

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: #FF1493 !important; /* Rosa fuerte para máxima visibilidad */
    color: white !important;
    border: 2px solid #FF1493 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

.btn-secondary:hover {
    background-color: #FF69B4 !important; /* Rosa más claro al hover */
    border-color: #FF69B4 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(255, 20, 147, 0.3) !important;
}

/* SECCIONES INSTITUCIONALES */
.mission {
    padding: var(--spacing-xxl) 0;
    background-color: var(--color-surface);
}

.section-title {
    text-align: center;
    color: var(--color-primary);
    margin-bottom: var(--spacing-xl);
    position: relative;
    padding-bottom: var(--spacing-md);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.mission-card {
    background-color: var(--color-surface);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.mission-card:hover {
    box-shadow: var(--shadow-xl);
    border-color: var(--color-primary);
    transform: translateY(-8px) scale(1.02);
}

/* CONTENEDOR DE IMAGEN */
.mission-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--gradient-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mission-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: var(--transition-slow);
    filter: brightness(1.1) contrast(1.05);
}

.mission-card:hover .mission-card-image img {
    transform: scale(1.08);
    filter: brightness(1.2) contrast(1.1);
}

/* OVERLAY ELEGANTE */
.mission-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(155, 89, 182, 0.3) 0%,
        rgba(232, 162, 215, 0.2) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: var(--transition-normal);
    display: flex;
    align-items: flex-end;
    padding: var(--spacing-md);
}

.mission-card:hover .mission-card-overlay {
    opacity: 1;
}

/* CATEGORÍA EN EL OVERLAY */
.mission-card-category {
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-primary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: var(--transition-normal);
}

.mission-card:hover .mission-card-category {
    transform: translateY(0);
}

/* CONTENIDO DE LA TARJETA */
.mission-card h3 {
    color: var(--color-primary);
    font-size: 1.3rem;
    margin-bottom: var(--spacing-sm);
    padding: 0 var(--spacing-lg);
    margin-top: var(--spacing-lg);
    text-align: center;
    line-height: 1.3;
}

.mission-card p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 0 var(--spacing-lg) var(--spacing-lg);
    text-align: center;
    margin-bottom: 0;
}

/* ESTADO SIN IMAGEN (PLACEHOLDER) */
.mission-card-image:not(:has(img)),
.mission-card-image img[src*="placeholder"] {
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-white);
    font-size: 3rem;
}

.mission-card-image:not(:has(img))::before {
    content: "📸";
    font-size: 3rem;
    opacity: 0.7;
}

.mission-card {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
    transform: translateY(40px);
}

.mission-card:nth-child(1) { animation-delay: 0.2s; }
.mission-card:nth-child(2) { animation-delay: 0.4s; }
.mission-card:nth-child(3) { animation-delay: 0.6s; }
.mission-card:nth-child(4) { animation-delay: 0.8s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* HERO BACKGROUND ANIMATION */
.hero-bg-image {
    animation: heroImageLoad 1.2s ease-out forwards;
    opacity: 0;
}

@keyframes heroImageLoad {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* HERO CONTENT ANIMATION */
.hero-content {
    animation: heroContentSlide 1s ease-out 0.3s forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes heroContentSlide {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CTA HIGHLIGHTS ANIMATION */
.cta-highlight:nth-child(1) { animation: fadeInUp 0.6s ease 0.2s forwards; opacity: 0; }
.cta-highlight:nth-child(2) { animation: fadeInUp 0.6s ease 0.4s forwards; opacity: 0; }
.cta-highlight:nth-child(3) { animation: fadeInUp 0.6s ease 0.6s forwards; opacity: 0; }

/* SECCIÓN DE NOTICIAS */
.news {
    padding: var(--spacing-xxl) 0;
    background-color: var(--color-bg-light);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

/* NEWS CARDS INSTITUCIONALES */
.news-card {
    background-color: var(--color-surface);
    padding: 0;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition-normal);
    overflow: hidden;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-secondary);
}

/* CONTENIDO DE NEWS CARDS */
.news-card > div:first-child {
    position: relative;
    margin-bottom: var(--spacing-md);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    overflow: hidden;
}

.news-card-content {
    padding: var(--spacing-lg);
}

.news-date {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--color-surface-light);
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-sm);
}

.news-card h3 {
    color: var(--color-text);
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.news-card p {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.link-arrow {
    color: var(--color-primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: var(--transition-normal);
}

.link-arrow:hover {
    color: var(--color-tertiary);
}

/* SECCIÓN CTA */
.cta {
    padding: var(--spacing-xxl) 0;
    background: var(--gradient-primary);
    color: var(--color-text-white);
    text-align: center;
}

.cta-content h2 {
    color: var(--color-text-white);
    margin-bottom: var(--spacing-md);
}

.cta-content p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-xl);
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.cta-highlight {
    background: rgba(255, 255, 255, 0.1);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-normal);
}

.cta-highlight:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

.cta-icon {
    display: block;
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.cta-highlight p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    margin-bottom: 0;
    font-weight: 500;
    line-height: 1.5;
}

.cta-footer {
    margin-top: var(--spacing-md);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    margin-bottom: 0 !important;
}

/* FORMULARIO DE SUSCRIPCIÓN MEJORADO */
.newsletter-form {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: var(--spacing-sm);
    max-width: 500px;
    margin: 0 auto;
    padding: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.newsletter-form input[type="email"] {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-text);
    outline: none;
    transition: all 0.3s ease;
}

.newsletter-form input[type="email"]::placeholder {
    color: var(--color-text-muted);
}

.newsletter-form input[type="email"]:focus {
    border-color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.2);
}

.newsletter-form .btn {
    background: var(--color-primary);
    color: var(--color-text-white);
    border: 2px solid var(--color-primary);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-weight: 600;
    white-space: nowrap;
}

.newsletter-form .btn:hover {
    background: var(--color-tertiary);
    border-color: var(--color-tertiary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

/* FOOTER INSTITUCIONAL CLARO */
.footer {
    background-color: var(--color-surface-light);
    color: var(--color-text-primary);
    padding: 2rem 0 1.5rem;  /* Reducido padding vertical */
    border-top: 2px solid var(--color-primary);
    width: 100%;
}

.footer .container {
    max-width: 90% !important;  /* Usar 90% del ancho de la pantalla */
    margin: 0 auto !important;
    padding: 0 2rem !important;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr;  /* Primera columna más ancha */
    gap: 3rem;  /* Gap horizontal más grande */
    margin-bottom: 2rem;  /* Menos margen inferior */
    width: 100%;
    max-width: none;  /* Sin límite de ancho máximo */
    margin-left: auto;
    margin-right: auto;
}

.footer-section h3,
.footer-section h4 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;  /* Reducido espacio */
    font-size: 1.1rem;
    line-height: 1.3;
}

.footer-section p {
    color: var(--color-text-secondary);
    margin-bottom: 0.4rem;  /* Menos espacio entre párrafos */
    font-size: 0.95rem;
    line-height: 1.4;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.3rem;  /* Menos espacio entre elementos de lista */
    font-size: 0.95rem;
}

.footer-section ul li a {
    color: var(--color-text-secondary);
    transition: color 0.2s ease;
}

.footer-section ul li a:hover {
    color: var(--color-primary);
}

/* LOGOS INSTITUCIONALES */
.footer-logos {
    display: flex;
    align-items: center;
    gap: 4rem;  /* Más separación horizontal */
    padding: 1rem 0;  /* Mucho menos padding vertical */
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 1rem 0;  /* Menos margen */
    flex-wrap: wrap;
    justify-content: center;
}

.footer-logo {
    height: 45px;  /* Logos más pequeños */
    width: auto;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.footer-logo:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 0.8rem;  /* Menos padding */
    color: var(--color-text-muted);
    font-size: 0.85rem;  /* Texto más pequeño */
    line-height: 1.3;
}

/* ELEMENTOS INSTITUCIONALES DEL FOOTER */
.footer-section address {
    font-style: normal;
    line-height: 1.6;
}

.footer-section address p {
    margin-bottom: var(--spacing-xs);
}

.footer-section address a {
    color: var(--color-primary);
    text-decoration: underline;
}

.footer-section address a:hover {
    color: var(--color-tertiary);
}

.footer-suggestions {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.btn-suggestion {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--color-primary);
    color: var(--color-text-white);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: var(--transition-normal);
    border: 1px solid var(--color-primary);
}

.btn-suggestion:hover {
    background-color: var(--color-tertiary);
    border-color: var(--color-tertiary);
    transform: translateY(-1px);
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-primary);
    color: var(--color-text-white);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: var(--spacing-md);
    transition: var(--transition-normal);
}

.footer-social a:hover {
    background: var(--color-tertiary);
    transform: translateY(-2px);
}

.footer-section ul li {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
}

.footer-project-info {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.footer-project-info small {
    color: var(--color-text-muted);
    line-height: 1.4;
}

.footer-mission {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(155, 89, 182, 0.1);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--color-primary);
}

.footer-mission em {
    color: var(--color-primary);
    font-style: italic;
    line-height: 1.5;
    font-size: 0.95rem;
}

.footer-bottom p:last-child {
    margin-top: var(--spacing-xs);
    opacity: 0.8;
}

/* MEJORAS DE GRID DEL FOOTER */
@media (min-width: 769px) {
    .footer-content {
        grid-template-columns: 2.5fr 1.5fr 1.5fr;  /* Primera columna más ancha */
        gap: 4rem;  /* Más separación horizontal */
    }

    .footer .container {
        max-width: 95% !important;  /* Usar casi todo el ancho en desktop */
    }
}

/* PÁGINAS SECUNDARIAS */
.page-hero {
    margin-top: 80px;
    padding: var(--spacing-xxl) 0 var(--spacing-xl);
    text-align: center;
    position: relative;
}

/* RESPONSIVE INSTITUCIONAL */

/* TABLET GRANDE */
@media (max-width: 1200px) {
    .container {
        max-width: 1000px;
        padding: 0 var(--spacing-lg);
    }

    .hero-content h1 {
        font-size: clamp(2rem, 5vw, 3rem);
    }

    .mission-grid,
    .news-grid {
        gap: var(--spacing-md);
    }
}

/* TABLET */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .mission-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .news-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: var(--spacing-lg);
    }

    .header-content {
        padding: var(--spacing-sm) 0;
    }

    .hero {
        padding: var(--spacing-xl) 0;
    }
}

@media (max-width: 768px) {
    /* STICKY HEADER MÓVIL */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 9999;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
        transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Ensure smooth scrolling with fixed header */
    body {
        padding-top: 70px;
    }

    /* FIX HERO MOBILE - Ensure content visibility */
    .hero::before {
        background: rgba(255, 255, 255, 0.05) !important;
        z-index: 2 !important;
    }

    .hero-background {
        position: absolute !important;
        z-index: 1 !important;
        opacity: 0.9 !important;
    }

    .hero .container {
        position: relative !important;
        z-index: 5 !important;
    }

    /* NAVEGACIÓN MÓVIL SIMPLIFICADA */
    .nav-desktop {
        display: none !important;
    }

    .nav-toggle {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 50px !important;
        height: 50px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border: 2px solid #9B59B6 !important;
        border-radius: 10px !important;
        cursor: pointer !important;
        z-index: 1001 !important;
        position: relative !important;
        padding: 12px 8px !important;
        box-shadow: 0 4px 15px rgba(155, 89, 182, 0.25) !important;
        -webkit-tap-highlight-color: rgba(155, 89, 182, 0.3) !important;
        touch-action: manipulation !important;
        -webkit-user-select: none !important;
        user-select: none !important;
        transition: all 0.2s ease !important;
    }

    .nav-toggle:hover {
        background: rgba(255, 255, 255, 1) !important;
        box-shadow: 0 6px 20px rgba(155, 89, 182, 0.35) !important;
        transform: translateY(-1px) !important;
    }

    .nav-toggle span {
        display: block !important;
        width: 26px !important;
        height: 3px !important;
        background: #9B59B6 !important;
        margin: 0 !important;
        transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
        border-radius: 3px !important;
        transform-origin: center !important;
    }

    .nav-toggle.active {
        background: rgba(155, 89, 182, 0.1) !important;
        border-color: #8B4A9C !important;
        transform: rotate(0deg) !important;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px) !important;
        background: #8B4A9C !important;
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0 !important;
        transform: scale(0) !important;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px) !important;
        background: #8B4A9C !important;
    }

    /* HEADER MÓVIL STICKY MEJORADO */
    .header {
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
        background: rgba(255, 255, 255, 0.95) !important;
        z-index: 1000 !important;
        position: fixed !important;
        width: 100% !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        border-bottom: 1px solid rgba(155, 89, 182, 0.1);
        /* Force visibility after auth */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .header-content {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: var(--spacing-sm) 0;
        min-height: 70px !important;
        width: 100% !important;
    }

    .logo {
        display: flex !important;
        align-items: center !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1001 !important;
    }

    .logo img,
    .logo-img {
        max-height: 50px !important;
        height: 50px !important;
        width: auto !important;
        z-index: 1001 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .mobile-nav-container {
        position: relative !important;
        display: inline-block !important;
    }

    .nav-mobile {
        display: none !important;
        position: fixed !important;
        top: 70px !important;
        right: 15px !important;
        width: 200px !important;
        background: white !important;
        border: 2px solid #9B59B6 !important;
        border-radius: 8px !important;
        z-index: 1000 !important;
        opacity: 0 !important;
    }

    .nav-mobile.active {
        display: block !important;
        opacity: 1 !important;
    }

    .nav-mobile ul {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .nav-mobile li {
        border-bottom: 1px solid #eee !important;
    }

    .nav-mobile li:last-child {
        border-bottom: none !important;
    }

    /* ELIMINAR ESTA REGLA - YA NO ES NECESARIA */

    .nav-mobile a,
    .nav-mobile .nav-link {
        display: block !important;
        padding: 15px 20px !important;
        color: #333 !important;
        text-decoration: none !important;
        font-weight: 600 !important;
        font-size: 16px !important;
        text-align: center !important;
        background: white !important;
    }

    .nav-mobile a:hover,
    .nav-mobile .nav-link:hover {
        background: #f0f0f0 !important;
        color: #9B59B6 !important;
    }

    /* LOGO RESPONSIVE MEJORADO */
    .logo-img {
        height: 50px;
        transition: height var(--transition-normal);
    }

    .header.scrolled .logo-img {
        height: 40px;
    }

    /* TIPOGRAFÍA MÓVIL */
    h1 {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
    }
    h2 {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
    h3 {
        font-size: clamp(1.125rem, 4vw, 1.5rem);
    }

    .hero {
        padding: var(--spacing-xl) 0;
        min-height: 70vh;
        /* Improved mobile background handling */
        background-attachment: scroll;
        /* Adjust for fixed header */
        margin-top: 0 !important;
    }

    .hero-bg-image {
        /* Better mobile image optimization */
        object-position: center center;
        transform: scale(1.1);
        /* Ensure image doesn't cover content on mobile */
        z-index: 1 !important;
    }

    .hero-content {
        padding: var(--spacing-lg);
        margin: 0 var(--spacing-md);
        /* Ensure content is always visible on mobile */
        position: relative !important;
        z-index: 10 !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
        animation: none !important;
        background: rgba(255, 255, 255, 0.95) !important;
    }

    .hero h1 {
        font-size: clamp(2rem, 8vw, 2.8rem);
    }

    .hero p {
        font-size: 1.1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    /* CTA MÓVIL */
    .cta-highlights {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .cta-highlight {
        padding: var(--spacing-md);
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-md);
        width: 100%;
    }
    .hero-buttons .btn {
        width: 100%;
        max-width: 320px;
        min-height: 54px; /* Improved touch target */
        font-size: 1.1rem;
        /* Enhanced touch feedback */
        transform: scale(1);
        transition: all 0.2s ease;
    }
    .hero-buttons .btn:active {
        transform: scale(0.98);
    }

    /* SECCIONES MÓVIL */
    .mission,
    .news,
    .cta {
        padding: var(--spacing-xl) 0;
    }

    /* GRIDS MÓVIL */
    .mission-grid,
    .news-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .news-card {
        padding: var(--spacing-lg);
    }

    .news-card:hover {
        transform: translateY(-4px);
    }

    .mission-card {
        /* Better mobile touch handling */
        transition: all 0.3s ease;
    }
    .mission-card:hover,
    .mission-card:focus {
        transform: translateY(-4px) scale(1.01);
        box-shadow: var(--shadow-xl);
    }
    .mission-card:active {
        transform: translateY(-2px) scale(1.005);
    }

    .mission-card-image {
        height: 180px;
    }

    .mission-card h3 {
        font-size: 1.2rem;
        padding: 0 var(--spacing-md);
        margin-top: var(--spacing-md);
    }

    .mission-card p {
        padding: 0 var(--spacing-md) var(--spacing-md);
        font-size: 0.9rem;
    }

    .newsletter-form {
        flex-direction: column;
        padding: var(--spacing-md);
        gap: var(--spacing-md);
        max-width: 100%;
    }

    .newsletter-form input[type="email"] {
        width: 100%;
        font-size: 1.1rem;
        padding: var(--spacing-md);
        min-height: 54px; /* Better touch target */
        /* iOS zoom prevention */
        font-size: 16px;
    }

    .newsletter-form .btn {
        width: 100%;
        min-height: 54px; /* Better touch target */
        font-size: 1.1rem;
        /* Enhanced mobile button styling */
        border-radius: var(--border-radius-lg);
    }

    /* NAVEGACIÓN MÓVIL MEJORADA */
    .nav-mobile {
        /* Better mobile navigation */
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-mobile .nav-link {
        /* Touch-friendly navigation */
        min-height: 54px;
        display: flex;
        align-items: center;
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: 1.1rem;
        transition: all 0.2s ease;
    }

    .nav-mobile .nav-link:active {
        background: rgba(155, 89, 182, 0.1);
        transform: scale(0.98);
    }

    /* PAGINACIÓN MÓVIL */
    .pagination {
        gap: var(--spacing-xs);
        flex-wrap: wrap;
    }

    .pagination-item {
        min-width: 36px;
        padding: var(--spacing-xs);
    }

    /* BREADCRUMBS MÓVIL */
    .breadcrumb {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }

    /* FOOTER MÓVIL */
    .footer-content {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: var(--spacing-lg);
        padding: 0 var(--spacing-sm);
    }

    .footer .container {
        padding: 0 var(--spacing-md) !important;
    }

    .footer-logos {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .footer-logo {
        height: 50px;
    }
}

/* MÓVIL PEQUEÑO INSTITUCIONAL */
@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    /* HEADER MÓVIL PEQUEÑO */
    .header-content {
        min-height: 70px;
    }

    .logo-img {
        height: 50px !important;
        max-height: 50px !important;
        width: auto !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* HERO MÓVIL PEQUEÑO */
    .hero {
        min-height: 60vh;
        padding: var(--spacing-lg) 0;
        margin-top: 70px;
    }

    .hero-content {
        padding: var(--spacing-md);
        margin: 0 var(--spacing-sm);
    }

    .hero h1 {
        font-size: 1.75rem;
        margin-bottom: var(--spacing-sm);
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: var(--spacing-lg);
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: var(--spacing-lg);
    }

    /* CTA MÓVIL PEQUEÑO */
    .cta-highlights {
        margin: var(--spacing-lg) 0;
    }

    .cta-highlight {
        padding: var(--spacing-sm);
    }

    .cta-icon {
        font-size: 2rem;
    }

    /* CONTENIDO MÓVIL PEQUEÑO */
    .mission,
    .news,
    .cta {
        padding: var(--spacing-lg) 0;
    }

    .section-title {
        margin-bottom: var(--spacing-lg);
    }

    .mission-grid,
    .news-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .news-card {
        padding: var(--spacing-md);
    }

    /* TARJETAS DE TALLERES MÓVIL PEQUEÑO */
    .mission-card-image {
        height: 160px;
    }

    .mission-card h3 {
        font-size: 1.1rem;
        padding: 0 var(--spacing-sm);
        margin-top: var(--spacing-sm);
    }

    .mission-card p {
        padding: 0 var(--spacing-sm) var(--spacing-sm);
        font-size: 0.85rem;
    }

    .mission-card-category {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    /* BOTONES MÓVIL PEQUEÑO */
    .btn {
        width: 100%;
        min-height: 48px;
        font-size: 0.95rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .hero-buttons .btn {
        max-width: 280px;
    }

    /* FORMULARIOS MÓVIL PEQUEÑO */
    .newsletter-form {
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }

    .newsletter-form input[type="email"],
    .newsletter-form .btn {
        font-size: 1rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    /* FOOTER MÓVIL PEQUEÑO */
    .footer {
        padding: var(--spacing-lg) 0 var(--spacing-md);
    }

    .footer-content {
        gap: var(--spacing-md);
    }

    .footer-logo {
        height: 40px;
    }

    /* NAVEGACIÓN MÓVIL PEQUEÑA - SIMPLIFICADA */
    .nav-mobile a,
    .nav-mobile .nav-link {
        font-size: 15px !important;
        padding: 12px 16px !important;
    }
}

/* MÓVIL EXTRA PEQUEÑO - NAVEGACIÓN ULTRA GRANDE */
@media (max-width: 360px) {
    /* NAVEGACIÓN MÓVIL SÚPER GRANDE PARA PANTALLAS PEQUEÑAS */
    .nav-mobile {
        top: 80px !important;
        left: 5px !important;
        right: 5px !important;
    }

    .nav-mobile {
        left: 10px !important;
        right: 10px !important;
        top: 80px !important;
    }

    .nav-mobile a,
    .nav-mobile .nav-link {
        font-size: 14px !important;
        padding: 10px 12px !important;
    }


    .container {
        padding: 0 var(--spacing-xs);
    }

    .hero {
        min-height: 50vh;
        padding: var(--spacing-md) 0;
    }

    .hero-content {
        padding: var(--spacing-sm);
        margin: 0 var(--spacing-xs);
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    /* CTA EXTRA PEQUEÑO */
    .cta-highlight {
        padding: var(--spacing-xs);
    }

    .cta-icon {
        font-size: 1.8rem;
    }

    .cta-highlight p {
        font-size: 0.9rem;
    }

    .news-card {
        padding: var(--spacing-sm);
    }

    /* TARJETAS DE TALLERES MÓVIL EXTRA PEQUEÑO */
    .mission-card-image {
        height: 140px;
    }

    .mission-card h3 {
        font-size: 1rem;
        padding: 0 var(--spacing-xs);
        margin-top: var(--spacing-xs);
    }

    .mission-card p {
        padding: 0 var(--spacing-xs) var(--spacing-xs);
        font-size: 0.8rem;
    }

    .newsletter-form {
        padding: var(--spacing-xs);
    }
}

/* ACCESIBILIDAD INSTITUCIONAL WCAG 2.1 AA */

/* FOCUS MEJORADO */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* FOCUS ESPECÍFICO PARA ELEMENTOS INTERACTIVOS */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.btn:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(155, 89, 182, 0.2);
}

/* SKIP LINKS MEJORADOS */
.skip-link:focus-visible {
    outline: 3px solid var(--color-text-white);
    outline-offset: 2px;
}

/* CONTENIDO SOLO PARA LECTORES DE PANTALLA */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* CONTENIDO VISIBLE SOLO AL HACER FOCUS */
.sr-only-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* CONTRASTE MEJORADO PARA TEXTOS */
.high-contrast {
    color: var(--color-text-primary) !important;
    font-weight: 600 !important;
}

/* INDICADORES DE ESTADO PARA LECTORES DE PANTALLA */
.loading-text::after {
    content: " (Cargando...)";
    font-size: 0;
}

.loading-text[aria-busy="true"]::after {
    font-size: inherit;
}

/* MEJORAS DE NAVEGACIÓN CON TECLADO */
.nav-link:focus-visible {
    background-color: var(--color-overlay);
    color: var(--color-primary);
}

.nav-toggle:focus-visible {
    background-color: var(--color-overlay);
    border-radius: var(--border-radius);
}

/* MEJORAS PARA USUARIOS CON DIFICULTADES MOTORAS */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* MANTENER TEMA CLARO INSTITUCIONAL SIEMPRE */
@media (prefers-color-scheme: dark) {
    :root {
        /* Mantener colores claros institucionales incluso en modo oscuro */
        --color-bg: #FDFBFF;
        --color-surface: #FFFFFF;
        --color-text-primary: #2C2C3E;
        --color-text-secondary: #6B697A;
    }
}

/* CONTRASTE ALTO PARA MEJOR LEGIBILIDAD */
@media (prefers-contrast: high) {
    :root {
        --color-text: #2C2C3E;
        --color-text-primary: #2C2C3E;
        --color-text-secondary: #4A4A5C;
        --color-primary: #6b2c91;
        --border-color: #6b2c91;
    }

    .btn {
        border-width: 2px;
    }

    .nav-link {
        border: 1px solid transparent;
    }

    .nav-link:hover,
    .nav-link:focus {
        border-color: var(--color-primary);
    }
}

/* ZOOM Y ESCALADO */
@media (min-resolution: 192dpi), (min-resolution: 2dppx) {
    .logo-img,
    .footer-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* TAMAÑOS DE FUENTE PERSONALIZABLES */
html.font-size-small {
    font-size: 14px;
}

html.font-size-large {
    font-size: 18px;
}

html.font-size-xl {
    font-size: 20px;
}

/* ESPACIADO MEJORADO PARA USUARIOS CON DIFICULTADES VISUALES */
.improved-spacing {
    line-height: 1.8 !important;
}

.improved-spacing h1,
.improved-spacing h2,
.improved-spacing h3,
.improved-spacing h4,
.improved-spacing h5,
.improved-spacing h6 {
    margin-bottom: calc(var(--spacing-md) * 1.5) !important;
}

.improved-spacing p {
    margin-bottom: calc(var(--spacing-sm) * 1.5) !important;
}

/* VALIDACIÓN VISUAL MEJORADA */
.form-input[aria-invalid="true"] {
    border-color: var(--color-error);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5' fill='none' stroke='%23dc3545' stroke-width='2'/%3e%3cpath stroke='%23dc3545' stroke-width='2' stroke-linecap='round' d='M6 3v3m0 2v0'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    padding-right: 36px;
}

.form-input[aria-invalid="false"] {
    border-color: var(--color-success);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2327ae60' d='m6.564.75-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    padding-right: 36px;
}

/* UTILIDADES */
.text-center { text-align: center; }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* FORMULARIOS INSTITUCIONALES */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--color-text-primary);
}

.form-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition-normal);
    background-color: var(--color-surface);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.1);
}

.form-input.is-invalid {
    border-color: var(--color-error);
}

.form-input.is-valid {
    border-color: var(--color-success);
}

.form-feedback {
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}

.form-feedback.invalid-feedback {
    color: var(--color-error);
}

.form-feedback.valid-feedback {
    color: var(--color-success);
}

/* ALERTAS INSTITUCIONALES */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
}

.alert-info {
    background-color: rgba(52, 152, 219, 0.1);
    border-left-color: var(--color-info);
    color: var(--color-info);
}

.alert-success {
    background-color: rgba(39, 174, 96, 0.1);
    border-left-color: var(--color-success);
    color: var(--color-success);
}

.alert-warning {
    background-color: rgba(243, 156, 18, 0.1);
    border-left-color: var(--color-warning);
    color: var(--color-warning);
}

.alert-error {
    background-color: rgba(231, 76, 60, 0.1);
    border-left-color: var(--color-error);
    color: var(--color-error);
}

/* BREADCRUMBS INSTITUCIONALES */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-md);
    font-size: 0.9rem;
}

.breadcrumb-item {
    color: var(--color-text-secondary);
}

.breadcrumb-item a {
    color: var(--color-primary);
    text-decoration: none;
}

.breadcrumb-item:not(:last-child)::after {
    content: '>';
    margin-left: var(--spacing-xs);
    color: var(--color-text-muted);
}

/* PAGINACIÓN INSTITUCIONAL */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xs);
    margin: var(--spacing-xl) 0;
}

.pagination-item {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--color-text);
    text-decoration: none;
    transition: var(--transition-normal);
    min-width: 40px;
    text-align: center;
}

.pagination-item:hover {
    background-color: var(--color-primary);
    color: var(--color-text-white);
    border-color: var(--color-primary);
}

.pagination-item.active {
    background-color: var(--color-primary);
    color: var(--color-text-white);
    border-color: var(--color-primary);
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* LOADING INSTITUCIONAL */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-overlay);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

/* SKIP LINKS ACCESIBILIDAD */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--color-primary);
    color: var(--color-text-white);
    padding: var(--spacing-xs) var(--spacing-sm);
    text-decoration: none;
    border-radius: var(--border-radius);
    z-index: 1001;
    font-size: 0.9rem;
    border: 2px solid var(--color-primary);
}

.skip-link:focus {
    top: 6px;
}

/* OPTIMIZACIONES INSTITUCIONALES */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* OPTIMIZACIÓN DE CARGA */
.logo-img,
.footer-logo {
    will-change: transform;
}

/* MEJORAS DE RENDIMIENTO */
.mission-card,
.news-card {
    contain: layout style paint;
}

/* SELECCIÓN DE TEXTO INSTITUCIONAL */
::selection {
    background-color: var(--color-primary);
    color: var(--color-text-white);
}

::-moz-selection {
    background-color: var(--color-primary);
    color: var(--color-text-white);
}

/* SCROLLBAR INSTITUCIONAL */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background-color: var(--color-bg-light);
}

::-webkit-scrollbar-thumb {
    background-color: var(--color-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-tertiary);
}

/* MENSAJES DE ESTADO PARA FORMULARIOS */
.success-message {
    padding: var(--spacing-sm);
    background-color: rgba(39, 174, 96, 0.1);
    border-left: 4px solid var(--color-success);
    color: var(--color-success);
    border-radius: var(--border-radius);
    margin-top: var(--spacing-sm);
}

.error-message {
    padding: var(--spacing-sm);
    background-color: rgba(231, 76, 60, 0.1);
    border-left: 4px solid var(--color-error);
    color: var(--color-error);
    border-radius: var(--border-radius);
    margin-top: var(--spacing-sm);
}

@media (max-width: 768px) {
    /* PAGE HEROES RESPONSIVOS */
    .page-hero {
        padding: var(--spacing-xl) 0 var(--spacing-lg);
        margin-top: 70px;
    }

    .page-title {
        font-size: clamp(2rem, 8vw, 2.5rem) !important;
        margin-bottom: var(--spacing-sm);
    }

    .page-subtitle {
        font-size: 1.2rem !important;
        margin-bottom: var(--spacing-sm);
    }

    .page-description {
        font-size: 1rem !important;
        line-height: 1.6;
    }

    /* FILTROS MÓVILES MEJORADOS */
    .recursos-filtros,
    .eventos-filtros {
        position: static !important;
        padding: var(--spacing-md) 0;
        background: var(--color-surface);
    }

    .filtros-wrapper {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 var(--spacing-md);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .filtros-wrapper::-webkit-scrollbar {
        display: none;
    }

    .filtro-btn {
        flex-shrink: 0;
        min-height: 44px;
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.95rem;
        white-space: nowrap;
    }

    /* GRIDS RESPONSIVOS MEJORADOS */
    /* .recursos-grid removido para usar sus propias reglas responsive */
    .eventos-grid,
    .blog-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-lg);
    }

    .recurso-card,
    .evento-card,
    .blog-card {
        margin: 0 var(--spacing-sm);
        border-radius: var(--border-radius-lg);
        overflow: hidden;
        box-shadow: var(--shadow-md);
    }

    .recurso-card:hover,
    .evento-card:hover,
    .blog-card:hover {
        transform: translateY(-4px) scale(1.01);
        box-shadow: var(--shadow-xl);
    }

    /* TIMELINE MÓVIL MEJORADO */
    .timeline-item.left .timeline-content,
    .timeline-item.right .timeline-content {
        margin-left: 50px;
        margin-right: 0;
        max-width: calc(100% - 70px);
        padding: var(--spacing-md);
    }

    .timeline-marker {
        left: 15px;
        width: 40px;
        height: 40px;
    }

    .marker-icon {
        font-size: 1.2rem;
    }

    /* FORMULARIOS CONTACT MÓVIL */
    .formulario-wrapper,
    .ubicacion-content {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-lg);
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-md);
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 54px;
        font-size: 16px; /* Prevent zoom on iOS */
        padding: var(--spacing-md);
    }

    .form-actions {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .btn {
        width: 100%;
        min-height: 54px;
        font-size: 1.1rem;
        border-radius: var(--border-radius-lg);
    }

    /* CONTACTO GRID MÓVIL */
    .contacto-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-md);
    }

    .contacto-item {
        padding: var(--spacing-md);
        text-align: center;
    }

    .contacto-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin: 0 auto var(--spacing-sm);
    }

    /* FAQ MÓVIL */
    .faq-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-md);
    }

    .faq-item {
        padding: var(--spacing-md);
    }

    /* MEJORAS DE TOUCH PARA TODAS LAS PÁGINAS */
    .btn, .filtro-btn, .nav-link, .contacto-item,
    .mission-card, .news-card, .recurso-card,
    .evento-card, .blog-card {
        -webkit-tap-highlight-color: rgba(155, 89, 182, 0.2);
        touch-action: manipulation;
    }

    /* SCROLL MEJORADO PARA MÓVIL */
    .recursos-grid-section,
    .eventos-section,
    .blog-section,
    .timeline-section {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    /* OPTIMIZACIONES PARA MÓVILES PEQUEÑOS */
    .page-hero {
        padding: var(--spacing-lg) 0;
    }

    .page-title {
        font-size: 1.8rem !important;
    }

    .page-subtitle {
        font-size: 1.1rem !important;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    /* CARDS EXTRA PEQUEÑOS */
    .recurso-card,
    .evento-card,
    .blog-card {
        margin: 0;
    }

    .recurso-image,
    .evento-image {
        height: 160px;
    }

    /* FORMULARIOS EXTRA PEQUEÑOS */
    .formulario-container {
        padding: var(--spacing-md);
        margin: 0;
    }

    .contacto-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .contacto-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    /* TIMELINE EXTRA PEQUEÑO */
    .timeline-content {
        margin-left: 40px;
        max-width: calc(100% - 50px);
        padding: var(--spacing-sm);
    }

    .timeline-marker {
        left: 10px;
        width: 30px;
        height: 30px;
    }

    .marker-icon {
        font-size: 1rem;
    }

    /* BOTONES EXTRA PEQUEÑOS */
    .btn {
        min-height: 50px;
        font-size: 1rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    /* FILTROS EXTRA PEQUEÑOS */
    .filtro-btn {
        min-height: 40px;
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.9rem;
    }
}

/* PERFORMANCE MÓVIL */
@media (max-width: 768px) {
    /* GPU ACCELERATION PARA ANIMACIONES MÓVILES */
    .mission-card,
    .news-card,
    .recurso-card,
    .evento-card,
    .blog-card,
    .timeline-content,
    .contacto-item {
        will-change: transform;
        transform: translateZ(0);
    }

    /* OPTIMIZACIÓN DE IMÁGENES MÓVIL */
    .hero-bg-image,
    .mission-card-image img,
    .recurso-image img,
    .evento-image img {
        will-change: transform;
        backface-visibility: hidden;
    }

    /* SMOOTH SCROLLING MEJORADO */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    /* FOCUS STATES MEJORADOS PARA MÓVIL */
    .btn:focus,
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        outline: 3px solid rgba(155, 89, 182, 0.4);
        outline-offset: 2px;
    }
}

/* DARK MODE SUPPORT MÓVIL */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .header {
        background: rgba(20, 20, 30, 0.95);
    }

    .nav-mobile {
        background: rgba(20, 20, 30, 0.98);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
}

/* REDUCED MOTION SUPPORT */
@media (prefers-reduced-motion: reduce) {
    .mission-card,
    .news-card,
    .recurso-card,
    .evento-card,
    .blog-card,
    .timeline-content,
    .contacto-item {
        transition: none;
        animation: none;
    }

    .hero-bg-image {
        transform: none;
    }
}

@media (max-width: 768px) {
    /* GLOBAL MOBILE TEXT IMPROVEMENTS */
    body {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }

    p, li {
        font-size: clamp(0.9rem, 3.5vw, 1.1rem) !important;
        line-height: 1.5 !important;
    }

    .hero {
        padding: var(--spacing-lg) 0;
        min-height: 85vh;
        background-attachment: scroll;
    }

    .hero-content {
        padding: var(--spacing-lg);
        margin: 0 var(--spacing-sm);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        background: rgba(255, 255, 255, 0.98) !important;
        border: 3px solid rgba(155, 89, 182, 0.3);
        z-index: 998 !important;
        position: relative;
        /* Ensure content is always visible */
        min-height: auto;
        /* Better shadow for visibility */
        box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4),
                    0 0 0 1px rgba(255, 255, 255, 0.8) inset,
                    0 0 20px rgba(155, 89, 182, 0.2);
        /* Better text contrast */
        color: var(--color-text) !important;
    }

    .hero h1 {
        color: var(--color-primary) !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        font-weight: 700 !important;
    }

    .hero p {
        color: var(--color-text) !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        font-weight: 500 !important;
    }

    .hero-subtitle {
        color: var(--color-text-secondary) !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        font-weight: 400 !important;
    }

    .hero h1 {
        font-size: clamp(1.8rem, 6vw, 2.5rem) !important;
        margin-bottom: var(--spacing-sm);
        line-height: 1.3 !important;
        text-align: center !important;
    }

    .hero p {
        font-size: clamp(1rem, 4vw, 1.2rem) !important;
        margin-bottom: var(--spacing-md);
        line-height: 1.5 !important;
        text-align: center !important;
    }

    .hero-subtitle {
        font-size: clamp(0.9rem, 3.5vw, 1.1rem) !important;
        margin-bottom: var(--spacing-lg);
        line-height: 1.6 !important;
        text-align: center !important;
    }

    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-md);
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: none;
        min-height: 56px;
        font-size: 1.1rem;
        font-weight: 600;
        border-radius: var(--border-radius-xl);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .hero-buttons .btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        transition: left 0.5s;
    }

    .hero-buttons .btn:active {
        transform: scale(0.98);
    }

    .hero-buttons .btn:hover::before {
        left: 100%;
    }

    .mission {
        padding: var(--spacing-xl) 0;
    }

    .mission-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        margin-top: var(--spacing-lg);
    }

    .mission-card {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(155, 89, 182, 0.1);
        border-radius: var(--border-radius-xl);
        padding: var(--spacing-lg);
        transition: all 0.3s ease;
        transform: translateY(0);
    }

    .mission-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(155, 89, 182, 0.15);
    }

    .mission-card-image {
        height: 200px;
        border-radius: var(--border-radius-lg);
        overflow: hidden;
        margin-bottom: var(--spacing-md);
    }

    .mission-card h3 {
        font-size: 1.3rem;
        margin-bottom: var(--spacing-sm);
        color: var(--color-primary);
    }

    .mission-card p {
        font-size: 1rem;
        line-height: 1.6;
        color: var(--color-text-secondary);
    }

    .news {
        padding: var(--spacing-xl) 0;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        margin-top: var(--spacing-lg);
    }

    .news-card {
        border-radius: var(--border-radius-xl);
        overflow: hidden;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(155, 89, 182, 0.1);
        transition: all 0.3s ease;
    }

    .news-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 30px rgba(155, 89, 182, 0.15);
    }

    .news-card-content {
        padding: var(--spacing-lg);
    }

    .news-card h3 {
        font-size: 1.2rem;
        margin-bottom: var(--spacing-sm);
        color: var(--color-primary);
    }

    .news-card p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: var(--spacing-md);
        color: var(--color-text-secondary);
    }

    .link-arrow {
        color: var(--color-primary);
        font-weight: 600;
        text-decoration: none;
        transition: all 0.2s ease;
    }

    .link-arrow:hover {
        color: var(--color-secondary);
        transform: translateX(5px);
    }

    .cta {
        padding: var(--spacing-xl) 0;
        background: linear-gradient(135deg, var(--color-primary-light), var(--color-secondary-light));
    }

    .cta-content {
        text-align: center;
        max-width: 100%;
    }

    .cta h2 {
        font-size: clamp(1.4rem, 5vw, 2rem) !important;
        margin-bottom: var(--spacing-lg);
        color: var(--color-primary) !important;
        line-height: 1.3 !important;
        text-align: center !important;
        padding: 0 var(--spacing-sm) !important;
    }

    .cta p {
        font-size: clamp(0.95rem, 3.5vw, 1.1rem) !important;
        line-height: 1.6 !important;
        margin-bottom: var(--spacing-lg);
        color: var(--color-text-secondary) !important;
        text-align: center !important;
        padding: 0 var(--spacing-sm) !important;
    }

    .cta-highlights {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        margin: var(--spacing-lg) 0;
    }

    .cta-highlight {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        padding: var(--spacing-lg);
        border-radius: var(--border-radius-xl);
        border: 1px solid rgba(155, 89, 182, 0.1);
        text-align: center;
        transition: all 0.3s ease;
    }

    .cta-highlight:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(155, 89, 182, 0.15);
    }

    .cta-icon {
        font-size: 2.5rem;
        margin-bottom: var(--spacing-sm);
        display: block;
    }

    .cta-highlight p {
        font-size: 1rem;
        line-height: 1.5;
        margin: 0;
        color: var(--color-text);
    }

    .newsletter-form {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-md);
        max-width: none;
        margin: var(--spacing-lg) 0;
        background: rgba(255, 255, 255, 0.95);
        padding: var(--spacing-lg);
        border-radius: var(--border-radius-xl);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(155, 89, 182, 0.1);
    }

    .newsletter-form input[type="email"] {
        width: 100%;
        padding: var(--spacing-md);
        font-size: 1.1rem;
        border: 2px solid rgba(155, 89, 182, 0.2);
        border-radius: var(--border-radius-lg);
        background: rgba(255, 255, 255, 0.9);
        transition: all 0.3s ease;
    }

    .newsletter-form input[type="email"]:focus {
        border-color: var(--color-primary);
        outline: none;
        box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.1);
    }

    .newsletter-form .btn {
        width: 100%;
        min-height: 56px;
        font-size: 1.1rem;
        font-weight: 600;
        background: var(--gradient-primary);
        border: none;
        border-radius: var(--border-radius-lg);
        color: white;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .newsletter-form .btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        transition: left 0.5s;
    }

    .newsletter-form .btn:hover::before {
        left: 100%;
    }

    .newsletter-form .btn:active {
        transform: scale(0.98);
    }

    /* SECTION TITLES MOBILE */
    .section-title {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        margin-bottom: var(--spacing-lg);
        text-align: center !important;
        color: var(--color-primary) !important;
        line-height: 1.3 !important;
        padding: 0 var(--spacing-sm) !important;
    }

    /* FOOTER MOBILE OPTIMIZATIONS */
    .footer {
        padding: var(--spacing-xl) 0 var(--spacing-lg);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .footer-section h3,
    .footer-section h4 {
        font-size: 1.2rem;
        margin-bottom: var(--spacing-md);
        color: var(--color-primary);
    }

    .footer-section p,
    .footer-section li {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* PERFORMANCE IMPROVEMENTS */
    .hero,
    .mission,
    .news,
    .cta {
        will-change: transform;
        transform: translateZ(0);
    }

    /* SCROLL BEHAVIOR */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    /* TOUCH IMPROVEMENTS */
    .btn,
    .link-arrow,
    .mission-card,
    .news-card,
    .cta-highlight,
    .nav-toggle,
    .nav-link {
        -webkit-tap-highlight-color: rgba(155, 89, 182, 0.2);
        /* Better touch targets */
        touch-action: manipulation;
    }

    /* MOBILE VISIBILITY FIXES */
    .hero {
        /* Ensure hero is visible after auth */
        margin-top: 80px !important;
        position: relative;
        z-index: 1;
    }

    .header {
        /* Ensure header is always on top */
        z-index: 1000 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }

    .nav-toggle {
        /* Ensure menu button is always visible */
        z-index: 1001 !important;
        position: relative !important;
        pointer-events: auto !important;
    }

    /* MOBILE CONTENT FIXES */
    .hero-content {
        /* Force content to be visible */
        position: relative !important;
        z-index: 900 !important;
        /* Stronger background for readability */
        background: rgba(255, 255, 255, 0.98) !important;
        border: 2px solid rgba(155, 89, 182, 0.4) !important;
        box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5),
                    0 0 50px rgba(155, 89, 182, 0.3),
                    inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 80vh;
        padding: var(--spacing-md) 0;
    }

    .hero-content {
        padding: var(--spacing-md);
        margin: 0 var(--spacing-xs);
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: 2px solid rgba(155, 89, 182, 0.25);
        z-index: 998 !important;
        /* Ensure visibility on small screens */
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4),
                    0 0 0 1px rgba(255, 255, 255, 0.6) inset,
                    0 0 30px rgba(155, 89, 182, 0.3);
        /* Better text contrast */
        color: var(--color-text) !important;
    }

    .hero h1 {
        color: var(--color-primary) !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        font-weight: 700 !important;
    }

    .hero p {
        color: var(--color-text) !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        font-weight: 500 !important;
    }

    .hero-subtitle {
        color: var(--color-text-secondary) !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        font-weight: 400 !important;
    }

    .hero h1 {
        font-size: clamp(1.6rem, 8vw, 2rem) !important;
        line-height: 1.2 !important;
        margin-bottom: var(--spacing-sm) !important;
    }

    .hero p {
        font-size: clamp(0.95rem, 4vw, 1.1rem) !important;
        line-height: 1.4 !important;
        margin-bottom: var(--spacing-sm) !important;
    }

    .hero-subtitle {
        font-size: clamp(0.85rem, 3.5vw, 1rem) !important;
        line-height: 1.5 !important;
        margin-bottom: var(--spacing-md) !important;
    }

    .mission-card,
    .news-card {
        margin: 0 var(--spacing-xs);
    }

    .mission-card-image {
        height: 180px;
    }

    .cta-highlight {
        padding: var(--spacing-md);
    }

    .cta-icon {
        font-size: 2rem;
    }

    .newsletter-form {
        padding: var(--spacing-md);
    }
}

/* MÓVILES ULTRA PEQUEÑOS - MENÚ WIDE & LOW */
@media (max-width: 320px) {
    .nav-mobile {
        left: 8px !important;
        right: 8px !important;
        top: 75px !important;
    }

    .nav-mobile a,
    .nav-mobile .nav-link {
        font-size: 14px !important;
        padding: 10px 12px !important;
    }

}

/* IMPRESIÓN */
@media print {
    .header, .nav-mobile, .hero-buttons, .footer {
        display: none !important;
    }
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    .hero {
        background: none !important;
        color: var(--color-text) !important;
    }
}

/* ========================================
   BOTÓN FLOTANTE DE WHATSAPP
   ======================================== */

.whatsapp-float {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 60px !important;
    height: 60px !important;
    background: #25D366 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 30px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    z-index: 99999 !important; /* Máximo z-index posible */
    transition: all 0.3s ease;
    text-decoration: none !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    background: #20BA5A;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-float i {
    color: white;
}

/* Animación de pulso para llamar la atención */
@keyframes pulse-whatsapp {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.whatsapp-float {
    animation: pulse-whatsapp 2s infinite;
}

/* Tooltip para WhatsApp en desktop */
.whatsapp-float::before {
    content: "¿Necesitas ayuda?";
    position: absolute;
    right: 70px;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.whatsapp-float:hover::before {
    opacity: 1;
}

/* Mobile adjustments para WhatsApp */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 28px;
    }

    .whatsapp-float::before {
        display: none; /* Ocultar tooltip en móvil */
    }
}
