
html {
    scroll-behavior: smooth;
}
/* Estilos críticos body para evitar FOUC */
body {
    font-family: 'Poppins', Arial, sans-serif;
    padding-top: 4rem;
}
body.homepage {
    background-color: white;
    background-image: none;
}
/* Banner fijo */
#banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    height: 4rem;
    background-color: rgba(255,255,255,0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
/* Megamenús: position:fixed viene de styles.css (blocking).
   Se duplica aquí para evitar CLS si styles.css tarda en llegar:
   sin esto los divs quedan en flujo normal y desplazan #homepage-content-wrapper ~1138px. */
.asesor-megamenu {
    position: fixed;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}
/* Homepage section crítico */
.homepage-section {
    background-image: none;
    background-size: cover;
    background-position: center center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}
/* KEN BURNS - CARRUSEL DE FONDO */
.kb-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    opacity: 0;
    transition: opacity 1.8s ease-in-out;
    z-index: 0;
}
.kb-slide.active {
    opacity: 1;
    will-change: transform, opacity;
    animation: kenburns-a 12s ease-in-out forwards;
}
.kb-slide.active.alt {
    animation: kenburns-b 12s ease-in-out forwards;
}
@keyframes kenburns-a {
    0%   { transform: scale(1.0)  translate(0%,    0%);    }
    100% { transform: scale(1.10) translate(-1.5%, -1%);   }
}
@keyframes kenburns-b {
    0%   { transform: scale(1.08) translate(-1%, -0.5%);   }
    100% { transform: scale(1.0)  translate(1%,   0.5%);   }
}
/* PWA banner */
.pwa-install-banner { position: fixed; top: 64px; left: 0; right: 0; background-color: #f1f5f9; border-bottom: 2px solid #3b82f6; padding: 1rem; display: flex; justify-content: space-between; align-items: center; z-index: 1100; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); transition: all 0.5s ease-in-out; transform: translateY(-100%); opacity: 0; pointer-events: none; }
.pwa-install-banner.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
@media (max-width: 1023px) { .pwa-install-banner { top: 4.8rem; border-radius: 1rem; } }
.submenu-arrow { transition: transform 0.3s ease; }
.has-submenu.submenu-open .submenu-arrow { transform: rotate(90deg); }
#suspension-notice {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    text-align: justify;
    padding: 10px 16px;
    font-weight: 400;
    font-size: 14px;
    border-radius: 0.75rem;
    margin: 1.25rem auto 0;
    line-height: 1.6;
    width: 95%;
    box-sizing: border-box;
    overflow: hidden;
    animation: notice-glow 3.5s ease-in-out infinite;
}
#suspension-notice .notice-marquee {
    display: block;
    animation: notice-slidein 35s ease-in-out infinite;
}
#suspension-notice .notice-title {
    color: #FFFFFF;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.85), 0 0 2px rgba(255, 215, 0, 0.6);
}
@media (max-width: 640px) {
    #suspension-notice {
        width: 100%;
    }

}
@keyframes notice-glow {
    0%, 100% { box-shadow: 0 0 6px rgba(255, 255, 255, 0.1); }
    50%       { box-shadow: 0 0 18px rgba(255, 255, 255, 0.35); }
}
@keyframes notice-slidein {
    0%   { transform: translateX(110%); }
    6%   { transform: translateX(0); }
    91%  { transform: translateX(0); }
    92%  { transform: translateX(110%); }
    100% { transform: translateX(110%); }
}
@media (min-width: 1024px) {
    .asesor-megamenu {
        border-radius: 0 !important;
    }
}
@keyframes valores-marquee {
    0%      { transform: translateX(0%); }
    55%     { transform: translateX(0%); }
    70%     { transform: translateX(-150%); }
    70.01%  { transform: translateX(150%); }
    85%     { transform: translateX(0%); }
    100%    { transform: translateX(0%); }
}
/* ===== BADGE SPD ===== */
.spd-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 5px;
    background: rgba(251, 191, 36, 0.18);
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: rgba(253, 224, 71, 0.9);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 3px;
    vertical-align: middle;
    line-height: 1.4;
    flex-shrink: 0;
}
.spd-badge-dark {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    padding: 1px 4px;
    background: rgba(35, 124, 78, 0.08);
    border: 1px solid rgba(35, 124, 78, 0.3);
    color: rgba(20, 99, 20, 0.7);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 3px;
    vertical-align: middle;
    line-height: 1.4;
    flex-shrink: 0;
}
.dropdown-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}
.close-mobile-menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}
.close-mobile-menu-btn:hover { background: rgba(0, 0, 0, 0.05); }
.close-mobile-menu-btn svg { stroke: #374151; }
/* ===== BARRA DE NAVEGACIÓN VERDE (SOLO PC) ===== */
.desktop-navbar {
    display: none;
    background: #237c4e;
    box-shadow: 0 4px 12px rgba(35, 124, 78, 0.3);
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 1100;
    font-family: Arial, sans-serif;
    height: 34px;
    max-height: 34px;
}
@media (max-width: 1023px) {
    .desktop-navbar { display: none !important; }
    #mobile-menu-btn { display: block !important; }
    #banner { height: 6.5rem; }
    body  { padding-top: 0 !important; }
    .homepage-section {
        min-height: 70vh !important;
        height: 70vh !important;
        max-height: 70vh !important;
    }
    /* Título hero: empieza debajo del pill (pill top 8px + height 56px + margen) */
    #hero-title-container {
        top: 100px !important;
    }
    /* Botones posicionados hacia el fondo de la sección hero */
    #btn-container-hero {
        position: absolute !important;
        bottom: 8% !important;
        top: auto !important;
        left: 0;
        right: 0;
        margin-top: 0;
    }
    /* Menú lateral alineado con el fin del banner */
    .mobile-dropdown { top: 4.5rem !important; }
}
@media (min-width: 1024px) {
    .desktop-navbar { display: block !important; }
    #mobile-menu-btn { display: none !important; }
    .homepage-section {
        margin-top: 98px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        min-height: calc(100vh - 98px) !important;
        height: calc(100vh - 98px) !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        position: relative !important;
    }
    .homepage-section > div.relative.z-10:first-of-type {
        position: absolute !important;
        top: 50px !important;
        left: 0 !important;
        right: 0 !important;
        padding: 0 1rem !important;
        z-index: 20 !important;
    }
    #homepage-content-wrapper {
        padding-top: 0 !important;
        margin-top: -160px !important;
        position: relative;
        z-index: 10;
    }
    body.show-directiva #homepage-section,
    body.show-credenciales #homepage-section {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: absolute !important;
        left: -9999px !important;
    }
    body.show-directiva #homepage-content-wrapper,
    body.show-credenciales #homepage-content-wrapper {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: absolute !important;
        left: -9999px !important;
    }
    body.show-directiva #contenido,
    body.show-credenciales #contenido {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        left: auto !important;
    }
    body.show-directiva #main-section,
    body.show-credenciales #credenciales-section {
        display: block !important;
        visibility: visible !important;
    }
    .carousel-container.mt-16 { margin-top: 0 !important; }
    #tramites-principales { padding-top: 2rem !important; margin-top: 0 !important; }
    #tramites-principales.py-16,
    #tramites-principales.py-24,
    #tramites-principales.md\:py-24 {
        padding-top: 1rem !important;
        padding-bottom: 2rem !important;
    }
    #tramites-principales > div { padding-top: 0 !important; }
    #tramites-principales .text-center { margin-top: 0 !important; padding-top: 1.5rem !important; }
    #tramites-principales .text-center > div { margin-top: 0 !important; margin-bottom: 0.5rem !important; }
    #tramites-principales .text-center p { margin-top: 0.5rem !important; }
    #tramites-principales .carousel-card { padding: 1rem !important; }
    #tramites-principales .carousel-container { margin-top: 1.0rem !important; }
}
.desktop-navbar-container {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    height: 34px;
    max-height: 34px;
    overflow-x: auto;
    overflow-y: visible;
}
.desktop-navbar-container::-webkit-scrollbar { height: 3px; }
.desktop-navbar-container::-webkit-scrollbar-track { background: transparent; }
.desktop-navbar-container::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 10px; }
.desktop-nav-items {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
    justify-content: center;
    white-space: nowrap;
}
.desktop-nav-item {
    position: relative;
    color: white;
    font-family: Arial, sans-serif;
    font-weight: normal;
    font-size: 12px;
    line-height: 14px;
    padding: 10px 14px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    background: transparent;
    border: none;
    flex-shrink: 0;
    height: 34px;
    max-height: 34px;
}
.desktop-nav-item::before {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    right: 0;
    height: 16px;
    background: transparent;
    pointer-events: auto;
    z-index: 1000;
}
.desktop-nav-item:hover { background: rgba(0,0,0,0.2); }
.desktop-chevron { width: 11px; height: 11px; stroke-width: 2.5; transition: transform 0.3s ease; flex-shrink: 0; }
.desktop-nav-item:hover .desktop-chevron { transform: rotate(90deg); }
.desktop-submenu {
    position: fixed;
    background: #237c4e;
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 0.4rem;
    min-width: 220px;
    max-width: 320px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.16s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0.16s;
    will-change: opacity, transform;
    z-index: 1001;
    border: none;
    font-family: Arial, sans-serif;
    overflow: visible;
}
.desktop-submenu-item {
    display: flex;
    align-items: center;
    width: calc(100% + 0.8rem);
    padding: 6px 0.4rem;
    margin-left: -0.4rem;
    margin-right: -0.4rem;
    color: white;
    font-family: Arial, sans-serif;
    font-weight: normal;
    font-size: 12px;
    line-height: 15px;
    text-align: left;
    border-radius: 0;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
    margin-bottom: 3px;
    max-height: 28px;
}
/* Badge SPD alineado a la derecha en desktop */
button.desktop-submenu-item .spd-badge {
    margin-left: auto !important;
    flex-shrink: 0;
}
.desktop-submenu-item:hover { background: rgba(0,0,0,0.2); }
.desktop-submenu-title {
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
    line-height: 15px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 0.4rem;
    margin-bottom: 3px;
    margin-left: -0.4rem;
    margin-right: -0.4rem;
    width: calc(100% + 0.8rem);
    opacity: 0.95;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    text-align: center;
}
.desktop-submenu-divider { height: 1px; background: rgba(0,0,0,0.2); margin: 4px 0; }
.desktop-submenu.mega { min-width: 360px; max-width: 380px; max-height: 420px; overflow-y: auto; padding-left: 0px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.25) transparent; }
.desktop-submenu.mega::-webkit-scrollbar { width: 3px; }
.desktop-submenu.mega::-webkit-scrollbar-track { background: transparent; }
.desktop-submenu.mega::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 10px; }
.desktop-submenu.mega::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.5); }
.desktop-submenu-container { position: relative; width: 100%; }
.desktop-submenu-side {
    position: absolute;
    top: 0;
    left: 100%;
    background: #237c4e;
    border-radius: 0px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.3);
    padding: 0.4rem;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-4px);
    transition: opacity 0.14s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.16s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0.14s;
    will-change: opacity, transform;
    z-index: 1002;
    margin-left: 0px;
    overflow: visible;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.desktop-submenu-side::-webkit-scrollbar { width: 3px; }
