/* ====================================
   RESPONSIVE DESIGN - SECCIÓN INICIO
   Mobile-First Approach
   ==================================== */

/* ===== CSS VARIABLES - DEFINIR ANTES DE USO ===== */
:root {
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* ===== NAVIGATION SYSTEM COMPATIBILITY ===== */
/* Ensure inicio section respects the tab navigation system */
#inicio:not(.active) {
    display: none !important;
}

#inicio.active {
    display: block !important;
}

/* ===== BASE STYLES - MOBILE FIRST ===== */

/* CORRECCIÓN CRÍTICA: Evitar desplazamiento en desktop */
.main-content {
    position: relative !important;
    transform: none !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.container {
    position: relative !important;
    transform: none !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.content {
    position: relative !important;
    transform: none !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Sección principal de inicio */
#inicio {
    min-height: 100vh;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    position: relative;
    transform: none !important;
    left: 0 !important;
    right: 0 !important;
}

/* Hero Section - Contenedor principal */
#inicio .hero-section {
    min-height: 100vh;
    width: 100%;
    background: 
        linear-gradient(135deg, #f8fafc2d 0%, #e2e8f021 30%, #cbd5e128 70%, #f1f5f9 100%),
        url('../images/PREP-FONDO-WEB34psd.png');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: scroll;
    border-radius: 25px;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-medium);
    border: var(--glass-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-blend-mode: overlay;
}

/* Overlay para centrado de contenido - CORREGIDO: removido position absolute */
#inicio .hero-overlay {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 2rem 1rem;
    min-height: 100vh;
    padding-top: 2rem;
}

/* ===== HERO CONTENT - ESTRUCTURA PRINCIPAL ===== */

/* Contenedor principal - Mobile First - CORREGIDO: padding generoso para evitar colapso */
#inicio .hero-content {
    width: 100%;
    max-width: 1200px;
    text-align: center;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 1rem 1.5rem;
    margin: 0 auto;
    position: relative;
    min-height: auto; /* Asegurar que no haya restricciones de altura */
    margin-top: 1rem;
}

/* ===== BLOQUE 1: HEADER CON LOGO ===== */
#inicio .inicio-header {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.inicio-logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: transparent;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 600px;
    transition: var(--transition);
    /* En móviles: layout vertical */
    flex-direction: column;
    text-align: center;
}

.inicio-logo-mdm {
    height: 100px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 15px rgba(0, 229, 145, 0.3));
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

.inicio-logo-texto {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.inicio-logo-texto-line1 {
    color: #ffffff;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6);
    margin-bottom: 4px;
    white-space: nowrap;
}

.inicio-logo-texto-line2 {
    color: #ffffff;
    font-family: 'Poppins', Arial, sans-serif !important;
    font-size: 16px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
}

.inicio-linea {
    color: #ffffff;
    font-weight: 700;
    margin-right: 0.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6);
}

/* ===== BLOQUE 2: TEXTOS PRINCIPALES ===== */
#inicio .hero-text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
}

#inicio .hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 0, 0, 0.5);
}

#inicio .hero-subtitle {
    font-size: 1rem;
    color: #ffffff;
    opacity: 0.95;
    line-height: 1.6;
    margin-bottom: 0;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 0, 0, 0.5);
}

/* ===== BLOQUE 3: TARJETAS DE SERVICIOS ===== */
#inicio .features-grid-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    /* Asegurar que tenga contenido visible */
    min-height: 200px;
}

/* Grilla de tarjetas - Mobile First: Una columna */
#inicio .features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    padding: 0 1rem;
    justify-items: center;
    align-items: start;
    justify-content: center;
    /* Asegurar que la grilla sea visible */
    min-height: auto;
    box-sizing: border-box;
}

/* Tarjetas individuales */
#inicio .feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 2rem 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 350px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    /* Forzar visibilidad */
    opacity: 1;
    position: relative;
    box-sizing: border-box;
    margin: 0 auto;
}

