/* ==========================================================================
   SISTEMA DE DISEÑO - SIIMP (REDISENO GLASSMORPHISM)
   ========================================================================== */

:root {
    /* Paleta de Colores Principal */
    --color-bg-start: #0b0f19;
    --color-bg-end: #111827;
    --color-accent: #3b82f6;       /* Azul eléctrico */
    --color-accent-glow: rgba(59, 130, 246, 0.4);
    
    /* Semáforo de Compatibilidades */
    --color-success: #10b981;      /* Verde esmeralda */
    --color-success-bg: #d1fae5;
    --color-success-text: #065f46;
    
    --color-warning: #f59e0b;      /* Ámbar dorado */
    --color-warning-bg: #fef3c7;
    --color-warning-text: #92400e;
    
    --color-danger: #ef4444;       /* Rojo carmín */
    --color-danger-bg: #fee2e2;
    --color-danger-text: #991b1b;
    
    /* Glassmorphism Config */
    --glass-bg: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(12px);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    
    /* Tipografías */
    --font-titles: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Transiciones y Bordes */
    --radius-card: 16px;
    --radius-btn: 8px;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET Y ESTILOS GLOBALES
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    font-family: var(--font-body);
    background-color: var(--color-bg-start);
    color: #f3f4f6;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    /* Imagen de fondo blueprint con gradiente oscuro encima */
    background-image: linear-gradient(
        to bottom, 
        rgba(11, 15, 25, 0.88), 
        rgba(17, 24, 39, 0.94)
      ), 
      url('../assets/siimp_background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Orbes decorativos de luz (Glow Effect) */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
    mix-blend-mode: screen;
}

.orb-1 {
    top: 20%;
    left: 15%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--color-accent) 0%, rgba(59, 130, 246, 0) 70%);
}

.orb-2 {
    bottom: 15%;
    right: 10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.8) 0%, rgba(16, 185, 129, 0) 70%);
}

/* ==========================================================================
   HEADER / NAVBAR
   ========================================================================== */

.header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background: rgba(11, 15, 25, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo-siimp-header {
    font-family: var(--font-titles);
    font-size: 2.16rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -1px;
    line-height: 1;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1), 
                 0 0 30px rgba(59, 130, 246, 0.15);
    cursor: default;
    user-select: none;
}

/* Logotipo oficial de Aguascalientes */
.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.2));
}

.divider {
    height: 2.2rem;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.logo-implan {
    font-family: var(--font-titles);
    font-size: 0.95rem;
    font-weight: 600;
    color: #f59e0b; /* Naranja/oro del manual del implan */
    letter-spacing: 0.3px;
    max-width: 280px;
    line-height: 1.2;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-btn);
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-links a:hover, 
.nav-links a.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   MAIN CONTENT & HERO CONTAINER
   ========================================================================== */

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7rem 2rem 4rem 2rem;
    z-index: 10;
}

.hero-container {
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    align-items: center;
}

/* Tarjeta de Vidrio Esmerilado (Glassmorphic) */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
}

.main-portal-card {
    width: 100%;
    padding: 3.5rem 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    border-radius: 20px;
    box-shadow: var(--glass-shadow), 0 0 40px rgba(59, 130, 246, 0.08);
}

/* Glowing Border effect for hover card */
.card-glow-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    pointer-events: none;
    border: 1px solid transparent;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(59, 130, 246, 0.3) 50%, rgba(255, 255, 255, 0) 100%) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    opacity: 0.5;
    transition: var(--transition-smooth);
}

.main-portal-card:hover .card-glow-border {
    opacity: 1;
    transform: scale(1.005);
}

/* Título SiiMP */
.portal-title {
    font-family: var(--font-titles);
    font-size: 5.5rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 0.5rem;
    /* Efecto de resplandor sutil */
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.15), 
                 0 0 50px rgba(59, 130, 246, 0.1);
    animation: pulseGlow 4s ease-in-out infinite;
}

/* Subtítulo */
.portal-subtitle {
    font-size: 1.15rem;
    line-height: 1.7;
    color: #e5e7eb;
    max-width: 680px;
    font-weight: 350;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Área de acción / Botón Entrar */
.action-area {
    margin-top: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 3rem;
    font-family: var(--font-titles);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-btn);
    position: relative;
    cursor: pointer;
    transition: var(--transition-smooth);
    overflow: hidden;
}

