/* --- Estilos para la Barra de Navegación Móvil (Inferior) --- */
.mobile-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background-color: var(--md-sys-color-surface-container);
    display: none;
    /* Se activa por media query */
    justify-content: space-around;
    align-items: flex-start;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    z-index: 1000;
    padding: 0 4px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.navbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--md-sys-color-on-surface-variant);
    flex: 1;
    padding-top: 12px;
    padding-bottom: 16px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: color 0.2s ease-in-out;
}

.navbar-item.active {
    pointer-events: none;
    cursor: default;
}

.navbar-icon-container {
    width: 64px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    margin-bottom: 4px;
    position: relative;
    /* The main background transition is for the active state color */
    transition: background-color 0.2s ease-in-out;
}

/* We use a pseudo-element for the hover state layer.
   This prevents the container's opacity from affecting the icon inside. */
.navbar-icon-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--md-sys-color-on-surface);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    z-index: 0;
}

.navbar-item:not(.active):hover .navbar-icon-container::before {
    opacity: 0.08;
}

@keyframes navbar-icon-grade-in {
    from {
        font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    }

    to {
        font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 150, 'opsz' 24;
    }
}

.navbar-item .material-symbols-outlined {
    font-size: 24px;
    position: relative;
    /* Places the icon above the pseudo-element */
    z-index: 1;
    color: var(--md-sys-color-on-surface-variant);
    /* Default color for non-active items */
    transition: color 0.2s ease-in-out;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.navbar-item:not(.active):hover .material-symbols-outlined {
    color: var(--md-sys-color-on-surface);
    /* Hover color for non-active items */
    animation: navbar-icon-grade-in 0.1s ease-in-out forwards;
}

.navbar-icon-svg {
    width: 24px;
    height: 24px;
    position: relative;
    /* Places the icon above the pseudo-element */
    z-index: 1;
    background-color: var(--md-sys-color-on-surface-variant);
    /* Default color for non-active items */
    transition: background-color 0.2s ease-in-out;
    -webkit-mask-image: url('/archivos/insumos/logo-cesfam-mini/Cesfam Dalcahue Mini Mono.svg');
    mask-image: url('/archivos/insumos/logo-cesfam-mini/Cesfam Dalcahue Mini Mono.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.navbar-item:not(.active):hover .navbar-icon-svg {
    background-color: var(--md-sys-color-on-surface);
    /* Hover color for non-active items */
}

.navbar-label {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 16px;
}

/* --- Estados Activos de la Navegación Móvil (Material Design Extended Colors) --- */
/* Active Indicator uses Color Container, Icon uses On Color Container, Label uses Color */

.navbar-item.nav-item-ubicaciones.active .navbar-icon-container {
    background-color: var(--md-extended-color-ubicaciones-color-container);
}

.navbar-item.nav-item-ubicaciones.active .material-symbols-outlined {
    color: var(--md-extended-color-ubicaciones-on-color-container);
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.navbar-item.nav-item-ubicaciones.active .navbar-label {
    color: var(--md-extended-color-ubicaciones-color);
    font-weight: 700;
}

.navbar-item.nav-item-programas.active .navbar-icon-container {
    background-color: var(--md-extended-color-programas-color-container);
}

.navbar-item.nav-item-programas.active .material-symbols-outlined {
    color: var(--md-extended-color-programas-on-color-container);
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.navbar-item.nav-item-programas.active .navbar-label {
    color: var(--md-extended-color-programas-color);
    font-weight: 700;
}

.navbar-item.nav-item-contacto.active .navbar-icon-container {
    background-color: var(--md-extended-color-contacto-color-container);
}

.navbar-item.nav-item-contacto.active .material-symbols-outlined {
    color: var(--md-extended-color-contacto-on-color-container);
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.navbar-item.nav-item-contacto.active .navbar-label {
    color: var(--md-extended-color-contacto-color);
    font-weight: 700;
}

.navbar-item.nav-item-about.active .navbar-icon-container {
    background-color: var(--md-extended-color-about-color-container);
}

.navbar-item.nav-item-about.active .navbar-icon-svg {
    background-color: var(--md-extended-color-about-on-color-container);
}

.navbar-item.nav-item-about.active .navbar-label {
    color: var(--md-extended-color-about-color);
    font-weight: 700;
}


/* Media Query para mostrar la barra de navegación móvil */
@media (max-width: 768px) {
    .mobile-navbar {
        display: flex;
    }
}