#inicio .feature-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

#inicio .feature-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
    color: white;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
}

#inicio .feature-card h3 {
    font-size: 1.1rem;
    color: white;
    margin: 10px 0 8px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

#inicio .feature-card p {
    color: white;
    opacity: 0.9;
    line-height: 1.6;
    font-size: 0.85rem;
    margin: 0;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

/* ===== RESPONSIVE DESIGN PARA NAVEGACIÓN ===== */

/* Menú de navegación - COMENTADO YA QUE AHORA ES DESPLEGABLE
.sidebar {
    width: 100%;
    min-width: unset;
    padding: 15px 10px;
    border-radius: 0;
    position: relative;
    order: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    height: auto;
    border-bottom: var(--glass-border);
    border-right: none;
}

.sidebar button,
.sidebar .sidebar-link {
    margin: 0;
    padding: 12px 16px;
    font-size: 0.9rem;
    border-radius: 12px;
    width: 100%;
    text-align: center;
    transition: var(--transition);
}
*/

/* ===== REGLAS CRÍTICAS PARA EVITAR COLAPSO ===== */

/* Forzar visibilidad de elementos principales */
#inicio,
#inicio .hero-section,
#inicio .hero-overlay,
#inicio .hero-content {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Evitar colapso de altura en elementos padre */
#inicio .hero-section {
    flex: 1;
    height: auto;
}

#inicio .hero-overlay {
    flex: 1;
    height: auto;
}

#inicio .hero-content {
    flex: none;
    height: auto;
}

/* Asegurar que los bloques internos sean visibles */
#inicio .inicio-header,
#inicio .hero-text-container,
#inicio .features-grid-container {
    display: flex !important;
    width: 100% !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Forzar dimensiones mínimas para prevenir colapso */
#inicio .inicio-header {
    min-height: 80px;
}

#inicio .hero-text-container {
    min-height: 120px;
}

#inicio .features-grid-container {
    min-height: 250px;
}

/* ===== MEDIA QUERIES - MOBILE FIRST APPROACH ===== */

/* ===== CORRECCIONES ESPECÍFICAS PARA GRILLA DE SERVICIOS ===== */

/* ===== MÓVILES MUY PEQUEÑOS (~320px) - 1 COLUMNA ===== */
@media (max-width: 480px) {
    #inicio .features-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        padding: 0 0.5rem;
        max-width: 100%;
        justify-items: center;
    }
    
    #inicio .feature-card {
        max-width: 100%;
        width: 100%;
        min-height: 180px;
        padding: 1.5rem 1rem;
        margin: 0;
    }
    
    #inicio .feature-card h3 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    #inicio .feature-card p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

/* ===== TABLETS VERTICALES / PANTALLAS PEQUEÑAS (~600px) - 2 COLUMNAS + 1 ===== */
@media (min-width: 481px) and (max-width: 767px) {
    #inicio .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 0 1rem;
        max-width: 600px;
        justify-items: center;
        align-items: start;
    }
    
    /* La tercera tarjeta se centra automáticamente en la segunda fila */
    #inicio .feature-card:nth-child(3) {
        grid-column: 1 / -1;
        max-width: 280px;
        justify-self: center;
    }
    
    #inicio .feature-card {
        max-width: 280px;
        width: 100%;
        min-height: 200px;
        padding: 1.8rem 1.3rem;
    }
    
    #inicio .feature-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.9rem;
    }
    
    #inicio .feature-card p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
}