.btn-primary {
    color: #ffffff;
    background: rgba(11, 15, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

/* Glow Border & Hover on Button */
.btn-primary:hover {
    border-color: var(--color-accent);
    box-shadow: 0 0 20px var(--color-accent-glow), 0 4px 15px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Disclaimer / Notas Legales */
.disclaimer-card {
    padding: 2rem;
    width: 100%;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #9ca3af;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-color: rgba(255, 255, 255, 0.04);
}

.disclaimer-text {
    text-align: justify;
    font-weight: 400;
}

.disclaimer-note {
    text-align: center;
    font-weight: 500;
    color: #d1d5db;
}

/* ==========================================================================
   MODAL DE CONTACTO
   ========================================================================== */

.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-modal.active {
    pointer-events: auto;
    opacity: 1;
}

.contact-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.contact-card {
    width: 90%;
    max-width: 440px;
    padding: 3rem 2.5rem;
    border-radius: 20px;
    z-index: 1001;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--glass-shadow), 0 0 50px rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-modal.active .contact-card {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    color: #ffffff;
    transform: scale(1.1);
}

.contact-title {
    font-family: var(--font-titles);
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin-bottom: 0.2rem;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.contact-web {
    display: block;
    text-align: center;
    color: var(--color-accent);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 2.5rem;
    transition: var(--transition-smooth);
}

.contact-web:hover {
    color: #ffffff;
    text-shadow: 0 0 10px var(--color-accent-glow);
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.contact-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

/* Colores de Iconos en Contacto */
.wa-icon {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--color-success);
}

.contact-item:hover .wa-icon {
    background: var(--color-success);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.tel-icon {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: var(--color-warning);
}

.contact-item:hover .tel-icon {
    background: var(--color-warning);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.citizen-icon {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: var(--color-accent);
}

.contact-item:hover .citizen-icon {
    background: var(--color-accent);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.contact-info .label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.contact-info .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.contact-info .value small {
    font-size: 0.85rem;
    color: #cbd5e1;
    font-weight: 400;
    margin-left: 0.3rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
    width: 100%;
    padding: 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: #6b7280;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
    z-index: 10;
    background: rgba(11, 15, 25, 0.2);
}

/* ==========================================================================
   ANIMACIONES
   ========================================================================== */

@keyframes pulseGlow {
    0%, 100% {
        text-shadow: 0 0 25px rgba(255, 255, 255, 0.12), 
                     0 0 50px rgba(59, 130, 246, 0.05);
    }
    50% {
        text-shadow: 0 0 35px rgba(255, 255, 255, 0.22), 
                     0 0 65px rgba(59, 130, 246, 0.2);
    }
}

@keyframes polygonPulse {
    0% {
        stroke-opacity: 0.3;
        stroke-width: 2.5;
        fill-opacity: 0.15;
    }
    50% {
        stroke-opacity: 1;
        stroke-width: 5;
        fill-opacity: 0.45;
    }
    100% {
        stroke-opacity: 0.3;
        stroke-width: 2.5;
        fill-opacity: 0.15;
    }
}

.polygon-active-pulse {
    animation: polygonPulse 2s infinite ease-in-out;
    filter: drop-shadow(0px 0px 8px rgba(255,255,255,0.4));
}

/* ==========================================================================
   CONSULTAS RESPONSIVAS
   ========================================================================== */

@media (max-width: 1100px) {
    .header {
        position: relative;
    }
    .portal-main-content {
        padding-top: 2rem;
    }
    .header-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .logo-area {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .divider {
        display: none;
    }
    
    .main-portal-card {
        padding: 2rem 1.5rem;
    }
    
    .portal-title {
        font-size: 3.5rem;
    }
    
    .portal-subtitle {
        font-size: 0.95rem;
    }

    .bottom-glass-nav {
        flex-wrap: wrap;
        justify-content: center;
        border-radius: 20px;
        padding: 0.8rem;
        width: calc(100% - 2rem);
        margin: 2rem auto;
    }

    .bottom-nav-item {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .portal-layout-row {
        flex-direction: column;
        height: auto;
    }
    
    .portal-sidebar {
        width: 100%;
        height: auto;
        gap: 0.5rem;
        padding-right: 0;
    }
    
    .portal-sidebar .glow-btn {
        padding: 10px 15px;
        margin-bottom: 0.5rem;
    }

    .portal-map-section {
        height: 500px;
        width: 100%;
    }
}



/* ==========================================================================
   ESTILOS ADICIONALES PARA PORTAL.HTML
   ========================================================================== */

.portal-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 7rem 2rem 2rem 2rem;
    z-index: 10;
}

.portal-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    align-items: center;
}

/* Grid de Tarjetas e Ítems */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.portal-item {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    align-items: center;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.program-card {
    width: 100%;
    padding: 1.5rem 1.2rem;
    text-align: center;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 85px;
    position: relative;
    overflow: hidden;
}

.program-card h3 {
    font-family: var(--font-titles);
    font-size: 0.9rem;
    font-weight: 700;
    color: #cbd5e1;
    letter-spacing: 0.5px;
    line-height: 1.4;
    transition: var(--transition-smooth);
}

/* Bordes superiores de colores temáticos */
.program-border-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    transition: var(--transition-smooth);
}

.p-red .program-border-top { background: #ef4444; }
.p-purple .program-border-top { background: #8b5cf6; }
.p-orange .program-border-top { background: #f59e0b; }
.p-blue .program-border-top { background: #0ea5e9; }

/* Efectos hover en las tarjetas a través del portal-item */
.portal-item:hover .p-red {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: var(--glass-shadow), 0 0 20px rgba(239, 68, 68, 0.25);
    transform: translateY(-3px);
}

.portal-item:hover .p-purple {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: var(--glass-shadow), 0 0 20px rgba(139, 92, 246, 0.25);
    transform: translateY(-3px);
}

.portal-item:hover .p-orange {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: var(--glass-shadow), 0 0 20px rgba(245, 158, 11, 0.25);
    transform: translateY(-3px);
}

.portal-item:hover .p-blue {
    border-color: rgba(14, 165, 233, 0.4);
    box-shadow: var(--glass-shadow), 0 0 20px rgba(14, 165, 233, 0.25);
    transform: translateY(-3px);
}

.portal-item:hover .program-card h3 {
    color: #ffffff;
}

.map-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition-smooth);
}

.map-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 180px;
}

.svg-map {
    height: 170px;
    width: auto;
    opacity: 0.8;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    transition: var(--transition-smooth);
}

/* Efectos de Iluminación Hover en los mapas a través del portal-item */
.portal-item:hover .svg-map {
    transform: scale(1.05);
    opacity: 1;
}

/* Hover Rojo */
.portal-item:hover .map-red {
    filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.85)) brightness(1.2);
}

/* Hover Morado */
.portal-item:hover .map-purple {
    filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.85)) brightness(1.25);
}

/* Hover Naranja */
.portal-item:hover .map-orange {
    filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.85)) brightness(1.25);
}

/* Hover Celeste */
.portal-item:hover .map-blue {
    filter: drop-shadow(0 0 15px rgba(14, 165, 233, 0.85)) brightness(1.2);
}

.map-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #9ca3af;
    text-align: center;
    line-height: 1.4;
    transition: var(--transition-smooth);
    max-width: 200px;
}

.portal-item:hover .map-label {
    color: #ffffff;
}

/* Branding Inferior */
.lower-branding {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.branding-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0)
    );
}

.lower-tools-text {
    font-family: var(--font-titles);
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    text-align: center;
}

/* Navegación Flotante Inferior */
.bottom-glass-nav {
    display: flex;
    gap: 0.5rem;
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    padding: 0.6rem;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow), 0 10px 30px rgba(0, 0, 0, 0.3);
    margin: -2.5rem auto 1rem auto; /* Negative top margin to pull it up towards HERRAMIENTAS */
    width: max-content;
    z-index: 10;
}

.bottom-nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.4rem;
    border-radius: 30px;
    text-decoration: none;
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.bottom-nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.b-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: inherit;
}

/* --------------------------------------------------------------------------
   Acceso destacado: Módulo de Verticalidad
   Usa la identidad del módulo (logo isométrico, Outfit, azul #3b82f6 / cian #22d3ee)
   -------------------------------------------------------------------------- */
.bottom-nav-item.nav-item-verticalidad {
    position: relative;
    gap: 0.65rem;
    padding: 0.45rem 1.4rem 0.45rem 0.9rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #f8fafc;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(34, 211, 238, 0.10));
    border: 1px solid rgba(34, 211, 238, 0.35);
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.25), inset 0 0 12px rgba(34, 211, 238, 0.08);
    overflow: hidden;
}

.nav-item-verticalidad > span {
    background: linear-gradient(135deg, #ffffff 30%, #7dd3fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Brillo que recorre el botón */
.nav-item-verticalidad::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transform: skewX(-20deg);
    animation: vertShine 4.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes vertShine {
    0%, 60% { left: -60%; }
    100% { left: 130%; }
}

.nav-item-verticalidad .vert-logo {
    position: relative;
    width: 28px;
    height: 28px;
}

.nav-item-verticalidad .vert-logo svg {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    transition: transform 0.35s ease;
}

.nav-item-verticalidad .vert-logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    background: #3b82f6;
    filter: blur(10px);
    opacity: 0.7;
    border-radius: 50%;
}

.bottom-nav-item.nav-item-verticalidad:hover {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.45), rgba(34, 211, 238, 0.18));
    border-color: rgba(34, 211, 238, 0.65);
    box-shadow: 0 0 26px rgba(59, 130, 246, 0.45), inset 0 0 14px rgba(34, 211, 238, 0.15);
    transform: translateY(-1px);
}