.desktop-submenu-side::-webkit-scrollbar-track { background: transparent; }
.desktop-submenu-side::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 10px; }
.desktop-submenu-side::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.5); }
.desktop-submenu-item-with-side:hover > .desktop-submenu-side {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition: opacity 0.14s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.16s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0s linear 0s;
}
.desktop-submenu-item-with-side {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 6px 0.4rem;
    margin-left: -0.4rem;
    margin-right: -0.4rem;
    width: calc(100% + 0.8rem);
    margin-bottom: 3px;
    border-radius: 0;
    transition: all 0.2s ease;
    cursor: pointer;
}
.desktop-submenu-item-with-side:hover { background: rgba(0,0,0,0.2); }
.desktop-submenu-item-with-side::after {
    content: '';
    position: absolute;
    top: 0;
    right: -16px;
    bottom: 0;
    width: 16px;
    background: transparent;
    z-index: 1003;
}
/* Estilos para cards y gradientes */
.megamenu-header { display: flex; align-items: center; margin-bottom: 1rem; }
.megamenu-logo { width: 50px; height: auto; margin-right: 1rem; }
.section-card-hover { transition: all 0.3s ease; }
.section-card-hover:hover { transform: translateY(-4px); box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); }
.gradient-card { background: linear-gradient(135deg, var(--from-color) 0%, var(--to-color) 100%); }
.scroll-container { max-height: 400px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.1) transparent; }
.scroll-container::-webkit-scrollbar { width: 6px; }
.scroll-container::-webkit-scrollbar-track { background: transparent; }
.scroll-container::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.1); border-radius: 3px; }
.card-float-glow { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card-float-glow:hover { transform: translateY(-5px); }
.hover-glow-blue:hover { box-shadow: 0 0 15px 3px rgba(96, 165, 250, 0.4); }
.hover-glow-indigo:hover { box-shadow: 0 0 15px 3px rgba(129, 140, 248, 0.4); }
.hover-glow-green:hover { box-shadow: 0 0 15px 3px rgba(74, 222, 128, 0.4); }
.hover-glow-yellow:hover { box-shadow: 0 0 15px 3px rgba(250, 204, 21, 0.4); }
/* Texto SPD alternante */
.text-spd-alternante { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; overflow: hidden; }
.text-spd-alternante .texto-spd { opacity: 1; transition: opacity 0.6s ease-in-out; display: block; text-align: center; line-height: 1.3; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.text-spd-alternante .texto-spd.fade-out { opacity: 0; }
@media (max-width: 639px) {
    .homepage-btn { width: 100% !important; max-width: 220px !important; min-width: 180px !important; height: 48px !important; min-height: 48px !important; max-height: 48px !important; display: flex !important; align-items: center !important; justify-content: center !important; padding: 0 1rem !important; overflow: hidden !important; box-sizing: border-box !important; }
    .text-spd-alternante .texto-spd { font-size: 0.75rem; white-space: normal; line-height: 1.2; }
}
@media (min-width: 640px) {
    .homepage-btn { width: 230px !important; min-width: 230px !important; max-width: 230px !important; height: 48px !important; min-height: 48px !important; max-height: 48px !important; display: flex !important; align-items: center !important; justify-content: center !important; padding: 0 1rem !important; overflow: hidden !important; box-sizing: border-box !important; }
    .text-spd-alternante .texto-spd { font-size: 0.8rem; white-space: normal; line-height: 1.2; }
}
/* Modal requisitos */
.modal-requisitos-componentes { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.85); z-index: 9999 !important; overflow-y: auto; padding: 1rem; backdrop-filter: blur(8px); }
.modal-requisitos-componentes.active { display: flex; align-items: flex-start; justify-content: center; padding-top: 2rem; padding-bottom: 2rem; }
body:has(.modal-requisitos-componentes.active) .desktop-navbar { display: none !important; }
.modal-requisitos-componentes.active ~ * .desktop-navbar,
.desktop-navbar.hide-on-modal { display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }
.modal-content-componentes { background: white; border-radius: 1rem; max-width: 900px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.4); animation: slideDownModal 0.3s ease-out; }
@keyframes slideDownModal { from { opacity: 0; transform: translateY(-50px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header-componentes { background: linear-gradient(135deg, #146314 0%, #0d4a0d 100%); color: white; padding: 1.5rem; border-radius: 1rem 1rem 0 0; position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.modal-title-componentes { font-size: 1.5rem; font-weight: 700; margin: 0; flex: 1; }
.modal-body-componentes { padding: 1.5rem; }
.btn-cerrar-componentes { background: rgba(255,255,255,0.2); border: 2px solid white; color: white; padding: 0.5rem 1.25rem; border-radius: 0.5rem; font-weight: 600; cursor: pointer; transition: all 0.3s; font-size: 0.875rem; flex-shrink: 0; }
.btn-cerrar-componentes:hover { background: white; color: #146314; }
.requisito-section-componentes { background: #f8fafc; border-left: 4px solid #146314; padding: 1rem; margin-bottom: 1rem; border-radius: 0.5rem; }
.requisito-item-componentes { background: white; padding: 0.75rem; margin: 0.5rem 0; border-radius: 0.5rem; border: 1px solid #e2e8f0; display: flex; align-items: start; gap: 0.75rem; }
.requisito-numero-componentes { background: #146314; color: white; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: bold; flex-shrink: 0; }
.badge-componentes { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; margin-right: 0.5rem; margin-bottom: 0.5rem; }
.badge-ley-componentes { background: #dbeafe; color: #1e40af; }
.badge-decreto-componentes { background: #fef3c7; color: #92400e; }
@media (max-width: 768px) {
    .modal-content-componentes { margin: 0; max-height: 96vh; border-radius: 0.75rem; }
    .modal-header-componentes { padding: 1rem; border-radius: 0.75rem 0.75rem 0 0; }
    .modal-title-componentes { font-size: 1.125rem; line-height: 1.3; }
    .modal-body-componentes { padding: 1rem; font-size: 0.875rem; }
}
/* Botón PDF modal */
.btn-pdf-modal { display: inline-flex; align-items: center; gap: 0.5rem; background-color: #dc2626; color: white; padding: 0.75rem 1.5rem; border-radius: 0.5rem; font-weight: 600; font-size: 0.875rem; cursor: pointer; transition: all 0.3s; border: none; box-shadow: 0 2px 8px rgba(220,38,38,0.3); }
.btn-pdf-modal:hover { background-color: #b91c1c !important; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(220,38,38,0.5) !important; }
.btn-pdf-modal svg { width: 1.25rem; height: 1.25rem; }
.pdf-download-animation { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 99999; pointer-events: none; opacity: 0; }
.pdf-download-animation.active { animation: pdfBounce 4.4s ease-in forwards; }
.pdf-icon-animated { width: 80px; height: 80px; background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); border-radius: 12px; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 40px rgba(220,38,38,0.5); }
.pdf-icon-animated svg { width: 50px; height: 50px; color: white; }
@keyframes pdfBounce {
0% { opacity: 0; transform: translate(-50%,-50%) scale(0.5); }
5% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
15% { opacity: 1; transform: translate(-50%,-130%) scale(1.15); }
25% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
26% { opacity: 1; transform: translate(-30%,-100%) scale(0.9); }
28% { opacity: 1; transform: translate(-10%,-130%) scale(0.8); }
32% { opacity: 0.9; transform: translate(15%,-160%) scale(0.7); }
38% { opacity: 0.7; transform: translate(35%,-200%) scale(0.55); }
45% { opacity: 0.4; transform: translate(50%,-250%) scale(0.4); }
62% { opacity: 0.2; transform: translate(60%,-300%) scale(0.25); }
100% { opacity: 0; transform: translate(70%,-350%) scale(0.1); }
}
/* Leyes normativa PC */
@media (min-width: 768px) {
    .leyes-normativa-column { min-height: 320px; max-height: 320px; display: flex; flex-direction: column; }
    .leyes-normativa-scroll { display: block !important; max-height: 220px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.1) transparent; }
    .leyes-normativa-scroll::-webkit-scrollbar { width: 6px; }
    .leyes-normativa-scroll::-webkit-scrollbar-track { background: transparent; }
    .leyes-normativa-scroll::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.1); border-radius: 3px; }
    #leyes-toggle, #decretos-toggle, #resoluciones-toggle { pointer-events: none; cursor: default; }
    #leyes-arrow, #decretos-arrow, #resoluciones-arrow { display: none; }
}
@media (max-width: 767px) { .leyes-normativa-scroll.hidden { display: none; } }
/* ===== BOTÓN DE BÚSQUEDA EN BANNER (crítico - inline) ===== */
.banner-search-button,
#global-search-button {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin: 0 1rem 0 0;
    position: relative;
}
#global-search-button .search-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    transition: all 0.2s ease;
}
#global-search-button:hover { background: rgba(255,255,255,0.1); transform: scale(1.05); }
#global-search-button:active { transform: scale(0.95); }
@media (min-width: 1024px) {
    #global-search-button {
        background: transparent;
        border: 2px solid #dadde2;
        border-radius: 12px;
        padding: 4px 28px;
        min-width: 0;
        flex: 1 1 auto;
        margin-right: 1.5rem;
        position: relative;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    #global-search-button .search-icon { display: none; }
    #global-search-button::before {
        content: 'Buscar en la pagina';
        color: #9ca3af;
        font-size: 16px;
        font-weight: 400;
        letter-spacing: 0.3px;
        opacity: 0.8;
        transition: opacity 0.3s ease, color 0.3s ease;
        margin-right: 6px;
    }
    #global-search-button::after {
        content: '';
        width: 23px;
        height: 23px;
        display: block;
        background-color: #9ca3af;
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.35-4.35'%3E%3C/path%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.35-4.35'%3E%3C/path%3E%3C/svg%3E");
        -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
        -webkit-mask-position: center; mask-position: center;
        -webkit-mask-size: contain; mask-size: contain;
        opacity: 0.8;
        transition: opacity 0.3s ease, background-color 0.3s ease;
    }
    #global-search-button:hover { background: rgba(0,0,0,0.02); border-color: #3d92fb; transform: scale(1.02); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
    #global-search-button:hover::before { opacity: 1; color: #a8a4a3; }
    #global-search-button:hover::after { opacity: 1; background-color: #92ada4; }
}
@media (max-width: 1023px) {
    #global-search-button .search-icon { width: 26px; height: 26px; display: block; }
    #global-search-button { background: transparent; border: none; padding: 8px; border-radius: 50%; min-width: auto; }
    #global-search-button::before, #global-search-button::after { display: none; }
}
/* ===== CRÍTICOS PARA ASYNC styles.css (evitan FOUC) ===== */
/* credenciales-section empieza oculta; JS la muestra cuando el usuario navega a ella */
.credenciales-section { display: none; }
/* chat-popup tiene class="chat-popup-hidden flex..." → el flex de Tailwind lo haría visible sin esto */
.chat-popup-hidden { display: none !important; }
/* ===== CRÍTICOS PARA CLS: carousel.css carga async y las secciones son visibles en el viewport
   inicial móvil (hero 70vh + banner 72px = 640px < 812px). Sin estas reglas, carousel.css al
   cargar puede cambiar la orientación de .carousel-card .flex (column vs row) → CLS mínimo.
   Nota: la causa principal del CLS 0.639 era .asesor-megamenu (ver bloque anterior). ===== */
.carousel-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
}
.carousel-card {
    flex: 0 0 85%;
    min-height: 28rem;
    display: flex;
    flex-direction: column;
}
.carousel-card .flex {
    flex-direction: column;
    align-items: center;
}
.carousel-card .flex > div:last-child {
    margin-left: 0;
}
@media (max-width: 768px) {
    .carousel-card {
        flex-basis: 98%;
        min-height: 27rem;
    }
}
@media (min-width: 769px) {
    .carousel-desktop-grid {
        display: grid;
        overflow-x: visible;
    }
    .carousel-desktop-grid .carousel-card {
        flex: 1 1 300px;
        min-height: auto;
    }
    #tramites-principales .carousel-card,
    #capacitacion .carousel-card,
    #servicios-adicionales .carousel-card {
        min-height: auto;
    }
}

/* ===== SUB-SUBMENÚS ANIDADOS (MÓVIL) ===== */
.has-nested {
    position: relative;
}
.nested-btn {
    width: 100%;
    text-align: left;
    padding: 0.45rem 1rem 0.45rem 2.5rem;
    background: #e0f0ff;
    border: none;
    border-bottom: 1px solid rgba(229,231,235,0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #374151;
    cursor: pointer;
    gap: 0.5rem;
    font-weight: 500;
}
.nested-btn:hover { background: #bfdbfe; }
.nested-arrow {
    transition: transform 0.3s ease;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    stroke: #3b82f6;
}
.has-nested.nested-open .nested-arrow { transform: rotate(90deg); }
.nested-menu {
    display: none;
    background: #f0f7ff;
    border-left: none;
    margin-left: 1rem;
}
.nested-menu.show { display: block; }
.nested-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.35rem 1rem 0.35rem 1.5rem;
    border: none;
    border-bottom: 1px solid rgba(229,231,235,0.3);
    background: transparent;
    font-size: 0.68rem;
    color: #374151;
    cursor: pointer;
}
.nested-menu button:last-child { border-bottom: none; }
.nested-menu button:hover { background: #bfdbfe; color: #1e40af; }

/* ===== SCROLL SUAVE Y RÁPIDO ===== */
html {
    scroll-behavior: smooth;
}
body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none;
}

/* ===== MENÚ MOBILE — CAE DESDE ARRIBA ESTILO MOBBIN ===== */
/* Overlay entre el fondo y el menú */
#mobile-menu-overlay {
    background: rgba(0, 0, 0, 0.15) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 1400 !important;
}
/* Mobile: pill + menú = UNA SOLA PIEZA frosted glass */
@media (max-width: 1023px) {
    /* Pill encima del menú (z-index mayor) */
    #banner {
        z-index: 2000 !important;
    }
    .mobile-dropdown {
        /* Mismo ancho y posición que el pill — parecen un solo bloque */
        width: calc(100% - 1.5rem) !important;
        max-width: 820px !important;
        top: 8px !important;
        left: 50% !important;
        height: auto !important;
        max-height: calc(100vh - 16px) !important;
        /* Sin padding-top: el spacer #scroll-mask-top lo reemplaza */
        padding-top: 0 !important;
        border-right: none !important;
        /* Esquinas redondeadas en todo — igual que el pill */
        border-radius: 28px !important;
        /* Frosted glass IDÉNTICO al pill — parecen uno solo */
        background: rgba(255, 255, 255, 0.79) !important;
        backdrop-filter: saturate(180%) blur(40px) !important;
        -webkit-backdrop-filter: saturate(180%) blur(40px) !important;
        border: 1px solid rgba(255,255,255,0.55) !important;
        box-shadow: 0 8px 40px rgba(0,0,0,0.16) !important;
        z-index: 1500 !important;
        will-change: transform, opacity !important;
        /* Animación: sale desde atrás del pill hacia abajo */
        transform: translateX(-50%) translateY(-104%) !important;
        opacity: 0 !important;
        transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
                    opacity 0.18s ease-out !important;
    }
    /* Estado abierto */
    .mobile-dropdown.show {
        transform: translateX(-50%) translateY(0) !important;
        opacity: 1 !important;
    }
    /* Ocultar barra de desplazamiento visualmente */
    .mobile-dropdown::-webkit-scrollbar { display: none !important; }
    .mobile-dropdown { scrollbar-width: none !important; }
}
@media (min-width: 1024px) {
    .mobile-dropdown { width: 430px !important; top: 4rem !important; height: auto !important; }
}

/* ===== SELECTOR DE IDIOMA (PC) ===== */
.lang-selector { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); z-index: 200; }
.lang-btn {
    display: flex; align-items: center; gap: 0.3rem;
    background: rgba(0,0,0,0.30); border: 1px solid rgba(255,255,255,0.5);
    border-radius: 6px; color: #fff; font-size: 0.72rem; font-weight: 700;
    padding: 0.18rem 0.55rem; cursor: pointer; height: 22px;
    letter-spacing: 0.06em; transition: background 0.2s; white-space: nowrap;
}
.lang-btn:hover { background: rgba(0,0,0,0.45); }
.lang-arrow { transition: transform 0.25s; flex-shrink: 0; }
.lang-selector.open .lang-arrow { transform: rotate(180deg); }
.lang-dropdown {
    display: none; position: absolute; top: calc(100% + 8px); right: 0;
    background: #fff; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    overflow: hidden; min-width: 155px; z-index: 9999;
    border: 1px solid #e5e7eb;
}
.lang-selector.open .lang-dropdown { display: block; }
.lang-dropdown button {
    display: flex; align-items: center; gap: 0.55rem;
    width: 100%; text-align: left; padding: 0.5rem 1rem;
    border: none; background: transparent; font-size: 0.8rem;
    color: #1e293b; cursor: pointer; font-weight: 500; transition: background 0.15s;
    border-bottom: 1px solid #f1f5f9;
}
.lang-dropdown button:last-child { border-bottom: none; }
.lang-dropdown button:hover { background: #f0fdf4; color: #15803d; }
.lang-dropdown button.lang-active { background: #dcfce7; color: #15803d; font-weight: 700; }

/* ====================================================
   MENÚ HAMBURGUESA — DISEÑO MODERNO Y LIMPIO
   ==================================================== */

/* ── CABECERA Mobbin-style: mismo fondo que el panel (sin barra verde) ── */
#mobile-dropdown .dropdown-menu-header {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    padding: 0 1.25rem !important;
    height: 56px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
}
#mobile-dropdown .dropdown-menu-header h3 {
    color: #111827 !important;
    font-size: 0.9rem !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 600 !important;
    flex: 1 !important;
    text-align: center !important;
}
#mobile-dropdown .close-mobile-menu-btn {
    background: rgba(0,0,0,0.07) !important;
    border-radius: 50% !important;
    border: none !important;
    transition: background 0.2s, transform 0.2s !important;
    padding: 0 !important;
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}
#mobile-dropdown .close-mobile-menu-btn:hover {
    background: rgba(0,0,0,0.14) !important;
    transform: rotate(90deg) !important;
}
#mobile-dropdown .close-mobile-menu-btn svg { stroke: #111827 !important; width: 18px !important; height: 18px !important; }

