/* ========================================
   ARCHIVO CSS RESPONSIVO PARA TODA LA PLATAFORMA IMSS
   Mejoras de responsividad para móviles, tablets y desktop
   VERSIÓN: 2.1 - Actualizado 21/07/2025
   CACHE BUSTER: Cambios se reflejan inmediatamente
   ======================================== */

/* IMPORTANTE: Para forzar actualización de cache */
/* Versión del CSS: v2.1.2025 */

/* Reset y configuración base - FORZAR APLICACIÓN */
* {
    box-sizing: border-box !important;
}

html {
    font-size: 16px !important;
    scroll-behavior: smooth !important;
}

body {
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* OVERRIDE para evitar conflictos con estilos inline */
body[style*="background-color"] {
    background-color: var(--bg-color) !important;
}

/* Variables CSS para colores institucionales */
:root {
    --imss-purple: #660033;
    --imss-gold: #a47e2c;
    --imss-gold-alt: #b8860b;
    --imss-green: #2d5a3d;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f8f9fa;
    --white: #ffffff;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
    
    /* Tamaños responsivos */
    --header-height-mobile: 60px;
    --header-height-desktop: 65px;
    --subheader-height: 52px;
    --container-padding: 15px;
    --section-padding: 2rem;
}

/* ========================================
   ESTILOS ESPECÍFICOS PLATAFORMA IMSS
   ======================================== */

/* Body principal - Fuerza aplicación */
body {
    background-color: var(--bg-color) !important;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif !important;
    line-height: 1.6 !important;
    color: var(--text-color) !important;
    font-size: 16px !important;
}

/* Headers principales IMSS */
.header-principal {
    background-color: var(--imss-purple) !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    min-height: var(--header-height-desktop) !important;
    margin-bottom: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1001 !important;
    box-shadow: var(--shadow) !important;
}

.sub-navbar {
    background-color: var(--imss-gold-alt) !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    min-height: var(--subheader-height) !important;
    margin-bottom: 0 !important;
    margin-top: var(--header-height-desktop) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    box-shadow: var(--shadow) !important;
}

/* Contenedor principal con padding por headers fijos */
.main-content {
    margin-top: calc(var(--header-height-desktop) + var(--subheader-height)) !important;
    min-height: calc(100vh - var(--header-height-desktop) - var(--subheader-height)) !important;
}

/* ========================================
   UTILIDADES RESPONSIVAS GENERALES MEJORADAS
   ======================================== */

/* Contenedores responsivos mejorados */
.container-responsive {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.container-fluid-responsive {
    width: 100%;
    padding: 0 var(--container-padding);
}

/* Grid responsivo avanzado */
.grid-responsive {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.grid-2-cols {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3-cols {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4-cols {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Flexbox utilities mejoradas */
.flex-responsive {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.flex-center {
    justify-content: center;
    align-items: center;
}

.flex-between {
    justify-content: space-between;
    align-items: center;
}

.flex-column-mobile {
    flex-direction: column;
}

@media (min-width: 768px) {
    .flex-column-mobile {
        flex-direction: row;
    }
}

/* Texto responsivo mejorado */
.text-responsive {
    font-size: clamp(0.875rem, 2.5vw, 1.125rem);
    line-height: 1.6;
}

.text-small {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.text-large {
    font-size: clamp(1.125rem, 3vw, 1.25rem);
}

.heading-responsive {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1rem;
}

.heading-section {
    font-size: clamp(1.25rem, 3.5vw, 2rem);
    line-height: 1.3;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.heading-card {
    font-size: clamp(1.125rem, 3vw, 1.5rem);
    line-height: 1.4;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Botones responsivos mejorados */
.btn-responsive {
    padding: clamp(10px, 2.5vw, 14px) clamp(20px, 4vw, 28px);
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    font-weight: 500;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px; /* Mínimo para touch */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
}

.btn-primary {
    background-color: var(--imss-purple);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #4d0026;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--imss-gold);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #8b6a23;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background-color: var(--imss-green);
    color: var(--white);
}

.btn-success:hover {
    background-color: #234530;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background-color: transparent;
    color: var(--imss-purple);
    border: 2px solid var(--imss-purple);
}

.btn-outline:hover {
    background-color: var(--imss-purple);
    color: var(--white);
}

/* Botones de tamaño */
.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
    min-height: 36px;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.125rem;
    min-height: 52px;
}

.btn-full-width {
    width: 100%;
    justify-content: center;
}

/* Imágenes responsivas */
.img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   BREAKPOINTS ESPECÍFICOS MEJORADOS
   ======================================== */

/* MÓVILES EXTRA PEQUEÑOS (hasta 375px) */
@media (max-width: 375px) {
    :root {
        --container-padding: 10px;
        --section-padding: 1rem;
    }
    
    .header-principal {
        min-height: 55px !important;
    }
    
    .sub-navbar {
        min-height: 48px !important;
        margin-top: 55px !important;
    }
    
    .main-content {
        margin-top: 103px !important; /* 55 + 48 */
    }
    
    .btn-responsive {
        padding: 8px 12px;
        font-size: 0.875rem;
        min-height: 40px;
    }
    
    .heading-responsive {
        font-size: 1.25rem;
    }
}

/* MÓVILES PEQUEÑOS (376px - 575px) */
@media (min-width: 376px) and (max-width: 575px) {
    :root {
        --container-padding: 12px;
        --section-padding: 1.25rem;
    }
    
    .header-principal {
        min-height: var(--header-height-mobile) !important;
    }
    
    .sub-navbar {
        margin-top: var(--header-height-mobile) !important;
    }
    
    .main-content {
        margin-top: calc(var(--header-height-mobile) + var(--subheader-height)) !important;
    }
    
    html {
        font-size: 15px;
    }
    
    .grid-responsive {
        gap: 0.75rem;
    }
    
    .flex-responsive {
        gap: 0.75rem;
    }
    
    /* Navegación móvil */
    .navbar-responsive {
        padding: 0.5rem 0;
    }
    
    .navbar-brand-responsive {
        font-size: 0.875rem;
    }
    
    .navbar-nav-responsive {
        flex-direction: column;
        width: 100%;
        background: var(--white);
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        margin-top: 0.5rem;
        display: none; /* Oculto por defecto */
    }
    
    .navbar-nav-responsive.show {
        display: flex;
    }
    
    .navbar-nav-responsive li {
        width: 100%;
        border-bottom: 1px solid #e9ecef;
    }
    
    .navbar-nav-responsive li:last-child {
        border-bottom: none;
    }
    
    .navbar-nav-responsive a {
        padding: 1rem;
        display: block;
        width: 100%;
        color: var(--text-color);
        text-decoration: none;
        transition: var(--transition);
    }
    
    .navbar-nav-responsive a:hover {
        background-color: var(--bg-color);
        color: var(--imss-purple);
    }
    
    /* Formularios móviles */
    .form-responsive {
        padding: 1rem;
        background: var(--white);
        border-radius: var(--border-radius-lg);
        box-shadow: var(--shadow);
        margin: 1rem 0;
    }
    
    .form-group-responsive {
        margin-bottom: 1.25rem;
    }
    
    .form-control-responsive {
        width: 100%;
        padding: 0.875rem;
        font-size: 1rem;
        border: 2px solid #e0e0e0;
        border-radius: var(--border-radius);
        min-height: 48px;
        transition: var(--transition);
    }
    
    .form-control-responsive:focus {
        border-color: var(--imss-purple);
        outline: none;
        box-shadow: 0 0 0 3px rgba(102, 0, 51, 0.1);
    }
    
    .form-label-responsive {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: var(--text-color);
    }
    
    /* Cards móviles */
    .card-responsive {
        margin: 0.5rem 0;
        padding: 1.25rem;
        background: var(--white);
        border-radius: var(--border-radius-lg);
        box-shadow: var(--shadow);
        transition: var(--transition);
    }
    
    .card-responsive:hover {
        box-shadow: var(--shadow-lg);
        transform: translateY(-2px);
    }
    
    /* Espaciado móvil */
    .section-responsive {
        padding: var(--section-padding) 0;
    }
    
    .mb-responsive {
        margin-bottom: 1rem;
    }
    
    .mt-responsive {
        margin-top: 1rem;
    }
    
    /* Texto móvil optimizado */
    .text-center-mobile {
        text-align: center;
    }
    
    .text-left-mobile {
        text-align: left;
    }
}

/* MÓVILES GRANDES Y PHABLETS (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    :root {
        --container-padding: 15px;
        --section-padding: 1.5rem;
    }
    
    .grid-responsive {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1rem;
    }
    
    .container-responsive {
        max-width: 540px;
    }
    
    .section-responsive {
        padding: 2rem 0;
    }
    
    .card-responsive {
        margin: 0.75rem 0;
        padding: 1.5rem;
    }
    
    /* Navegación horizontal en tablets pequeños */
    .navbar-nav-responsive {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .navbar-nav-responsive li {
        width: auto;
        flex: 0 0 auto;
    }
    
    .navbar-nav-responsive a {
        padding: 0.75rem 1rem;
        border-radius: var(--border-radius);
        background: rgba(102, 0, 51, 0.1);
    }
}

/* TABLETS (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    :root {
        --container-padding: 20px;
        --section-padding: 2rem;
    }
    
    .grid-responsive {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.25rem;
    }
    
    .container-responsive {
        max-width: 720px;
    }
    
    .section-responsive {
        padding: 3rem 0;
    }
    
    /* Navegación tablet */
    .navbar-nav-responsive {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
        background: none;
        box-shadow: none;
        margin-top: 0;
        display: flex;
    }
    
    .navbar-nav-responsive li {
        width: auto;
        border: none;
    }
    
    .navbar-nav-responsive a {
        padding: 0.5rem 1rem;
        background: rgba(255, 255, 255, 0.1);
        color: var(--white);
        border-radius: var(--border-radius);
    }
    
    .navbar-nav-responsive a:hover {
        background: rgba(255, 255, 255, 0.2);
        color: var(--white);
    }
    
    /* Formularios tablet */
    .form-responsive {
        padding: 2rem;
        max-width: 600px;
        margin: 2rem auto;
    }
    
    .form-control-responsive {
        padding: 1rem;
        font-size: 1rem;
    }
    
    /* Cards tablet */
    .card-responsive {
        padding: 2rem;
        margin: 1rem 0;
    }
    
    /* Grid de 2 y 3 columnas en tablet */
    .grid-2-cols-tablet {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3-cols-tablet {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Texto optimizado tablet */
    .heading-responsive {
        font-size: clamp(1.75rem, 4vw, 2.25rem);
    }
    
    .text-responsive {
        font-size: 1rem;
    }
}

/* DESKTOP PEQUEÑO (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    :root {
        --container-padding: 25px;
        --section-padding: 3rem;
    }
    
    .grid-responsive {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    .container-responsive {
        max-width: 960px;
    }
    
    .section-responsive {
        padding: 4rem 0;
    }
    
    /* Navegación desktop */
    .navbar-nav-responsive {
        flex-direction: row;
        justify-content: flex-end;
        gap: 0;
        align-items: center;
    }
    
    .navbar-nav-responsive li {
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav-responsive li:first-child {
        border-left: none;
    }
    
    .navbar-nav-responsive a {
        padding: 1rem 1.5rem;
        background: none;
        color: var(--white);
        border-radius: 0;
        transition: var(--transition);
    }
    
    .navbar-nav-responsive a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--white);
    }
    
    /* Formularios desktop */
    .form-responsive {
        padding: 2.5rem;
        max-width: 700px;
        margin: 3rem auto;
        box-shadow: var(--shadow-lg);
    }
    
    .form-group-responsive {
        margin-bottom: 1.5rem;
    }
    
    .form-control-responsive {
        padding: 1.125rem;
        font-size: 1rem;
    }
    
    /* Cards desktop */
    .card-responsive {
        padding: 2.5rem;
        margin: 1.5rem 0;
    }
    
    /* Grid específicos desktop */
    .grid-4-cols-desktop {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .grid-5-cols-desktop {
        grid-template-columns: repeat(5, 1fr);
    }
    
    /* Hover effects desktop */
    .btn-responsive:hover {
        transform: translateY(-3px);
    }
    
    .card-responsive:hover {
        transform: translateY(-5px);
    }
}

/* DESKTOP GRANDE (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    :root {
        --container-padding: 30px;
        --section-padding: 4rem;
    }
    
    .grid-responsive {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 2rem;
    }
    
    .container-responsive {
        max-width: 1140px;
    }
    
    .section-responsive {
        padding: 5rem 0;
    }
    
    .form-responsive {
        padding: 3rem;
        max-width: 800px;
        margin: 4rem auto;
    }
    
    .card-responsive {
        padding: 3rem;
        margin: 2rem 0;
    }
    
    /* Grid extenso */
    .grid-6-cols-xl {
        grid-template-columns: repeat(6, 1fr);
    }
    
    /* Tipografía grande */
    .heading-responsive {
        font-size: clamp(2rem, 4vw, 2.75rem);
    }
    
    .text-responsive {
        font-size: 1.125rem;
    }
}

/* DESKTOP EXTRA GRANDE (1400px+) */
@media (min-width: 1400px) {
    :root {
        --container-padding: 40px;
        --section-padding: 5rem;
    }
    
    .container-responsive {
        max-width: 1320px;
    }
    
    .section-responsive {
        padding: 6rem 0;
    }
    
    .grid-responsive {
        gap: 2.5rem;
    }
    
    .form-responsive {
        padding: 4rem;
        max-width: 900px;
        margin: 5rem auto;
    }
    
    .card-responsive {
        padding: 4rem;
        margin: 3rem 0;
    }
    
    /* Efectos avanzados para pantallas grandes */
    .card-responsive:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    }
    
    .btn-responsive:hover {
        transform: translateY(-4px) scale(1.05);
    }
    
    /* Animaciones suaves */
    .fade-in-up {
        animation: fadeInUp 0.8s ease-out;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ========================================
   MEJORAS PARA DISPOSITIVOS TÁCTILES
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    /* Aumentar área de toque para elementos interactivos */
    .btn-responsive,
    .form-control-responsive,
    .navbar-nav-responsive a {
        min-height: 44px;
    }
    
    /* Mejorar espaciado entre elementos táctiles */
    .btn-responsive + .btn-responsive {
        margin-top: 0.5rem;
    }
    
    /* Aumentar padding para mejor usabilidad */
    .form-control-responsive {
        padding: 1rem;
    }
}

/* ========================================
   ORIENTACIÓN ESPECÍFICA
   ======================================== */

/* Móviles en orientación horizontal */
@media (max-width: 767px) and (orientation: landscape) {
    .section-responsive {
        padding: 1rem 0;
    }
    
    .navbar-responsive {
        padding: 0.25rem 0;
    }
    
    .form-responsive {
        padding: 0.75rem;
    }
    
    .card-responsive {
        padding: 0.75rem;
        margin: 0.25rem;
    }
}

/* ========================================
   UTILIDADES DE VISIBILIDAD RESPONSIVA
   ======================================== */

/* Ocultar en móviles */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Ocultar en tablets */
@media (min-width: 768px) and (max-width: 991px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Ocultar en desktop */
@media (min-width: 992px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Mostrar solo en móviles */
@media (min-width: 768px) {
    .show-mobile-only {
        display: none !important;
    }
}

/* Mostrar solo en desktop */
@media (max-width: 991px) {
    .show-desktop-only {
        display: none !important;
    }
}

/* ========================================
   MEJORAS DE ACCESIBILIDAD
   ======================================== */

/* Enfoques visibles mejorados */
.btn-responsive:focus,
.form-control-responsive:focus,
.navbar-nav-responsive a:focus {
    outline: 2px solid var(--imss-gold);
    outline-offset: 2px;
}

/* Reducir animaciones para usuarios con preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Modo alto contraste */
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    
    .btn-responsive {
        border: 2px solid currentColor;
    }
    
    .form-control-responsive {
        border-width: 2px;
    }
}

/* ========================================
   COMPONENTES ESPECÍFICOS RESPONSIVOS
   ======================================== */

/* Logo responsivo */
.logo-responsive {
    height: clamp(30px, 5vw, 50px);
    width: auto;
}

/* Navegación hamburguesa */
.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background-color: currentColor;
    margin: 2px 0;
    transition: 0.3s;
}

@media (max-width: 767px) {
    .hamburger-menu {
        display: flex;
    }
}

/* Tables responsivas */
.table-responsive-custom {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
    .table-responsive-custom table {
        font-size: 0.875rem;
    }
    
    .table-responsive-custom th,
    .table-responsive-custom td {
        padding: 0.5rem;
        white-space: nowrap;
    }
}

/* ========================================
   LOADING Y ESTADOS
   ======================================== */

/* Skeleton loading responsivo */
.skeleton-responsive {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--border-radius);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Estados de error responsivos */
.error-responsive {
    padding: 1rem;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.success-responsive {
    padding: 1rem;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.warning-responsive {
    padding: 1rem;
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.info-responsive {
    padding: 1rem;
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

@media (max-width: 575px) {
    .error-responsive,
    .success-responsive,
    .warning-responsive,
    .info-responsive {
        padding: 0.75rem;
        font-size: 0.875rem;
        margin: 0.75rem 0;
    }
}

/* ========================================
   ALINEACIÓN ESPECÍFICA PARA SECCIONES PRINCIPALES
   ======================================== */

/* Contenedor principal para alineación perfecta */
.seccion-alineada {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Publicaciones Recientes - Header */
.publicaciones-header {
    background-color: var(--imss-purple);
    color: var(--white);
    padding: 1rem 1.5rem;
    margin: 0;
    border-radius: 8px 8px 0 0;
    font-size: 1.125rem;
    font-weight: 600;
    border-left: 4px solid var(--imss-gold);
    border-right: 1px solid #e9ecef;
    border-top: 1px solid #e9ecef;
}

/* Contenido SIEFORE - Cuerpo */
.siefore-contenido {
    background-color: var(--white);
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 1.5rem;
    margin: 0;
    box-shadow: var(--shadow);
}

/* Asegurar que los bordes laterales estén perfectamente alineados */
.publicaciones-header,
.siefore-contenido {
    box-sizing: border-box;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Grid para elementos SIEFORE */
.siefore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
}

/* Items individuales de SIEFORE */
.siefore-item {
    background: var(--bg-color);
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: var(--transition);
    margin: 0;
}

.siefore-item:hover {
    border-color: var(--imss-purple);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.siefore-item h4 {
    color: var(--imss-purple);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.siefore-item p {
    color: var(--text-color);
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
}

/* ========================================
   RESPONSIVIDAD PARA ALINEACIÓN PERFECTA
   ======================================== */

/* MÓVILES (hasta 767px) */
@media (max-width: 767px) {
    .seccion-alineada {
        margin: 0 10px;
        max-width: calc(100% - 20px);
    }
    
    .publicaciones-header {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        border-radius: 6px 6px 0 0;
    }
    
    .siefore-contenido {
        padding: 1rem;
        border-radius: 0 0 6px 6px;
    }
    
    .siefore-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .siefore-item {
        padding: 0.875rem;
    }
    
    .siefore-item h4 {
        font-size: 0.925rem;
    }
    
    .siefore-item p {
        font-size: 0.8rem;
    }
}

/* TABLETS (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .seccion-alineada {
        margin: 0 20px;
        max-width: calc(100% - 40px);
    }
    
    .publicaciones-header {
        padding: 1rem 1.25rem;
        font-size: 1.0625rem;
    }
    
    .siefore-contenido {
        padding: 1.25rem;
    }
    
    .siefore-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* DESKTOP (992px+) */
@media (min-width: 992px) {
    .seccion-alineada {
        margin: 0 auto;
        max-width: 1200px;
        padding: 0 25px;
    }
    
    .publicaciones-header {
        padding: 1.125rem 1.5rem;
        font-size: 1.125rem;
    }
    
    .siefore-contenido {
        padding: 1.75rem;
    }
    
    .siefore-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
    
    .siefore-item {
        padding: 1.25rem;
    }
}

/* DESKTOP GRANDE (1200px+) */
@media (min-width: 1200px) {
    .siefore-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
    
    .siefore-contenido {
        padding: 2rem;
    }
}

/* ========================================
   COMPONENTES ESPECÍFICOS IMSS
   ======================================== */

/* Header con logo IMSS */
.imss-header {
    background: linear-gradient(135deg, var(--imss-purple), #4d0026);
    color: var(--white);
    padding: 1rem 0;
}

.imss-logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.imss-logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1); /* Hacer logo blanco */
}

@media (max-width: 767px) {
    .imss-logo {
        height: 32px;
    }
    
    .imss-logo-container {
        gap: 10px;
    }
}

/* Subheader dorado */
.imss-subheader {
    background: linear-gradient(135deg, var(--imss-gold-alt), #9a7209);
    color: var(--white);
    padding: 0.75rem 0;
}

/* Navegación breadcrumb IMSS */
.imss-breadcrumb {
    background: var(--bg-color);
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.breadcrumb-responsive {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.breadcrumb-responsive a {
    color: var(--imss-purple);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-responsive a:hover {
    color: var(--imss-gold);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-light);
}

@media (max-width: 575px) {
    .breadcrumb-responsive {
        font-size: 0.75rem;
        gap: 0.25rem;
    }
}

/* Formulario IMSS */
.imss-form {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.imss-form-header {
    background: var(--imss-green);
    color: var(--white);
    padding: 1.5rem;
    text-align: center;
}

.imss-form-body {
    padding: 2rem;
}

.imss-form-footer {
    background: var(--bg-color);
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

@media (max-width: 767px) {
    .imss-form-header,
    .imss-form-body,
    .imss-form-footer {
        padding: 1rem;
    }
}

/* Comprobante oficial */
.comprobante-oficial {
    background: var(--white);
    border: 2px solid var(--imss-green);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    max-width: 600px;
    margin: 2rem auto;
    box-shadow: var(--shadow-lg);
}

.comprobante-header {
    background: var(--imss-green);
    color: var(--white);
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.comprobante-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--imss-green);
}

.comprobante-body {
    padding: 2rem;
}

.comprobante-folio {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    text-align: center;
    font-weight: bold;
    color: var(--imss-purple);
}

@media (max-width: 767px) {
    .comprobante-oficial {
        margin: 1rem;
        max-width: none;
    }
    
    .comprobante-header,
    .comprobante-body {
        padding: 1rem;
    }
}

/* Botones específicos IMSS */
.btn-imss-primary {
    background: linear-gradient(135deg, var(--imss-purple), #4d0026);
    color: var(--white);
    border: none;
    font-weight: 600;
}

.btn-imss-primary:hover {
    background: linear-gradient(135deg, #4d0026, var(--imss-purple));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 0, 51, 0.3);
}

.btn-imss-secondary {
    background: linear-gradient(135deg, var(--imss-gold), #6d5000);
    color: var(--white);
    border: none;
    font-weight: 600;
}

.btn-imss-secondary:hover {
    background: linear-gradient(135deg, #6d5000, var(--imss-gold));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(164, 126, 44, 0.3);
}

/* Cards institucionales */
.card-institucional {
    background: var(--white);
    border-left: 4px solid var(--imss-purple);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin: 1rem 0;
    transition: var(--transition);
}

.card-institucional:hover {
    border-left-color: var(--imss-gold);
    box-shadow: var(--shadow-lg);
    transform: translateX(5px);
}

.card-institucional h3 {
    color: var(--imss-purple);
    margin-bottom: 0.5rem;
}

@media (max-width: 767px) {
    .card-institucional {
        padding: 1rem;
        margin: 0.75rem 0;
    }
}

/* Footer IMSS */
.imss-footer {
    background: var(--imss-purple);
    color: var(--white);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.imss-footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.imss-footer-section h4 {
    color: var(--imss-gold);
    margin-bottom: 1rem;
}

.imss-footer-section a {
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
}

.imss-footer-section a:hover {
    color: var(--imss-gold);
}

.imss-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
    padding-top: 1rem;
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.8;
}

@media (max-width: 767px) {
    .imss-footer {
        padding: 2rem 0 1.5rem;
        margin-top: 2rem;
    }
    
    .imss-footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
}

/* Loading spinner IMSS */
.imss-spinner {
    border: 4px solid rgba(102, 0, 51, 0.1);
    border-left: 4px solid var(--imss-purple);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Indicadores de estado */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-approved {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-processing {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Animaciones de entrada para móvil */
@media (max-width: 767px) {
    .animate-mobile-in {
        animation: mobileSlideIn 0.5s ease-out;
    }
    
    @keyframes mobileSlideIn {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ========================================
   UTILIDADES PARA ALINEACIÓN PERFECTA
   ======================================== */

/* Forzar alineación de bordes */
.borde-alineado {
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Contenedor que mantiene ancho consistente */
.ancho-consistente {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding-left: var(--container-padding) !important;
    padding-right: var(--container-padding) !important;
}

/* Eliminar gaps no deseados entre secciones */
.sin-gap-vertical {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Alineación horizontal perfecta */
.alineacion-horizontal {
    display: block !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Contenedor padre para secciones conectadas */
.secciones-conectadas {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

/* Reset para elementos internos */
.secciones-conectadas * {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Específico para publicaciones y contenido */
.publicaciones-siefore-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 var(--container-padding);
    gap: 0;
}

.publicaciones-siefore-container .publicaciones-header {
    border-bottom: none;
    margin-bottom: 0;
}

.publicaciones-siefore-container .siefore-contenido {
    border-top: none;
    margin-top: 0;
}

/* Override para mantener consistencia visual */
@media (max-width: 575px) {
    .publicaciones-siefore-container {
        margin: 1rem 10px;
        padding: 0;
    }
}

@media (min-width: 576px) and (max-width: 991px) {
    .publicaciones-siefore-container {
        margin: 1.5rem 20px;
        padding: 0;
    }
}

@media (min-width: 992px) {
    .publicaciones-siefore-container {
        margin: 2rem auto;
        padding: 0 25px;
    }
}

/* ========================================
   DEBUG PARA ALINEACIÓN (solo desarrollo)
   ======================================== */

/* Activar con clase .debug-alignment en body */
.debug-alignment .publicaciones-header,
.debug-alignment .siefore-contenido {
    position: relative;
    outline: 2px solid red;
    outline-offset: -1px;
}

.debug-alignment .publicaciones-header::before,
.debug-alignment .siefore-contenido::before {
    content: attr(class);
    position: absolute;
    top: -20px;
    left: 0;
    background: red;
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    z-index: 9999;
}

.debug-alignment .seccion-alineada {
    outline: 3px solid blue;
    outline-offset: -1px;
}

.debug-alignment .seccion-alineada::before {
    content: "Sección Alineada";
    position: absolute;
    top: -25px;
    right: 0;
    background: blue;
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    z-index: 9999;
}

/* Print styles para comprobantes */
@media print {
    .no-print {
        display: none !important;
    }
    
    .comprobante-oficial {
        box-shadow: none;
        border: 2px solid #000;
        break-inside: avoid;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .imss-header,
    .imss-subheader,
    .imss-footer {
        background: white !important;
        color: black !important;
    }
}