.nav-item-verticalidad:hover .vert-logo svg {
    transform: translateY(-2px) scale(1.08);
}

@media (max-width: 768px) {
    .bottom-nav-item.nav-item-verticalidad {
        padding: 0.4rem 1.1rem 0.4rem 0.75rem !important;
        font-size: 0.9rem !important;
    }
}

/* Media Queries específicas para la cuadrícula del portal.html (al final para correcto override) */
@media (max-width: 1024px) {
    .portal-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem;
    }
    
    .svg-map {
        height: 130px;
    }
    
    .map-wrapper {
        height: 140px;
    }
}

@media (max-width: 576px) {
    .portal-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.2rem;
    }

    .portal-item {
        gap: 1.2rem;
    }

    .program-card {
        padding: 1rem 0.8rem;
        min-height: 70px;
        border-radius: 10px;
    }

    .program-card h3 {
        font-size: 0.75rem;
    }

    .svg-map {
        height: 95px;
    }

    .map-wrapper {
        height: 105px;
    }

    .map-label {
        font-size: 0.75rem;
    }
}


/* ==========================================================================
   ESTILOS DE DETALLE DE PROGRAMA (MUNICIPIO.HTML)
   ========================================================================== */

/* Contenedor de Pestañas Superiores */
.program-tabs-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
}

.program-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 1rem;
    text-align: center;
    text-decoration: none;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
    font-family: var(--font-titles);
    font-size: 0.85rem;
    font-weight: 700;
    color: #cbd5e1;
    letter-spacing: 0.5px;
    line-height: 1.3;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    min-height: 75px;
}

.tab-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    transition: var(--transition-smooth);
}

.p-red .tab-indicator { background: #ef4444; }
.p-purple .tab-indicator { background: #8b5cf6; }
.p-orange .tab-indicator { background: #f59e0b; }
.p-blue .tab-indicator { background: #0ea5e9; }

/* Efectos Hover y Activos para las Pestañas */
.program-tab:hover:not(.disabled-tab) {
    transform: translateY(-2px);
    color: #ffffff;
}

.program-tab.active.p-red {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: var(--glass-shadow), 0 0 20px rgba(239, 68, 68, 0.25);
    color: #ffffff;
    background: rgba(239, 68, 68, 0.08);
}

.program-tab:hover.p-red:not(.disabled-tab) {
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: var(--glass-shadow), 0 0 15px rgba(239, 68, 68, 0.15);
}

.disabled-tab {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Diseño de Grid Detallado */
.detail-grid-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    width: 100%;
    margin-top: 0.5rem;
}

.section-card {
    padding: 2rem;
    border-color: rgba(255, 255, 255, 0.05);
}

.detail-column-left {
    height: 100%;
}

.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1rem;
    margin-bottom: 1.8rem;
}

.section-card-header h2 {
    font-family: var(--font-titles);
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.section-card-header .header-icon {
    color: #ef4444; /* Rojo temático del Municipio */
    display: flex;
    align-items: center;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.5));
}

/* Columna de Capas Cartográficas */
.layer-buttons-list {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.layer-item-btn {
    text-decoration: none;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1.1rem 1.4rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    color: #cbd5e1;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.layer-item-btn:hover {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ffffff;
    transform: translateX(6px);
}

.layer-item-btn.active {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}

.layer-icon-span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    margin-right: 1.2rem;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.layer-item-btn:hover .layer-icon-span {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    transform: scale(1.05);
}

.layer-arrow {
    margin-left: auto;
    font-size: 1.1rem;
    color: #4b5563;
    transition: var(--transition-smooth);
}

.layer-item-btn:hover .layer-arrow {
    color: #ef4444;
    transform: translateX(4px);
}

/* Columna Derecha (Pila vertical) */
.detail-column-right {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Descargas Grid */
.downloads-flex-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.download-card-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: #cbd5e1;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.download-card-item:hover {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ffffff;
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.1);
}

.dl-icon-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
    color: #ef4444;
    position: relative;
    transition: var(--transition-smooth);
}

.download-card-item:hover .dl-icon-wrapper {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.poe-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #ffffff;
    font-family: var(--font-titles);
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 4px;
    border: 1px solid #111827;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    transition: var(--transition-smooth);
}

.download-card-item:hover .poe-badge {
    background: #ffffff;
    color: #ef4444;
    border-color: #ef4444;
}

.dl-title {
    font-family: var(--font-titles);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 0.4rem;
}

.dl-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

.download-card-item:hover .dl-meta {
    color: #a1a1aa;
}

/* Spinner y Estados de Descarga */
.spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 15, 25, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.download-card-item.loading .spinner-overlay {
    opacity: 1;
    pointer-events: auto;
}

.download-card-item.loading .spinner-overlay::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid rgba(239, 68, 68, 0.2);
    border-top-color: #ef4444;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.download-card-item.success .dl-icon-wrapper {
    background: var(--color-success) !important;
    color: #ffffff !important;
    border-color: var(--color-success) !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4) !important;
}

/* Consultas Layout */
.queries-container {
    display: flex;
    flex-direction: column;
}

.query-card-item {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    width: 100%;
    padding: 1.2rem 1.6rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: #cbd5e1;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    text-decoration: none;
}

.query-card-item:hover {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.1);
}

