/**
 * ==========================================================================
 * ESTILOS MÓDULO: MENÚ FLOTANTE Y HORIZONTAL (NochisGo)
 * ==========================================================================
 */

/* ==========================================
   VARIABLES GLOBALES DE TEMA PARA EL MENÚ
   ========================================== */
:root {
    --menu-color-primary: #0A84FF;
    --menu-color-bg: rgba(255, 255, 255, 0.95);
    --menu-color-border: rgba(10, 132, 255, 0.3);
    --menu-color-text: #1d1d1f;
    --menu-btn-width: 75px; /* Valor por defecto para el ancho de los botones */
}

html.dark-theme, body.dark-theme {
    --menu-color-primary: #ff9f0a;
    --menu-color-bg: rgba(30, 41, 59, 0.95);
    --menu-color-border: rgba(255, 159, 10, 0.3);
    --menu-color-text: #ffffff;
}

/* Temas Dinámicos en Modo Claro */
.theme-comida { 
    --menu-color-primary: #e67e22; 
    --menu-color-border: rgba(230, 126, 34, 0.3); 
}
.theme-ayuntamiento { 
    --menu-color-primary: #e74c3c; 
    --menu-color-border: rgba(231, 76, 60, 0.3); 
}

/* EL TEMA DE FERIA (OCTUBRE) FUERZA EL FONDO MORADO OSCURO SIEMPRE */
.theme-feria { 
    --menu-color-primary: #bf5af2 !important; 
    --menu-color-bg: rgba(26, 11, 46, 0.95) !important; 
    --menu-color-border: rgba(191, 90, 242, 0.4) !important; 
    --menu-color-text: #ffffff !important;
}

.theme-san-sebastian { 
    --menu-color-primary: #e74c3c; 
    --menu-color-border: rgba(231, 76, 60, 0.3); 
}
.theme-hijo-ausente { 
    --menu-color-primary: #d4af37; 
    --menu-color-border: rgba(212, 175, 55, 0.3); 
}

/* EL TEMA NAVIDEÑO FUERZA LA ESTÉTICA INVERNAL Y FESTIVA */
html.navidad-theme, body.navidad-theme, .navidad-theme {
    --menu-color-primary: #e4002b !important;
    --menu-color-bg: rgba(15, 30, 56, 0.92) !important;
    --menu-color-border: rgba(255, 215, 0, 0.4) !important;
    --menu-color-text: #ffffff !important;
}

/* --- OCULTAR MENÚ FLOTANTE AL ABRIR MODALES --- */
body.hide-floating-menus #mainTriggerPill,
body.hide-floating-menus #mobileHorizontalMenu {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ==========================================
   MENÚ PÍLDORA INFERIOR FLOTANTE (Glassmorphism Puro)
   ========================================== */
.mobile-menu-trigger {
    display: flex !important;
    flex-direction: row;
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(30px); 
    z-index: 10000;
    height: 60px;
    min-width: 75px;
    padding: 0;
    background-color: var(--menu-color-bg) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--menu-color-border);
    color: var(--menu-color-primary);
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    opacity: 0; 
    overflow: hidden;
}

.mobile-menu-trigger.btn-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

body.dark-theme .mobile-menu-trigger, html.dark-theme .mobile-menu-trigger,
body.navidad-theme .mobile-menu-trigger, html.navidad-theme .mobile-menu-trigger {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.mobile-menu-trigger.active {
    background-color: var(--menu-color-primary) !important;
    color: white !important;
    border-color: transparent !important;
    transform: translateX(-50%) scale(1.05) !important;
    box-shadow: 0 10px 30px var(--menu-color-border) !important;
}

.pill-btn {
    background: transparent; 
    border: none; 
    color: inherit;
    height: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 1.2rem; 
    font-weight: 700; 
    cursor: pointer; 
    transition: all 0.4s ease;
    padding: 0; 
    width: var(--menu-btn-width); 
    flex-shrink: 0;
}

.pill-btn.scroll-btn { 
    width: 0; 
    opacity: 0; 
    pointer-events: none; 
}
.pill-btn.scroll-btn.visible { 
    width: var(--menu-btn-width); 
    opacity: 1; 
    pointer-events: auto; 
}

.pill-btn .menu-text {
    display: inline-block; 
    max-width: 0; 
    opacity: 0; 
    overflow: hidden;
    margin-left: 0; 
    transition: max-width 0.4s ease, opacity 0.4s ease, margin-left 0.4s ease; 
    vertical-align: middle;
}

.mobile-menu-trigger:hover .menu-text,
.mobile-menu-trigger.active .menu-text {
    max-width: 100px; 
    opacity: 1; 
    margin-left: 8px;
}

.mobile-menu-trigger:hover .pill-btn.menu-btn,
.mobile-menu-trigger.active .pill-btn.menu-btn {
    width: auto; 
    padding: 0 25px;
}

@media (max-width: 768px) {
    .mobile-menu-trigger:hover .menu-text,
    .mobile-menu-trigger.active .menu-text {
        max-width: 0 !important;
        opacity: 0 !important;
        margin-left: 0 !important;
    }
    .mobile-menu-trigger:hover .pill-btn.menu-btn,
    .mobile-menu-trigger.active .pill-btn.menu-btn {
        width: var(--menu-btn-width) !important;
        padding: 0 !important;
    }
}

/* ==========================================
   MENÚ HORIZONTAL DESPLEGABLE (Glassmorphism Puro)
   ========================================== */
.mobile-horizontal-menu {
    display: flex !important; 
    position: fixed; 
    bottom: calc(95px + env(safe-area-inset-bottom, 0px)); 
    left: 50%;
    transform: translateX(-50%) translateY(20px) scale(0.95); 
    width: fit-content; 
    max-width: calc(100% - 20px);
    background-color: var(--menu-color-bg) !important; 
    backdrop-filter: blur(25px); 
    -webkit-backdrop-filter: blur(25px); 
    border: 1px solid var(--menu-color-border);
    border-radius: 20px; 
    padding: 15px; 
    gap: 15px; 
    overflow-x: auto; 
    scroll-snap-type: x mandatory;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2); 
    z-index: 9999; 
    opacity: 0; 
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); 
    -ms-overflow-style: none; 
    scrollbar-width: none;
}