/* ===== TABLETS HORIZONTALES (~712px) - 2 COLUMNAS EN PRIMERA FILA + 1 EN SEGUNDA ===== */
@media (min-width: 768px) and (max-width: 1023px) {
    #inicio .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        padding: 0 2rem;
        max-width: 800px;
        justify-items: center;
        align-items: start;
    }
    
    /* La tercera tarjeta ocupa toda la segunda fila centrada */
    #inicio .feature-card:nth-child(3) {
        grid-column: 1 / -1;
        max-width: 350px;
        justify-self: center;
    }
    
    #inicio .feature-card {
        max-width: 350px;
        width: 100%;
        min-height: 240px;
        padding: 2.2rem 1.8rem;
    }
    
    #inicio .feature-card h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    #inicio .feature-card p {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* ===== DESKTOP GRANDES (≥1080px) - 3 COLUMNAS EN UNA SOLA FILA ===== */
@media (min-width: 1024px) {
    #inicio .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
        padding: 0 3rem;
        max-width: 1200px;
        justify-items: center;
        align-items: start;
        justify-content: center;
    }
    
    /* Todas las tarjetas en una sola fila */
    #inicio .feature-card {
        max-width: 350px;
        width: 100%;
        min-height: 280px;
        padding: 2.5rem 2rem;
    }
    
    #inicio .feature-card h3 {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }
    
    #inicio .feature-card p {
        font-size: 1.1rem;
        line-height: 1.7;
    }
    
    /* Asegurar que el contenedor de la grilla esté centrado */
    #inicio .features-grid-container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }
}

/* ===== DESKTOP EXTRA GRANDES (≥1400px) - OPTIMIZACIÓN ADICIONAL ===== */
@media (min-width: 1400px) {
    #inicio .features-grid {
        gap: 3rem;
        max-width: 1400px;
    }
    
    #inicio .feature-card {
        max-width: 380px;
        min-height: 300px;
        padding: 3rem 2.5rem;
    }
    
    #inicio .feature-card h3 {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }
    
    #inicio .feature-card p {
        font-size: 1.2rem;
        line-height: 1.8;
    }
}

/* ===== EXTRA SMALL MOBILE (max-width: 375px) - iPhone SE y similares ===== */
@media (max-width: 375px) {
    /* Ajustes de sección principal */
    #inicio {
        padding: 0;
        min-height: 100vh;
    }
    
    #inicio .hero-section {
        min-height: 100vh;
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    
    #inicio .hero-overlay {
        padding: 1.5rem 0.8rem;
        min-height: 100vh;
        padding-top: 1.5rem;
        justify-content: flex-start;
    }
    
    #inicio .hero-content {
        gap: 1.5rem;
        padding: 0.8rem 1rem;
        min-height: auto;
        margin-top: 0.5rem;
    }
    
    /* Logo en extra small mobile */
    .inicio-logo-mdm {
        height: 80px;
    }
    
    .inicio-logo-texto-line1,
    .inicio-logo-texto-line2 {
        font-size: 14px;
    }
    
    /* Hero heading más pequeño */
    #inicio .hero-heading {
        font-size: 1.8rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    /* Subtitle más pequeño */
    #inicio .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    /* Tarjetas en extra small mobile */
    #inicio .feature-card {
        min-height: 160px;
        padding: 1.2rem 1rem;
    }
    
    #inicio .feature-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    #inicio .feature-card p {
        font-size: 0.85rem;
    }
    
    /* Features grid más compacto */
    #inicio .features-grid-container {
        min-height: 200px;
    }
    
    #inicio .features-grid {
        gap: 1rem;
    }
}

/* ===== SMALL MOBILE (376px - 480px) ===== */
@media (min-width: 376px) and (max-width: 480px) {
    /* Ajustes de sección principal */
    #inicio {
        padding: 0;
        min-height: 100vh;
    }
    
    #inicio .hero-section {
        min-height: 100vh;
        border-radius: 15px;
    }
    
    #inicio .hero-overlay {
        padding: 1.8rem 1rem;
        min-height: 100vh;
        padding-top: 1.8rem;
        justify-content: flex-start;
    }
    
    #inicio .hero-content {
        gap: 1.8rem;
        padding: 1rem 1.2rem;
        min-height: auto;
        margin-top: 0.8rem;
    }
    
    /* Logo en small mobile */
    .inicio-logo-mdm {
        height: 90px;
    }
    
    .inicio-logo-texto-line1,
    .inicio-logo-texto-line2 {
        font-size: 15px;
    }
    
    /* Tarjetas en small mobile */
    #inicio .feature-card {
        min-height: 180px;
        padding: 1.5rem 1.2rem;
    }
}