.query-icon-wrapper {
    width: 58px;
    height: 58px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.query-card-item:hover .query-icon-wrapper {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.query-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-width: 80%;
}

.query-title {
    font-family: var(--font-titles);
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
}

.query-description {
    font-size: 0.8rem;
    color: #9ca3af;
    line-height: 1.45;
}

.query-card-item:hover .query-description {
    color: #cbd5e1;
}

.query-arrow {
    margin-left: auto;
    font-size: 1.3rem;
    color: #4b5563;
    transition: var(--transition-smooth);
}

.query-card-item:hover .query-arrow {
    color: #ef4444;
    transform: translateX(5px);
}

/* Panel Lateral (Drawer) de Metadatos */
.layer-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 420px;
    height: 100vh;
    z-index: 1000;
    display: flex;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.layer-drawer.active {
    right: 0;
}

.layer-drawer-overlay {
    position: absolute;
    top: 0;
    left: -100vw;
    width: 100vw;
    height: 100%;
    background: rgba(11, 15, 25, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.layer-drawer.active .layer-drawer-overlay {
    opacity: 1;
    pointer-events: auto;
}

.layer-drawer-content {
    width: 420px;
    height: 100%;
    border-radius: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-top: none;
    border-bottom: none;
    border-right: none;
    padding: 3.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1001;
}

.drawer-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
}

.drawer-close:hover {
    color: #ffffff;
    transform: scale(1.1);
}

.drawer-title-heading {
    font-family: var(--font-titles);
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1rem;
}

.drawer-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    overflow-y: auto;
}

.meta-item-card {
    padding: 1rem 1.2rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.meta-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.meta-value {
    font-family: var(--font-titles);
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
}

.meta-value-text {
    font-size: 0.85rem;
    color: #9ca3af;
    line-height: 1.55;
}

.drawer-footer {
    margin-top: auto;
}

.btn-full-width {
    width: 100%;
    gap: 0.8rem;
}

/* Modal y Resultados de Compatibilidad */
.compatibility-card {
    width: 95%;
    max-width: 580px;
    padding: 3rem 2.5rem;
    border-radius: 20px;
    z-index: 1001;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--glass-shadow), 0 0 50px rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.compatibility-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: #9ca3af;
    margin-top: 0.3rem;
}

.comp-search-wrapper {
    position: relative;
    width: 100%;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

#comp-search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

#comp-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    border-color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

.comp-search-wrapper .search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    display: flex;
    align-items: center;
}

#comp-search-input:focus ~ .search-icon {
    color: #ef4444;
}

.comp-results-area {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-right: 0.5rem;
}

.comp-results-area::-webkit-scrollbar {
    width: 6px;
}

.comp-results-area::-webkit-scrollbar-track {
    background: transparent;
}

.comp-results-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.comp-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    color: #6b7280;
    text-align: center;
    padding: 2rem 0;
    font-size: 0.9rem;
}

.comp-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.4rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-smooth);
}

.comp-result-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.comp-result-name {
    font-weight: 500;
    color: #ffffff;
    font-size: 0.95rem;
}

.comp-badge {
    font-family: var(--font-titles);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.8rem;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-permitido {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-condicionado {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-prohibido {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}


/* Media Queries para Detalle */
@media (max-width: 1024px) {
    .detail-grid-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .program-tabs-container {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    .program-tab {
        min-height: 60px;
    }
    .downloads-flex-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    .layer-drawer {
        width: 100%;
        right: -100%;
    }
    .layer-drawer-content {
        width: 100%;
    }
}


/* ==========================================================================
   ESTILOS DE VISOR CARTOGRÁFICO (ZONIFICACION.HTML)
   ========================================================================== */

.map-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.btn-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #ef4444;
    text-decoration: none;
    font-family: var(--font-titles);
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.05);
    padding: 0.55rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
}

.btn-back-link:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.35);
    transform: translateX(-3px);
}

.btn-back-link svg {
    transition: var(--transition-smooth);
}

.btn-back-link:hover svg {
    transform: translateX(-3px);
}

.map-page-title {
    font-family: var(--font-titles);
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-align: center;
}

.btn-fullscreen-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    padding: 0.55rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-titles);
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-fullscreen-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Contenedor del Visor de Mapas */
.map-viewer-card {
    width: 100%;
    height: 600px;
    padding: 0;
    border-color: rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    box-shadow: var(--glass-shadow), 0 10px 40px rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.arcgis-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: inherit;
    background: #1a1e29;
}

/* Pantalla de Carga Customizada del Mapa */
.map-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    gap: 1rem;
    color: #ffffff;
    transition: opacity 0.4s ease;
}

.loader-circle-spinner {
    width: 44px;
    height: 44px;
    border: 3.5px solid rgba(239, 68, 68, 0.15);
    border-top-color: #ef4444;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.loader-text {
    font-family: var(--font-titles);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.loader-subtext {
    font-size: 0.8rem;
    color: #6b7280;
    letter-spacing: 0.5px;
}

/* Modo Pantalla Completa */
.map-viewer-card.fullscreen-map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    border: none;
}

/* Media Queries para Visor */
@media (max-width: 768px) {
    .portal-container {
        display: flex;
        flex-direction: column;
    }

    .map-viewer-card {
        height: 450px;
        order: 1; /* El mapa va primero en la parte superior */
    }

    .map-title-row {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        order: 2; /* El título y botones van debajo del mapa */
    }
    
    .map-page-title {
        font-size: 1.4rem;
        order: -1;
    }
    
    .btn-back-link,
    .btn-fullscreen-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .program-tabs-container {
        order: 3; /* Las pestañas van debajo del título */
    }

    .lower-branding {
        order: 4;
    }

    .bottom-glass-nav {
        order: 5;
    }
}

.btn-exit-fullscreen {
    display: none; /* Oculto por defecto en modo normal */
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 101; /* Mayor z-index que el loader y el iframe */
    background: rgba(11, 15, 25, 0.9) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    color: #ffffff !important;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3), 0 4px 12px rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* En pantalla completa se muestra como fixed y con alto z-index para sobreponerse a la barra superior */
.map-viewer-card.fullscreen-map .btn-exit-fullscreen {
    display: flex;
    position: fixed;
    z-index: 10001; /* Por encima de la barra superior (header z-index: 100) */
    top: 1.35rem; /* Alineado verticalmente con el contenido del header */
    right: 2rem; /* Alineado horizontalmente con el padding del header */
}

.btn-exit-fullscreen:hover {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    transform: scale(1.08);
}

/* ==========================================================================
   TEMA DE COLOR NARANJA - PROGRAMA DE LA CIUDAD (.theme-orange)
   ========================================================================== */
.theme-orange .section-card-header .header-icon {
    color: #f59e0b;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
}

.theme-orange .layer-icon-span {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.theme-orange .layer-item-btn:hover {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.3);
    color: #ffffff;
}

.theme-orange .layer-item-btn:hover .layer-icon-span {
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.theme-orange .layer-item-btn:hover .layer-arrow {
    color: #f59e0b;
}

.theme-orange .download-card-item:hover {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.1);
}

.theme-orange .dl-icon-wrapper {
    color: #f59e0b;
}

.theme-orange .download-card-item:hover .dl-icon-wrapper {
    background: #f59e0b;
}

.theme-orange .poe-badge {
    background: #f59e0b;
}

.theme-orange .download-card-item:hover .poe-badge {
    color: #f59e0b;
}

.theme-orange .query-card-item:hover {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.1);
}

.theme-orange .query-icon-wrapper {
    color: #f59e0b;
}

.theme-orange .query-card-item:hover .query-icon-wrapper {
    background: #f59e0b;
}

.theme-orange .query-card-item:hover .query-arrow {
    color: #f59e0b;
}