/* ── ITEMS NIVEL 1 — Mobbin: big, clean, airy ── */
#mobile-dropdown .submenu-parent-btn {
    background: rgba(255, 255, 255, 0.55) !important;
    color: #111827 !important;
    border-bottom: 1px solid #e8ecef !important;
    border-left: 3px solid transparent !important;
    font-size: 1.2rem !important;
    font-weight: 500 !important;
    padding: 1rem 1.25rem 1rem 1.15rem !important;
    transition: background 0.18s, border-left-color 0.18s, color 0.18s !important;
    box-shadow: none !important;
    letter-spacing: 0.01em !important;
}
#mobile-dropdown .submenu-parent-btn:hover {
    background: rgba(240, 253, 244, 0.80) !important;
    color: #14532d !important;
    border-left-color: #86efac !important;
}
#mobile-dropdown .has-submenu.submenu-open > .submenu-parent-btn {
    background: rgba(240, 253, 244, 0.75) !important;
    color: #14532d !important;
    border-left: 8px solid #16a34a !important;
    font-weight: 700 !important;
}

/* ── Flechas ── */
#mobile-dropdown .submenu-arrow {
    stroke: #3b82f6 !important;
    width: 24px !important;
    height: 24px !important;
    stroke-width: 2.5 !important;
    flex-shrink: 0 !important;
    transition: stroke 0.18s !important;
}
#mobile-dropdown .has-submenu.submenu-open > .submenu-parent-btn .submenu-arrow {
    stroke: #3b82f6 !important;
}