/* MÓVILES NORMALES (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    /* Ajustes de sección principal */
    #inicio {
        padding: 0;
        min-height: 100vh;
    }
    
    #inicio .hero-section {
        min-height: 100vh;
        border-radius: 18px;
    }
    
    #inicio .hero-overlay {
        padding: 2.2rem 1.2rem;
        min-height: 100vh;
        padding-top: 2rem;
        justify-content: flex-start;
    }
    
    #inicio .hero-content {
        gap: 2.2rem;
        padding: 1.4rem 1.5rem;
        min-height: auto;
        margin-top: 1rem;
    }
    
    /* Logo en móviles normales */
    .inicio-logo-section {
        max-width: 95%;
        padding: 1rem;
    }
    
    .inicio-logo-mdm {
        height: 100px;
        margin-bottom: 0.5rem;
    }
    
    .inicio-logo-texto {
    display: flex
;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
    margin-top: -16px;
    }

    .inicio-logo-texto-line1,
    .inicio-logo-texto-line2 {
        font-size: 17px;
    }
    
    /* Textos principales */
    #inicio .hero-title {
        font-size: 1.6rem;
        line-height: 1.2;
    }
    
    #inicio .hero-subtitle {
        font-size: 1rem;
    }
    
    /* Tarjetas en móviles normales */
    #inicio .feature-card {
        padding: 1.4rem 1.2rem;
        min-height: 180px;
    }
    
    #inicio .feature-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    #inicio .feature-card p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Features grid */
    #inicio .features-grid {
        gap: 1.2rem;
    }
}

/* ===== TABLET PORTRAIT (768px - 1023px) ===== */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Ajustes generales para tablets */
    #inicio {
        padding: 0;
        min-height: 100vh;
    }
    
    #inicio .hero-section {
        min-height: 100vh;
        border-radius: 20px;
    }
    
    #inicio .hero-overlay {
        padding: 2.5rem 2rem;
        min-height: 100vh;
        padding-top: 2rem;
        justify-content: flex-start;
    }
    
    #inicio .hero-content {
        gap: 2.8rem;
        padding: 1.8rem 2rem;
        min-height: auto;
        margin-top: 1rem;
    }
    
    /* Logo en tablets: cambiar a horizontal */
    .inicio-logo-section {
        flex-direction: row;
        text-align: left;
        max-width: 800px;
    }
    
    .inicio-logo-mdm {
        height: 120px;
        margin-bottom: 0;
    }
    
    .inicio-logo-texto-line1 {
        font-size: 20px;
    }
    
    .inicio-logo-texto-line2 {
        font-size: 18px;
    }
    
    /* Textos principales en tablet */
    #inicio .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    #inicio .hero-subtitle {
        font-size: 1.2rem;
    }
    
    /* Tarjetas en tablets */
    #inicio .feature-card {
        min-height: 220px;
        padding: 2rem 1.8rem;
    }
    
    #inicio .feature-card h3 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    
    #inicio .feature-card p {
        font-size: 1rem;
    }
    
    /* Features grid en tablet - COMENTADO: Ahora se usa media query específica arriba */
    /*
    #inicio .features-grid {
        gap: 1.5rem;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    */
    
    /* Sidebar más grande en tablets */
    .principal-sidebar {
        width: 80%;
        max-width: 350px;
    }
}