/* REFOM Map Styles */
.refom-map-wrapper {
    margin-top: 1rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.refom-map-header {
    margin-bottom: 2rem;
}

.refom-map-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    color: #f8fafc;
    margin-bottom: 0.5rem;
}

.refom-map-header p {
    color: #94a3b8;
    font-size: 1.1rem;
}

.refom-svg-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.refom-svg-container svg {
    filter: drop-shadow(0 10px 25px rgba(0,0,0,0.5));
}

/* ==========================================================================
   ESTILOS DE REDISEÑO DEL PORTAL: MAPA INTERACTIVO
   ========================================================================== */

/* Barra de selección superior (Pestañas) */
.portal-selector-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    width: 100%;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.selector-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    font-family: var(--font-titles);
    font-size: 0.85rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.5px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    min-width: 200px;
    box-shadow: var(--glass-shadow);
}

.btn-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    transition: var(--transition-smooth);
}

/* Colores temáticos para botones de selección */
.selector-btn.p-red .btn-indicator { background: #ef4444; }
.selector-btn.p-purple .btn-indicator { background: #8b5cf6; }
.selector-btn.p-orange .btn-indicator { background: #f59e0b; }
.selector-btn.p-blue .btn-indicator { background: #0ea5e9; }

.selector-btn:hover {
    color: #ffffff;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Estados activos */
.selector-btn.active.p-red {
    border-color: rgba(239, 68, 68, 0.4);
    color: #ffffff;
    background: rgba(239, 68, 68, 0.08);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2), var(--glass-shadow);
}

.selector-btn.active.p-purple {
    border-color: rgba(139, 92, 246, 0.4);
    color: #ffffff;
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2), var(--glass-shadow);
}

.selector-btn.active.p-orange {
    border-color: rgba(245, 158, 11, 0.4);
    color: #ffffff;
    background: rgba(245, 158, 11, 0.08);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2), var(--glass-shadow);
}

.selector-btn.active.p-blue {
    border-color: rgba(14, 165, 233, 0.4);
    color: #ffffff;
    background: rgba(14, 165, 233, 0.08);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.2), var(--glass-shadow);
}

.portal-map-intro-text {
    font-family: var(--font-titles);
    font-size: 1.1rem;
    font-weight: 500;
    color: #cbd5e1;
    text-align: center;
    letter-spacing: 0.5px;
    margin-top: -1.5rem;
    margin-bottom: -1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Sección del mapa y panel */
.portal-map-section {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    box-shadow: var(--glass-shadow), 0 0 40px rgba(59, 130, 246, 0.05);
}

#portal-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Tarjeta flotante con detalles de programa */
.map-details-card {
    position: absolute;
    top: 4.5rem; /* Ajustado para no tapar los controles de Leaflet */
    right: 1rem;
    width: 280px;
    max-height: calc(100% - 2rem);
    z-index: 10; /* Por encima de Leaflet */
    background: rgba(11, 15, 25, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: var(--transition-smooth);
    overflow: hidden;
}

.close-info-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 20;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    line-height: 1;
}

.close-info-btn:hover {
    color: #ef4444;
    background: rgba(255, 255, 255, 0.1);
}

.map-details-card .card-glow-border {
    opacity: 0.4;
}

.map-details-card:hover .card-glow-border {
    opacity: 0.8;
}

.program-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-family: var(--font-titles);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 4px;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

/* Colores de badges de programas */
.badge-red {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}
.badge-purple {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #c084fc;
}
.badge-orange {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}
.badge-blue {
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: #38bdf8;
}

.info-title {
    font-family: var(--font-titles);
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 0.2rem;
}

.info-subtitle {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-description {
    font-size: 0.75rem;
    line-height: 1.4;
    color: #cbd5e1;
    text-align: justify;
}

.info-metadata {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.meta-label {
    color: #64748b;
    font-weight: 500;
}

.meta-value {
    color: #cbd5e1;
    font-weight: 600;
}

.btn-enter-visor {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
}

/* Personalización Leaflet */
.leaflet-container {
    background-color: #0b0f19 !important;
}

.leaflet-bar {
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: var(--glass-shadow) !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.leaflet-bar a {
    background-color: rgba(17, 24, 39, 0.9) !important;
    color: #cbd5e1 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    transition: var(--transition-smooth);
}

.leaflet-bar a:hover {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #ffffff !important;
}

.leaflet-control-attribution {
    background: rgba(11, 15, 25, 0.8) !important;
    color: #64748b !important;
    font-size: 9px !important;
    border-top-left-radius: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.leaflet-control-attribution a {
    color: #94a3b8 !important;
}

/* Marcador Pulsante */
.map-marker-pulse {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    position: relative;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.map-marker-pulse::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    top: 0;
    left: 0;
    animation: markerPulse 1.8s infinite ease-out;
    z-index: -1;
}

.red-pulse {
    background: #ef4444;
    border: 2px solid rgba(255, 255, 255, 0.7);
}
.red-pulse::after { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.4); }

.purple-pulse {
    background: #8b5cf6;
    border: 2px solid rgba(255, 255, 255, 0.7);
}
.purple-pulse::after { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0.4); }

.orange-pulse {
    background: #f59e0b;
    border: 2px solid rgba(255, 255, 255, 0.7);
}
.orange-pulse::after { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.4); }

.blue-pulse {
    background: #0ea5e9;
    border: 2px solid rgba(255, 255, 255, 0.7);
}
.blue-pulse::after { box-shadow: 0 0 0 8px rgba(14, 165, 233, 0.4); }

@keyframes markerPulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Responsividad para móviles del Mapa */
@media (max-width: 992px) {
    .portal-map-section {
        height: auto;
        display: flex;
        flex-direction: column;
    }

    #portal-map {
        height: 400px;
        width: 100%;
    }

    .map-details-card {
        position: relative;
        top: 0;
        right: 0;
        width: 100%;
        max-height: none;
        border-radius: 0;
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(11, 15, 25, 0.6);
        box-shadow: none;
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .selector-btn {
        min-width: 100%;
        padding: 0.8rem 1rem;
    }

    .portal-map-intro-text {
        margin-top: -0.5rem;
        margin-bottom: 0rem;
        font-size: 0.95rem;
    }
    
    #portal-map {
        height: 320px;
    }
}

/* ==========================================================================
   ARCHIVO HISTÓRICO (Biblioteca Interactiva)
   ========================================================================== */

.historico-page {
    background-color: #0b0f19;
    color: #e2e8f0;
    min-height: 100vh;
    padding-bottom: 6rem;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 40%),
        radial-gradient(circle at bottom left, rgba(239, 68, 68, 0.05), transparent 40%),
        linear-gradient(to bottom, rgba(11, 15, 25, 0.95), rgba(17, 24, 39, 0.98)),
        url('../assets/siimp_background.png');
    background-blend-mode: overlay, overlay, normal, normal;
    background-size: cover;
    background-attachment: fixed;
}

.historico-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
    z-index: 10;
}