.mobile-horizontal-menu::-webkit-scrollbar { 
    display: none; 
}

.mobile-horizontal-menu.active {
    opacity: 1 !important; 
    transform: translateX(-50%) translateY(0) scale(1) !important; 
    pointer-events: auto !important;
}

body.dark-theme .mobile-horizontal-menu, html.dark-theme .mobile-horizontal-menu,
body.navidad-theme .mobile-horizontal-menu, html.navidad-theme .mobile-horizontal-menu {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.mh-item {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: flex-start;
    width: 75px; 
    min-width: 75px; 
    flex-shrink: 0;
    scroll-snap-align: start; 
    text-decoration: none; 
    color: var(--menu-color-text);
    font-size: 0.75rem; 
    font-weight: 600; 
    gap: 8px; 
    text-align: center; 
    transition: 0.3s;
}

.mh-icon {
    width: 50px; 
    height: 50px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    background: rgba(134, 134, 139, 0.1); 
    color: var(--menu-color-primary); 
    border-radius: 50%; 
    font-size: 1.3rem; 
    transition: 0.3s; 
    position: relative;
}

.mh-item:active .mh-icon, .mh-item.active .mh-icon {
    background: var(--menu-color-primary); 
    color: white; 
    transform: translateY(-3px); 
    box-shadow: 0 5px 15px var(--menu-color-border);
}

.mobile-horizontal-menu .btn-darkmode, .mobile-horizontal-menu .btn-lang, .mobile-horizontal-menu .btn-navidad-mode {
    background: transparent !important; 
    box-shadow: none !important; 
    border: none !important; 
    padding: 0 !important; 
    width: auto !important; 
    height: auto !important; 
    border-radius: 0 !important; 
    display: flex !important; 
    cursor: pointer;
}

.mh-icon.triangle-icon { 
    border-radius: 8px !important; 
    clip-path: polygon(50% 10%, 5% 90%, 95% 90%) !important; 
}
.mh-icon.triangle-icon i { 
    transform: translateY(8px); 
}

.mh-icon.icon-san-sebastian { 
    color: #e74c3c; 
    background: rgba(231, 76, 60, 0.1); 
}
.mh-item.active .mh-icon.icon-san-sebastian, .mh-item:active .mh-icon.icon-san-sebastian { 
    background: #e74c3c; 
    color: white; 
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3); 
}

.mh-icon.icon-hijo-ausente { 
    color: #d4af37; 
    background: rgba(212, 175, 55, 0.1); 
}
.mh-item.active .mh-icon.icon-hijo-ausente, .mh-item:active .mh-icon.icon-hijo-ausente { 
    background: #d4af37; 
    color: white; 
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3); 
}

.mh-icon.icon-fiesta-musica { 
    color: #bf5af2; 
    background: rgba(191, 90, 242, 0.1); 
}
.mh-item.active .mh-icon.icon-fiesta-musica, .mh-item:active .mh-icon.icon-fiesta-musica { 
    background: #bf5af2; 
    color: white; 
    box-shadow: 0 5px 15px rgba(191, 90, 242, 0.3); 
}

.mh-icon.icon-fiestas-octubre { 
    color: #bf5af2; 
    background: rgba(191, 90, 242, 0.1); 
}
.mh-item.active .mh-icon.icon-fiestas-octubre, .mh-item:active .mh-icon.icon-fiestas-octubre { 
    background: #bf5af2; 
    color: white; 
    box-shadow: 0 5px 15px rgba(191, 90, 242, 0.3); 
}

.mh-icon.icon-artistas-octubre { 
    color: #bf5af2; 
    background: rgba(191, 90, 242, 0.1); 
}
.mh-item.active .mh-icon.icon-artistas-octubre, .mh-item:active .mh-icon.icon-artistas-octubre { 
    background: #bf5af2; 
    color: white; 
    box-shadow: 0 5px 15px rgba(191, 90, 242, 0.3); 
}