/* ===== DESKTOP (1024px - 1399px) ===== */
@media (min-width: 1024px) and (max-width: 1399px) {
    /* Ajustes generales para desktop */
    #inicio {
        padding: 0;
        min-height: 100vh;
    }
    
    #inicio .hero-section {
        min-height: 100vh;
        border-radius: 25px;
    }
    
    #inicio .hero-overlay {
        padding: 3rem 3rem;
        min-height: 100vh;
        justify-content: center;
    }
    
    #inicio .hero-content {
        gap: 3.5rem;
        padding: 2.5rem 3rem;
        min-height: auto;
        margin-top: 0;
    }
    
    /* Logo en desktop: horizontal */
    .inicio-logo-section {
        flex-direction: row;
        text-align: left;
        max-width: 900px;
    }
    
    .inicio-logo-mdm {
        height: 140px;
        margin-bottom: 0;
        margin-right: 1.5rem;
    }
    
    .inicio-logo-texto-line1 {
        font-size: 24px;
    }
    
    .inicio-logo-texto-line2 {
        font-size: 20px;
        margin-left: 71px;
    }
    
    /* Textos principales en desktop */
    #inicio .hero-title {
        font-size: 2.8rem;
        line-height: 1.2;
    }
    
    #inicio .hero-subtitle {
        font-size: 1.4rem;
    }
    
    /* Tarjetas en desktop */
    #inicio .feature-card {
        min-height: 260px;
        padding: 2.5rem 2rem;
    }
    
    #inicio .feature-card h3 {
        font-size: 1.6rem;
        margin-bottom: 1.2rem;
    }
    
    #inicio .feature-card p {
        font-size: 1.1rem;
    }
    
    /* Features grid en desktop - COMENTADO: Ahora se usa media query específica arriba */
    /*
    #inicio .features-grid {
        gap: 2rem;
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    */
    
    /* Sidebar en desktop */
    .principal-sidebar {
        width: 70%;
        max-width: 450px;
    }
}

/* ===== LARGE DESKTOP (1400px+) ===== */
@media (min-width: 1400px) {
    /* Ajustes generales para large desktop */
    #inicio {
        padding: 0;
        min-height: 100vh;
    }
    
    #inicio .hero-section {
        min-height: 100vh;
        border-radius: 30px;
    }
    
    #inicio .hero-overlay {
        padding: 4rem 4rem;
        min-height: 100vh;
        justify-content: center;
    }
    
    #inicio .hero-content {
        gap: 4rem;
        padding: 3rem 4rem;
        min-height: auto;
        margin-top: 0;
    }
    
    /* Logo en large desktop: horizontal y más grande */
    .inicio-logo-section {
        flex-direction: row;
        text-align: left;
        max-width: 1000px;
    }
    
    .inicio-logo-mdm {
        height: 160px;
        margin-bottom: 0;
        margin-right: 2rem;
    }
    
    .inicio-logo-texto-line1 {
        font-size: 28px;
    }
    
    .inicio-logo-texto-line2 {
        font-size: 24px;
    }
    
    /* Textos principales en large desktop */
    #inicio .hero-title {
        font-size: 3.2rem;
        line-height: 1.2;
    }
    
    #inicio .hero-subtitle {
        font-size: 1.6rem;
        line-height: 1.5;
    }
    
    /* Tarjetas en large desktop */
    #inicio .feature-card {
        min-height: 300px;
        padding: 3rem 2.5rem;
    }
    
    #inicio .feature-card h3 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    #inicio .feature-card p {
        font-size: 1.2rem;
    }
    
    /* Features grid en large desktop: 3 columnas */
    #inicio .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
        max-width: 1000px;
    }
    
    /* Sidebar en large desktop */
    .principal-sidebar {
        width: 60%;
        max-width: 500px;
    }
}

/* ===== ESTILOS ESPECIALES Y OPTIMIZACIONES ===== */