.historico-header {
    text-align: center;
    margin-bottom: 3rem;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 12px;
}

.search-icon {
    color: #64748b;
    font-size: 1.2rem;
    margin-right: 1rem;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    padding: 0.5rem 0;
}

.search-input::placeholder {
    color: #64748b;
}

.historico-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.doc-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.doc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(96, 165, 250, 0.3);
}

.doc-icon {
    font-size: 2rem;
    color: #3b82f6;
    margin-right: 1.2rem;
    margin-top: 0.2rem;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.4));
}

.doc-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
}

.doc-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.4;
    color: #cbd5e1;
    margin: 0 0 0.8rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-year {
    display: inline-block;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.doc-card:hover .btn-glow {
    opacity: 1;
}

.doc-files-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto; /* Empuja los botones siempre al fondo de la tarjeta */
    padding-top: 1.5rem; /* Da respiro entre el título/año y los botones */
}

.doc-file-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(37, 99, 235, 0.8); /* Azul semi-transparente */
    border: 1px solid rgba(96, 165, 250, 0.5);
    color: #ffffff;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.doc-file-btn i {
    margin-right: 0.5rem;
}

.doc-file-btn:hover {
    background: rgba(37, 99, 235, 1);
    border-color: #93c5fd;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.doc-map-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(16, 185, 129, 0.8); /* Verde Esmeralda semi-transparente */
    border: 1px solid rgba(52, 211, 153, 0.5);
    color: #ffffff;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.doc-map-btn i {
    margin-right: 0.5rem;
}

.doc-map-btn:hover {
    background: rgba(16, 185, 129, 1);
    border-color: #6ee7b7;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}


.theme-purple .layer-item-btn:hover {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.3);
    color: #ffffff;
}

.theme-purple .layer-item-btn:hover .layer-icon-span {
    background: #8b5cf6;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.theme-purple .layer-item-btn:hover .layer-arrow {
    color: #8b5cf6;
}

.theme-purple .download-card-item:hover {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.1);
}

.theme-purple .dl-icon-wrapper {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.theme-purple .layer-icon-span {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.theme-orange .layer-icon-span {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* Added missing theme-purple icon styles */
.theme-purple .section-card-header .header-icon {
    color: #8b5cf6;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

.theme-purple .query-icon-wrapper {
    color: #8b5cf6;
}

.theme-purple .query-card-item:hover .query-icon-wrapper {
    background: #8b5cf6;
}

.theme-purple .query-card-item:hover .query-arrow {
    color: #8b5cf6;
}

.theme-purple .poe-badge {
    background: #8b5cf6;
}

.theme-purple .download-card-item:hover .poe-badge {
    color: #8b5cf6;
}

.theme-purple .download-card-item:hover .dl-icon-wrapper {
    background: #8b5cf6;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.theme-purple .query-card-item:hover .query-icon-wrapper {
    background: #8b5cf6;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

@media (max-width: 768px) {
    .bottom-glass-nav {
        flex-wrap: wrap !important;
        justify-content: center !important;
        border-radius: 20px !important;
        padding: 0.8rem !important;
        width: calc(100% - 2rem) !important;
        margin: 2rem auto !important;
    }

    .bottom-nav-item {
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
    }
}


/* ==========================================================================
   MAPA - TOOLBAR Y MODO PANTALLA COMPLETA
   ========================================================================== */

/* Barra sobre el iframe del mapa */
.map-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.4rem 0.6rem;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Botón pantalla completa */
.btn-map-fullscreen {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
    backdrop-filter: blur(6px);
    letter-spacing: 0.02em;
}

.btn-map-fullscreen:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #fff;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.btn-map-fullscreen svg {
    flex-shrink: 0;
}

/* ── Modo Pantalla Completa ── */
/* El mapa cubre TODA la pantalla incluyendo el header */
.map-fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1000;
    border-radius: 0 !important;
    animation: fsSlideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* En fullscreen el toolbar queda a la izquierda del botón compartir de ArcGIS */
.map-fullscreen-mode .map-toolbar {
    position: fixed;
    top: 18px;
    right: 46px;        /* justo a la izquierda del ícono compartir (~40px ancho) */
    left: auto;
    transform: none;
    z-index: 1100;
    background: transparent;
    padding: 0;
    width: auto;
    justify-content: flex-end;
}

/* En fullscreen el iframe ocupa TODO el contenedor */
.map-fullscreen-mode #map-frame {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
}

@keyframes fsSlideIn {
    from { opacity: 0.6; transform: scale(0.98); }
    to   { opacity: 1;   transform: scale(1); }
}

/* ── Mini-barra flotante de navegación en fullscreen ── */
.map-fs-minibar {
    display: none;          /* oculta por defecto */
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    background: rgba(11, 15, 25, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 40px;
    padding: 0.35rem 1rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    animation: minibarIn 0.22s ease;
}

@keyframes minibarIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.map-fs-minibar.visible {
    display: flex;
}

.minibar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: 1px solid transparent;
    color: rgba(226, 232, 240, 0.85);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.minibar-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.18);
    color: #fff;
}

.minibar-btn.btn-exit-fs {
    color: #f97316;
    border-color: rgba(249, 115, 22, 0.3);
}

.minibar-btn.btn-exit-fs:hover {
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.5);
    color: #fff;
}

.minibar-divider {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.15);
}

/* ==========================================================================
   PORTAL LAYOUT ROW & SIDEBAR
   ========================================================================== */
.portal-layout-row {
    display: flex; 
    flex-direction: row; 
    gap: 2rem; 
    width: 100%; 
    align-items: stretch; 
    height: 540px;
}

.portal-sidebar {
    width: 320px; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    flex-shrink: 0; 
    overflow-y: auto; 
    padding-right: 10px; 
    height: 100%;
}