/* ── Contenedor submenu ── */
#mobile-dropdown .submenu,
#mobile-dropdown .submenu.submenu-compact,
#mobile-dropdown .submenu.leyes-compactas {
    background: rgba(248, 250, 252, 0.55) !important;
    border-left: 5px solid #22c55e !important;
    margin-left: 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

/* ── Items dentro del submenu ── */
#mobile-dropdown .submenu button,
#mobile-dropdown .submenu.submenu-compact button,
#mobile-dropdown .submenu.leyes-compactas button {
    background: transparent !important;
    color: #374151 !important;
    border-bottom: 1px solid #e8ecef !important;
    font-size: 0.82rem !important;
    padding-top: 0.55rem !important;
    padding-bottom: 0.55rem !important;
    padding-left: 1.8rem !important;
    padding-right: 0.8rem !important;
    display: flex !important;
    align-items: center !important;
    transition: background 0.15s, color 0.15s !important;
    box-shadow: none !important;
}
/* SPD badge de submenu: alineado a la derecha */
#mobile-dropdown .submenu button .spd-badge-dark,
#mobile-dropdown .submenu.submenu-compact button .spd-badge-dark,
#mobile-dropdown .submenu.leyes-compactas button .spd-badge-dark {
    margin-left: auto !important;
    flex-shrink: 0 !important;
}
#mobile-dropdown .submenu button:hover,
#mobile-dropdown .submenu.submenu-compact button:hover,
#mobile-dropdown .submenu.leyes-compactas button:hover {
    background: #bfdbfe !important;
    color: #1e40af !important;
}