/* Retina displays y pantallas de alta densidad */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #inicio .hero-section {
        background-image: 
            linear-gradient(135deg, #f8fafc2d 0%, #e2e8f021 30%, #cbd5e128 70%, #f1f5f9 100%),
            url('../images/PREP-FONDO-WEB34psd.png');
        background-size: cover;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== FIN DE MEDIA QUERIES ===== */

/* ===== MEJORAS ADICIONALES ===== */

/* Separación clara entre secciones */
.noticias-section {
    margin-top: 4rem;
    padding-top: 3rem;
}

/* Evitar desbordamiento horizontal */
.web-container,
.container,
.content {
    overflow-x: hidden;
    box-sizing: border-box;
    justify-items: center;
}

/* Asegurar que el contenido no se corte */
.main-content {
    min-height: calc(100vh - 90px);
    box-sizing: border-box;
}
#inicio .features-grid,
.inicio-logo-section {
    transition: all 0.3s ease;
}

/* Box-sizing universal */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ===== RESPONSIVE PARA DISPOSITIVOS DE ALTA RESOLUCIÓN ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-mdm,
    .inicio-logo-mdm {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ====================================
   REGLAS DE EMERGENCIA - CORRECCIÓN CRÍTICA
   PREVENCIÓN ABSOLUTA DE COLAPSO
   ==================================== */

/* REGLA CRÍTICA: Forzar visibilidad total en móviles y tablets */
@media (max-width: 1023px) {
    /* Sección principal DEBE ser visible */
    #inicio {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 100vh !important;
        height: auto !important;
        padding: 0 !important;
        overflow: visible !important;
    }
    
    /* Hero section DEBE ocupar espacio */
    #inicio .hero-section {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 100vh !important;
        height: auto !important;
        width: 100% !important;
        position: relative !important;
        /* CRÍTICO: sin position absolute */
    }
    
    /* Overlay DEBE ser visible y ocupar espacio */
    #inicio .hero-overlay {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100vh !important;
        /* CRÍTICO: NO usar position absolute */
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        padding: 4rem 1rem !important;
    }
    
    /* Contenido principal DEBE ser visible */
    #inicio .hero-content {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        padding: 3rem 1.5rem !important;
        gap: 3rem !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        position: relative !important;
    }
    
    /* Todos los bloques internos DEBEN ser visibles */
    #inicio .inicio-header,
    #inicio .hero-text-container,
    #inicio .features-grid-container {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        min-height: auto !important;
        height: auto !important;
    }
    
    /* Grilla de tarjetas DEBE ser visible */
    #inicio .features-grid {
        display: grid !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: auto !important;
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Tarjetas individuales DEBEN ser visibles */
    #inicio .feature-card {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        max-width: 350px !important;
        min-height: 200px !important;
        height: auto !important;
        margin: 0 auto !important;
    }
    
    /* Títulos y textos DEBEN ser visibles */
    #inicio .hero-title,
    #inicio .hero-subtitle {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: auto !important;
    }
}

/* REGLA ADICIONAL PARA TABLETS - COMENTADO: Conflicto con nuevas reglas específicas */
/*
@media (min-width: 768px) and (max-width: 1023px) {
    #inicio .features-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
*/

/* ===== REGLAS ADICIONALES DE CENTRADO Y FLUIDEZ ===== */

/* Asegurar centrado perfecto en todas las resoluciones */
#inicio .features-grid-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#inicio .features-grid {
    justify-content: center !important;
    align-content: start !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Prevenir desbordamiento en todas las resoluciones */
#inicio .feature-card {
    overflow: hidden !important;
    word-wrap: break-word !important;
    hyphens: auto !important;
}

/* Asegurar legibilidad en textos pequeños */
@media (max-width: 480px) {
    #inicio .feature-card h3,
    #inicio .feature-card p {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
    }
}

/* Mejorar hover effects en dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    #inicio .feature-card:hover {
        transform: none !important;
    }
    
    #inicio .feature-card:active {
        transform: scale(0.98) !important;
        transition: transform 0.1s ease !important;
    }
}