.portal-map-section {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   PORTAL INTRO TEXT
   ========================================================================== */
.portal-intro-text {
    text-align: center;
    margin-top: 2.5rem;
    margin-bottom: -2.5rem; /* Counteracts portal-container 3.5rem gap */
    padding: 0 1rem;
}

.portal-intro-text h2 {
    font-family: var(--font-titles);
    font-size: 1.3rem;
    color: #e2e8f0;
    font-weight: 600;
    margin-bottom: 0.3rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.portal-intro-text p {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: #94a3b8;
    letter-spacing: 0.3px;
    margin-bottom: 0;
}

@media (max-width: 1100px) {
    .portal-layout-row {
        flex-direction: column;
        height: auto;
    }
    
    .portal-sidebar {
        width: 100%;
        height: auto;
        gap: 0.5rem;
        padding-right: 0;
    }
    
    .portal-sidebar .glow-btn {
        padding: 10px 15px;
        margin-bottom: 0.5rem;
    }

    .portal-map-section {
        height: 500px;
        width: 100%;
    }
}
/* ==========================================================================
   GLOW BUTTONS PARA SIDEBAR
   ========================================================================== */

.glow-btn {
    background: rgba(11, 15, 25, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 14px 20px;
    color: #cbd5e1;
    font-family: var(--font-titles);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.glow-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    transition: var(--transition-smooth);
}

.glow-btn:hover, .glow-btn.active {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

/* Glowing Border Colors */
.glow-red::before {
    background: linear-gradient(90deg, transparent, #ef4444, transparent);
    opacity: 0.7;
}
.glow-red:hover, .glow-red.active {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.3);
}

.glow-yellow::before {
    background: linear-gradient(90deg, transparent, #f59e0b, transparent);
    opacity: 0.7;
}
.glow-yellow:hover, .glow-yellow.active {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.3);
}

.glow-purple::before {
    background: linear-gradient(90deg, transparent, #8b5cf6, transparent);
    opacity: 0.7;
}
.glow-purple:hover, .glow-purple.active {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.3);
}

/* ==========================================================================
   LANDING PAGE REDESIGN
   ========================================================================== */

.landing-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-color: var(--bg-color);
}

.landing-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.topo-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 10 Q 50 50 90 10 T 90 90 Q 50 50 10 90 T 10 10' stroke='%23ffffff' fill='none' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 300px;
}

.bg-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(30, 58, 138, 0.15) 0%, transparent 60%);
}

/* Leyenda global de créditos */
.global-credits {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    background: transparent;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.7rem;
    font-style: italic;
    font-weight: 400;
    z-index: 9999;
    pointer-events: none;
    letter-spacing: 0.5px;
    width: auto;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

@media (max-width: 768px) {
    .global-credits {
        font-size: 0.55rem;
        bottom: 5px;
        white-space: normal;
        width: 90%;
    }
    
    .bottom-nav {
        padding-bottom: 25px; /* Evitar que tape los botones del bottom nav en móvil */
    }
}

.cerro-silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40vh;
    min-height: 300px;
    z-index: 0;
}

.bg-municipio-outline {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    opacity: 0.6;
    z-index: 1;
    pointer-events: none;
    animation: pulseGlow 6s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
    0% { opacity: 0.4; filter: blur(0px); transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0.8; filter: blur(1px); transform: translate(-50%, -50%) scale(1.02); }
}

.landing-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    z-index: 10;
    padding-top: 100px; /* offset for fixed header */
}

/* Hero Section */
.hero-section {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 6rem 2rem 4rem 2rem;
}

.hero-content {
    max-width: 900px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    z-index: 10;
}

.logo-siimp-2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0rem;
    padding-bottom: 5px;
}

.siimp-text {
    font-family: var(--font-titles);
    font-size: 6.5rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -2px;
    line-height: 1;
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 10px 0;
}

.version-text {
    font-family: var(--font-body);
    font-size: 6.5rem;
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 3px #ffffff;
    line-height: 1;
    letter-spacing: 4px;
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 10px;
    display: inline-block;
}

.badge-accent {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--color-warning);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.1);
    margin-bottom: 0.5rem;
}