/* ── Títulos de columnas ── */
#mobile-dropdown .submenu-title {
    color: #237c4e !important;
    background: #e8f5ee !important;
    font-size: 0.62rem !important;
    letter-spacing: 0.1em !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
}

/* ── Botones de acción al fondo ── */
#mobile-dropdown .menu-item-stack {
    background: rgba(255, 255, 255, 0.55) !important;
    color: #111827 !important;
    border-bottom: 1px solid #e8ecef !important;
    border-left: 3px solid transparent !important;
    font-size: 1.2rem !important;
    font-weight: 500 !important;
    padding: 1rem 1.25rem 1rem 1.15rem !important;
    transition: all 0.18s !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    text-align: left !important;
}
#mobile-dropdown .menu-item-stack:hover {
    background: #f0fdf4 !important;
    color: #14532d !important;
    border-left-color: #22c55e !important;
}

/* Badges SPD — amarillo sólido (como el look del PC) */
#mobile-dropdown .spd-badge-dark {
    background: #fde047 !important;
    border: 1px solid #ca8a04 !important;
    color: #713f12 !important;
    font-weight: 800 !important;
}

/* Sub-submenús nested */
#mobile-dropdown .submenu.submenu-compact button.nested-btn,
#mobile-dropdown .submenu.leyes-compactas button.nested-btn,
#mobile-dropdown .submenu button.nested-btn,
#mobile-dropdown button.nested-btn {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-bottom: 1px solid rgba(147, 197, 253, 0.5) !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    padding-left: 1.8rem !important;
    justify-content: flex-start !important;
}
/* SPD del nested-btn: empujar a la derecha, dejando espacio para la flecha */
#mobile-dropdown button.nested-btn .spd-badge-dark {
    margin-left: auto !important;
    margin-right: 0.4rem !important;
    flex-shrink: 0 !important;
}
/* Items del nested-menu: flex para alinear SPD al mismo nivel */
#mobile-dropdown .nested-menu button {
    display: flex !important;
    align-items: center !important;
}
#mobile-dropdown .nested-menu button .spd-badge-dark {
    margin-left: auto !important;
    flex-shrink: 0 !important;
    margin-right: calc(22px + 0.4rem + 0.5rem) !important;
}
#mobile-dropdown .submenu.submenu-compact button.nested-btn:hover,
#mobile-dropdown .submenu.leyes-compactas button.nested-btn:hover,
#mobile-dropdown .submenu button.nested-btn:hover,
#mobile-dropdown button.nested-btn:hover {
    background: #bfdbfe !important;
    color: #1e40af !important;
}
#mobile-dropdown .nested-arrow {
    stroke: #3b82f6 !important;
    width: 24px !important;
    height: 24px !important;
    stroke-width: 2.5 !important;
}
#mobile-dropdown .nested-menu {
    background: #f5f9ff !important;
    border-left: none !important;
}
#mobile-dropdown .submenu .nested-menu button,
#mobile-dropdown .submenu.submenu-compact .nested-menu button,
#mobile-dropdown .nested-menu button {
    color: #1d4ed8 !important;
    font-size: 0.72rem !important;
    border-bottom: 1px solid rgba(147, 197, 253, 0.3) !important;
    background: transparent !important;
    padding-left: 1.8rem !important;
}
#mobile-dropdown .submenu .nested-menu button:hover,
#mobile-dropdown .submenu.submenu-compact .nested-menu button:hover,
#mobile-dropdown .submenu.leyes-compactas .nested-menu button:hover,
#mobile-dropdown .nested-menu button:hover {
    background: #bfdbfe !important;
    color: #1e40af !important;
}

    /* ========================================
       NAVBAR PILL STYLE
       ======================================== */

    /* ── MOBILE (≤1023px): pill fija, blanca, pill shape ── */
    @media (max-width: 1023px) {
        #banner {
            left: 50% !important;
            right: auto !important;
            transform: translateX(-50%) !important;
            top: 8px !important;
            width: calc(100% - 1.5rem) !important;
            max-width: 820px !important;
            height: 67px !important;
            border-radius: 9999px !important;
            background: rgba(255, 255, 255, 0.60) !important;
            backdrop-filter: saturate(180%) blur(40px) !important;
            -webkit-backdrop-filter: saturate(180%) blur(40px) !important;
            border: 1px solid rgba(255,255,255,0.45) !important;
            border-bottom: 1px solid rgba(255,255,255,0.45) !important;
            box-shadow: 0 2px 16px rgba(0,0,0,0.10) !important;
        }
        /* Layout interno mobile: hamburger+logo | search | counter */
        #banner > div {
            display: flex !important;
            align-items: center !important;
            overflow: hidden !important;
            padding-left: 0.5rem !important;
            padding-right: 0.75rem !important;
        }
        #banner > div > div:first-child {
            flex: 0 0 auto !important;
        }
        #search-center-container {
            flex: 1 1 0 !important;
            min-width: 0 !important;
            display: flex !important;
            justify-content: center !important;
            padding: 0 !important;
            overflow: hidden !important;
        }
        #banner > div > div:last-child {
            flex: 0 0 auto !important;
            display: flex !important;
            align-items: center !important;
        }
    }

    /* ── PC (≥1024px): pill FIJA + semitransparente con blur (estilo Mobbin) ── */
    @media (min-width: 1024px) {
        #banner {
            position: fixed !important;
            left: 50% !important;
            right: auto !important;
            transform: translateX(-50%) !important;
            top: 8px !important;
            width: calc(100% - 4rem) !important;
            max-width: 900px !important;
            height: 52px !important;

            /* Semitransparente + blur (estilo Mobbin) */
            background: rgba(255, 255, 255, 0.70) !important;
            backdrop-filter: saturate(180%) blur(18px) !important;
            -webkit-backdrop-filter: saturate(180%) blur(18px) !important;
            border: 1px solid rgba(255, 255, 255, 0.5) !important;
            border-bottom: 1px solid rgba(255, 255, 255, 0.5) !important;
            box-shadow: 0 2px 20px rgba(0,0,0,0.08) !important;
            border-radius: 9999px !important;
            z-index: 1200 !important;
            overflow: hidden !important;
        }

        /* Sin padding en body — el hero llega hasta arriba como Mobbin */
        body { padding-top: 0 !important; }

        /* Pill PC: logo izq | buscador centro | contador der — equitativo */
        #banner > div {
            display: flex !important;
            align-items: center !important;
            padding-left: 1rem !important;
            padding-right: 1rem !important;
            overflow: hidden !important;
            gap: 0.5rem !important;
        }
        #banner > div > div:first-child {
            flex: 0 0 auto !important;
            justify-content: flex-start !important;
        }
        #search-center-container {
            flex: 1 1 0 !important;
            min-width: 0 !important;
            display: flex !important;
            justify-content: center !important;
            padding: 0 0.5rem !important;
            overflow: hidden !important;
        }
        #global-search-button {
            width: 100% !important;
            max-width: 400px !important;
            margin-right: 0 !important;
            flex: 0 1 auto !important;
        }
        #banner > div > div:last-child {
            flex: 0 0 auto !important;
            display: flex !important;
            justify-content: flex-end !important;
            align-items: center !important;
        }

        /* Barra verde: se queda arriba del carrusel y sube al hacer scroll */
        .desktop-navbar {
            position: absolute !important;
            top: 64px !important;
            left: 0 !important;
            right: 0 !important;
            z-index: 1100 !important;
        }
        /* Ancla el absolute al body + evita colapso de márgenes con homepage-section */
        body { position: relative; display: flow-root; }

        /* Mobile-dropdown debajo de pill + barra verde */
        .mobile-dropdown {
            top: 98px !important;
            height: calc(100vh - 98px) !important;
        }

        /* Panel desktop debajo de la barra verde */
        #desktop-submenu-panel { top: 64px !important; }
    }

    /* ── DRILL-DOWN MOBILE NAVIGATION ── */
    @media (max-width: 1023px) {
        /* Dropdown: flex-column, NO scrollea — solo drill-main-panel scrollea */
        #mobile-dropdown { overflow: hidden !important; scrollbar-width: none !important;
            display: flex !important; flex-direction: column !important; }
        #mobile-dropdown::-webkit-scrollbar { display: none !important; }
        #mobile-dropdown.show { overflow: hidden !important; }

        /* Spacer fijo 67px — ocupa zona del pill, no scrollea */
        #scroll-mask-top {
            height: 67px;
            flex-shrink: 0;
            pointer-events: none;
        }

        /* Solo drill-main-panel scrollea */
        #drill-main-panel {
            flex: 1;
            overflow-y: auto !important;
            overflow-x: hidden !important;
            scrollbar-width: none !important;
            transition: transform 0.26s cubic-bezier(0.16,1,0.3,1), opacity 0.20s ease;
            will-change: transform, opacity;
        }
        #drill-main-panel::-webkit-scrollbar { display: none !important; }
        #drill-main-panel.pushed {
            transform: translateX(-20%);
            opacity: 0.2;
            pointer-events: none;
        }
        /* Overlay oscuro detrás de la ventana */
        #drill-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.40);
            z-index: 2400;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.24s ease;
        }
        #drill-overlay.active { opacity: 1; pointer-events: auto; }

        #drill-detail-panel {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.92);
            width: 97%;
            max-width: 520px;
            height: 82vh;
            background: #f8faf8;
            border-radius: 20px;
            box-shadow: 0 24px 60px rgba(0,0,0,0.22);
            overflow-y: auto;
            overflow-x: hidden;
            z-index: 2500;
            opacity: 0;
            pointer-events: none;
            transition: transform 0.26s cubic-bezier(0.16,1,0.3,1),
                        opacity 0.22s ease;
            will-change: transform, opacity;
        }
        #drill-detail-panel.active {
            transform: translate(-50%, -50%) scale(1);
            opacity: 1;
            pointer-events: auto;
        }

        #drill-header {
            position: sticky;
            top: 0;
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            align-items: center;
            padding: 14px 18px;
            padding-top: max(14px, env(safe-area-inset-top));
            background: rgba(255,255,255,0.96);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-bottom: 1px solid rgba(0,0,0,0.07);
            z-index: 10;
        }
        #drill-back-btn {
            display: flex;
            align-items: center;
            gap: 4px;
            background: none;
            border: none;
            color: #16a34a;
            font-size: 1.2rem;
            font-weight: 700;
            cursor: pointer;
            padding: 6px 10px 6px 2px;
            border-radius: 10px;
            flex-shrink: 0;
            -webkit-tap-highlight-color: transparent;
        }
        #drill-back-btn svg {
            width: 28px !important;
            height: 28px !important;
            stroke-width: 2.8 !important;
        }
        #drill-back-btn:active { background: rgba(22,163,74,0.10); }
        #drill-title {
            font-weight: 700;
            font-size: 1.25rem;
            color: #111;
            text-align: center;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            grid-column: 2;
        }
        #drill-content {
            padding: 8px 0 48px;
        }
        /* SPD amarillo y alineado en el panel de detalle */
        #drill-content button {
            display: flex !important;
            align-items: center !important;
            justify-content: space-between !important;
        }
        #drill-content .spd-badge,
        #drill-content .spd-badge-dark {
            background: #facc15 !important;
            border: 1px solid #eab308 !important;
            color: #713f12 !important;
            font-size: 10px !important;
            font-weight: 800 !important;
            padding: 2px 6px !important;
            border-radius: 4px !important;
            margin-left: auto !important;
            flex-shrink: 0 !important;
            letter-spacing: 0.05em !important;
        }

        /* Forzar columna única y textos grandes en el panel de detalle */
        #drill-content .submenu.leyes-compactas {
            display: flex !important;
            flex-direction: column !important;
            column-count: unset !important;
        }
        #drill-content .submenu.leyes-compactas .submenu-column {
            width: 100% !important;
            max-width: 100% !important;
        }
        #drill-content .submenu button,
        #drill-content .submenu.submenu-compact button,
        #drill-content .submenu.leyes-compactas button {
            font-size: 1.05rem !important;
            padding: 15px 20px !important;
            min-height: 54px !important;
            width: 100% !important;
            text-align: left !important;
        }
        /* Color y fondo azul en items del drill panel — regla separada para asegurar aplicación */
        #drill-detail-panel #drill-content .submenu button {
            color: #1d4ed8 !important;
            background-color: #eff6ff !important;
            border-bottom: 1px solid rgba(147,197,253,0.4) !important;
        }
        #drill-content .submenu-title {
            font-size: 0.72rem !important;
            letter-spacing: 0.08em !important;
            padding: 14px 20px 6px !important;
        }
        #drill-content button.nested-btn {
            font-size: 1.05rem !important;
            padding: 15px 20px !important;
            min-height: 54px !important;
        }
        /* Subtítulos con sub-submenú: azul más oscuro (igual a Leyes/Decretos/Resoluciones) */
        #drill-detail-panel #drill-content .has-nested button.nested-btn {
            color: #1e3a8a !important;
            background-color: #dbeafe !important;
            border-bottom: 1px solid rgba(96,165,250,0.35) !important;
        }
        /* Ítems internos del sub-submenú: azul muy claro */
        #drill-detail-panel #drill-content .nested-menu button {
            color: #1d4ed8 !important;
            background-color: #f5f9ff !important;
            border-bottom: 1px solid rgba(147,197,253,0.3) !important;
        }
        #drill-content .nested-menu button {
            font-size: 1.05rem !important;
            padding: 13px 20px 13px 32px !important;
            min-height: 50px !important;
        }
        /* Hover uniforme azul en TODOS los items del panel de detalle */
        #drill-detail-panel #drill-content .submenu button:hover,
        #drill-detail-panel #drill-content .drill-collapsible.open button:hover,
        #drill-detail-panel #drill-content button.nested-btn:hover,
        #drill-detail-panel #drill-content .nested-menu button:hover {
            background-color: #bfdbfe !important;
            color: #1e40af !important;
        }

        /* Submenu completamente visible dentro del panel de detalle */
        #drill-content .submenu,
        #drill-content .submenu.submenu-compact,
        #drill-content .submenu.leyes-compactas {
            display: block !important;
            max-height: none !important;
            overflow: visible !important;
            background: transparent !important;
            height: auto !important;
        }
        /* Sin glow en drill-down */
        #drill-content .has-submenu.submenu-open {
            box-shadow: none !important;
        }
        /* Secciones colapsables dentro del panel (Leyes / Decretos / Resoluciones) */
        /* Títulos de sección: fondo azul más oscuro, letra igual que los otros items del menú */
        #drill-content .drill-collapsible .submenu-title {
            display: flex !important;
            justify-content: space-between !important;
            align-items: center !important;
            padding: 15px 20px !important;
            font-size: 1.05rem !important;
            font-weight: 500 !important;
            letter-spacing: 0 !important;
            color: #1e3a8a !important;
            background-color: #dbeafe !important;
            border-bottom: 1px solid rgba(96, 165, 250, 0.35) !important;
            cursor: pointer !important;
            user-select: none !important;
            min-height: 54px !important;
        }
        #drill-content .drill-collapsible .submenu-title:active {
            background-color: #bfdbfe !important;
        }
        /* Ítems dentro de sección abierta: fondo azul más claro que el título */
        #drill-detail-panel #drill-content .drill-collapsible.open button {
            color: #1d4ed8 !important;
            background-color: #f5f9ff !important;
        }
        /* Chevron de secciones colapsables — azul */
        .drill-chevron {
            width: 24px !important;
            height: 24px !important;
            stroke: #3b82f6 !important;
            flex-shrink: 0;
            transition: transform 0.22s cubic-bezier(0.16,1,0.3,1);
        }
        #drill-content .drill-collapsible.open .drill-chevron {
            transform: rotate(90deg);
        }
        /* submenu-arrow ya unificado en bloque global (24px, #3b82f6) */
        /* Botones de cada sección: ocultos por defecto, visibles al abrir */
        #drill-content .submenu .drill-collapsible button,
        #drill-content .submenu.leyes-compactas .drill-collapsible button {
            display: none !important;
        }
        #drill-content .submenu .drill-collapsible.open button,
        #drill-content .submenu.leyes-compactas .drill-collapsible.open button {
            display: flex !important;
        }
    }

    /* Los SVG del banner en negro */
    #banner svg { color: #111827; }
    #banner .font-bold { color: #111827; }
    /* Transición suave hamburger → X */
    #menu-icon-hamburger, #menu-icon-close {
        transition: opacity 0.2s ease;
    }

    @media (max-width: 1023px) {
        /* Pill con frosted glass igual al panel cuando el menú está abierto — enmascara el scroll interno */
        #banner.menu-open {
            background: transparent !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
            border: none !important;
            box-shadow: none !important;
        }
        /* Todos los ítems del menú: transparentes — el frosted glass del panel lo da todo */
        #mobile-dropdown .submenu-parent-btn {
            background: transparent !important;
        }
        #mobile-dropdown .submenu,
        #mobile-dropdown .submenu.submenu-compact,
        #mobile-dropdown .submenu.leyes-compactas {
            background: rgba(220, 252, 231, 0.25) !important;
        }
        #mobile-dropdown .submenu button,
        #mobile-dropdown .submenu.submenu-compact button,
        #mobile-dropdown .submenu.leyes-compactas button {
            background: rgba(220, 252, 231, 0.45) !important;
        }
        #mobile-dropdown .menu-item-stack {
            background: transparent !important;
        }
        /* Sección abierta: glow verde alrededor de toda la tarjeta */
        #mobile-dropdown .has-submenu.submenu-open {
            box-shadow: 0 0 0 2.5px #16a34a, 0 4px 16px rgba(22,163,74,0.15) !important;
            border-radius: 10px !important;
            overflow: hidden !important;
            margin: 3px 0 !important;
            transition: box-shadow 0.2s ease !important;
        }
        #mobile-dropdown .has-submenu.submenu-open > .submenu-parent-btn {
            background: rgba(187, 247, 208, 0.65) !important;
        }
        #mobile-dropdown .submenu-parent-btn:hover {
            background: rgba(187, 247, 208, 0.45) !important;
        }
        #mobile-dropdown .dropdown-menu-content {
            padding-top: 0.25rem !important;
            background: transparent !important;
        }
    }
    