.hero-title {
    font-family: var(--font-titles);
    font-size: 3.5rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin: 0;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1.25rem;
    color: #cbd5e1;
    line-height: 1.6;
    max-width: 750px;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.hero-actions {
    margin-top: 1.5rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

/* Features Section */
.features-section {
    width: 100%;
    padding: 2rem 2rem 6rem 2rem;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.features-container {
    max-width: 1200px;
    width: 100%;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    background: rgba(11, 15, 25, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.f-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
}

.f-blue {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.f-gold {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.f-red {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.feature-card h3 {
    font-family: var(--font-titles);
    font-size: 1.25rem;
    color: #ffffff;
    margin: 0 0 1rem 0;
}

.feature-card p {
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0;
}

/* Landing Footer */
.landing-footer {
    width: 100%;
    margin-top: auto;
    z-index: 10;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    background: rgba(11, 15, 25, 0.95);
    padding: 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.disclaimer-mini {
    max-width: 900px;
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.disclaimer-mini p {
    margin: 0;
}

.disclaimer-mini strong {
    color: #e2e8f0;
}

.politico-note {
    margin-top: 1rem !important;
    font-size: 0.75rem;
    color: #64748b !important;
}

.footer-bottom {
    font-size: 0.85rem;
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
    width: 100%;
}

/* Nav Button in Header */
.btn-text-nav {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0.5rem 1rem;
}

.btn-text-nav:hover {
    color: #ffffff;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }
    .hero-subtitle {
        font-size: 1.05rem;
    }
    .hero-section {
        padding: 4rem 1.5rem 3rem 1.5rem;
    }
    .siimp-text, .version-text {
        font-size: 4rem;
    }
    .features-section {
        padding: 1rem 1.5rem 4rem 1.5rem;
    }
}

/* Estilo para desaturar las imágenes satelitales (Leaflet maps) */
.satellite-desaturated {
    filter: saturate(50%);
}

/* ==========================================================================
   OPTIMIZACIONES TOUCHSCREEN Y MÓVILES (SiiMP 2.0 MOBILE UPGRADE)
   ========================================================================== */

/* 1. Global Touch Optimization */
button, 
a, 
.selector-btn, 
.layer-item-btn, 
.bottom-nav-item, 
.feature-card-link,
.program-tab {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* 2. Feature Cards Clickeables en Index */
.feature-card-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.feature-card-link:hover, 
.feature-card-link:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(59, 130, 246, 0.15);
}

.feature-card-link:active {
    transform: scale(0.97);
    border-color: rgba(59, 130, 246, 0.6);
}

.card-touch-cta {
    display: inline-block;
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #60a5fa;
    letter-spacing: 0.3px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.feature-card-link:hover .card-touch-cta {
    color: #93c5fd;
    transform: translateX(4px);
}

/* 3. Controles táctiles en Portal Map */
.portal-map-touch-controls {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.portal-map-fs-btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(11, 15, 25, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #f1f5f9;
    font-family: var(--font-titles);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    min-height: 40px;
}

.portal-map-fs-btn:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(59, 130, 246, 0.5);
    color: #38bdf8;
    transform: translateY(-1px);
}

.portal-map-fs-btn:active {
    transform: scale(0.95);
    background: rgba(59, 130, 246, 0.3);
}

.portal-touch-hint {
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    color: #cbd5e1;
    font-size: 0.78rem;
    padding: 6px 12px;
    border-radius: 999px;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Modo Pantalla Completa del Mapa del Portal */
.portal-map-section.portal-fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.portal-fullscreen-active #portal-map {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
}

.portal-fullscreen-active .portal-map-touch-controls {
    top: 16px !important;
    left: 16px !important;
}

/* 4. Estilos de Visor: Mapa y Controles */
#map-container-wrap {
    width: 100%;
    height: 580px;
    margin-bottom: 2rem;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
}

.map-iframe-viewport {
    position: relative;
    width: 100%;
    flex: 1;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

#map-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: inherit;
    display: block;
}

.map-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px 10px 8px;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-map-fullscreen {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    min-height: 42px;
    transition: all 0.2s ease;
}

.btn-map-fullscreen:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.btn-map-fullscreen:active {
    transform: scale(0.96);
}

.btn-quick-layers {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    min-height: 42px;
    transition: all 0.2s ease;
}

.btn-quick-layers:hover {
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

.btn-quick-layers:active {
    transform: scale(0.96);
}

/* 5. MEDIA QUERIES RESPONSIVE Y TOUCH PARA TABLETS Y TELÉFONOS */
@media (max-width: 992px) {
    /* Barra de selección de programas en formato Scroll Horizontal (Chips) */
    .portal-layout-row {
        flex-direction: column !important;
        height: auto !important;
        gap: 1rem !important;
    }

    .portal-sidebar {
        width: 100% !important;
        height: auto !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding: 4px 2px 10px 2px !important;
        gap: 8px !important;
        scroll-snap-type: x mandatory !important;
    }

    .portal-sidebar::-webkit-scrollbar {
        display: none !important;
    }

    .portal-sidebar .selector-btn {
        flex: 0 0 auto !important;
        min-width: auto !important;
        white-space: nowrap !important;
        padding: 10px 18px !important;
        font-size: 0.82rem !important;
        border-radius: 999px !important;
        scroll-snap-align: start !important;
        min-height: 44px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
        margin: 0 !important;
    }

    /* El mapa en formato más vertical para navegación óptima */
    .portal-map-section {
        height: 580px !important;
        width: 100% !important;
    }

    #portal-map {
        height: 100% !important;
        width: 100% !important;
    }

    /* Tarjeta flotante adaptada como Bottom Sheet elegante (SIN SCROLL INTERNO) */
    .map-details-card {
        position: absolute !important;
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        top: auto !important;
        width: auto !important;
        max-height: none !important;
        z-index: 1000 !important;
        border-radius: 14px !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        background: rgba(11, 15, 25, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.8) !important;
        padding: 0.75rem 0.9rem !important;
        gap: 0.4rem !important;
        overflow: hidden !important;
        scrollbar-width: none !important;
    }

    .map-details-card::-webkit-scrollbar {
        display: none !important;
    }

    .map-details-card .close-info-btn {
        top: 0.45rem !important;
        right: 0.45rem !important;
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        font-size: 1.35rem !important;
        background: rgba(255, 255, 255, 0.08) !important;
    }

    .map-details-card .program-badge {
        margin-bottom: 0.25rem !important;
        padding: 0.15rem 0.5rem !important;
        font-size: 0.65rem !important;
    }

    .map-details-card .info-title {
        font-size: 0.92rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.15rem !important;
        padding-right: 28px !important; /* Espacio para que no choque con la X de cerrar */
    }

    .map-details-card .info-subtitle {
        font-size: 0.68rem !important;
        margin-bottom: 0.3rem !important;
        opacity: 0.75 !important;
    }

    .map-details-card .card-body {
        margin: 0 !important;
        padding: 0 !important;
    }

    .map-details-card .info-description {
        font-size: 0.78rem !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        color: #cbd5e1 !important;
    }

    .map-details-card .card-footer {
        margin-top: 0.2rem !important;
    }

    .map-details-card .btn-enter-visor {
        width: 100% !important;
        min-height: 40px !important;
        padding: 0.45rem 1rem !important;
        justify-content: center !important;
        font-size: 0.88rem !important;
        border-radius: 10px !important;
    }

    /* Tabs de programa en Visor */
    .program-tabs-container {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 8px !important;
        padding-bottom: 6px !important;
    }

    .program-tabs-container::-webkit-scrollbar {
        display: none !important;
    }

    .program-tab {
        flex: 0 0 auto !important;
        min-height: 48px !important;
        padding: 0.6rem 1.2rem !important;
        font-size: 0.82rem !important;
        border-radius: 10px !important;
    }

    /* Contenedor del mapa en Visor para tablet/móvil con formato vertical */
    #map-container-wrap,
    .map-viewer-card {
        height: 540px !important;
    }

    /* Escalado responsivo de ArcGIS en tablets y pantallas medianas (reduce botones y cabecera al 82%) */
    .map-iframe-viewport #map-frame,
    .map-viewer-card .arcgis-iframe {
        width: 122% !important;
        height: 122% !important;
        transform: scale(0.82) !important;
        transform-origin: 0 0 !important;
    }
}

@media (max-width: 600px) {
    /* Header optimizado para smartphones */
    .header-container {
        padding: 0.75rem 1rem !important;
    }

    .logo-area .logo-implan {
        display: none !important; /* Ocultar texto largo del IMPLAN en móviles para evitar overflow */
    }

    .logo-area .divider {
        display: none !important;
    }

    .btn-text-nav {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.85rem !important;
    }

    /* Hero section en el Index */
    .hero-title {
        font-size: 1.85rem !important;
        line-height: 1.25 !important;
    }

    .hero-subtitle {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
    }

    .hero-section {
        padding: 3rem 1rem 2rem 1rem !important;
    }

    .hero-actions .btn {
        width: 100% !important;
        min-height: 52px !important;
        justify-content: center !important;
        font-size: 1.05rem !important;
        border-radius: 14px !important;
    }

    .features-section {
        padding: 1rem 1rem 3rem 1rem !important;
    }

    /* Mapas en formato vertical ergonómico para smartphones */
    .portal-map-section {
        height: 540px !important;
        min-height: 480px !important;
        border-radius: 14px !important;
    }

    #map-container-wrap,
    .map-viewer-card {
        height: 500px !important;
        min-height: 450px !important;
        border-radius: 14px !important;
        margin-bottom: 1.2rem !important;
    }

    .portal-map-fs-btn {
        padding: 6px 10px !important;
        font-size: 0.75rem !important;
    }

    .portal-touch-hint {
        display: none !important; /* Ocultar hint de texto largo en pantallas de 360px */
    }

    /* Capas cartográficas en Visor */
    .layer-item-btn {
        min-height: 50px !important;
        padding: 10px 14px !important;
        font-size: 0.88rem !important;
    }

    /* Escalado responsivo de ArcGIS en teléfonos (reduce botones y cabecera al 76% para máxima visibilidad del mapa) */
    .map-iframe-viewport #map-frame,
    .map-viewer-card .arcgis-iframe {
        width: 132% !important;
        height: 132% !important;
        transform: scale(0.76) !important;
        transform-origin: 0 0 !important;
    }
}
