/* ============================================================
   QUIMIKA — Navegación (escritorio y móvil)
   Cargar DESPUÉS de assets/style.css y de los CSS de página.
   ============================================================ */

/* Menú lateral — escritorio */
.sidebar .menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar .menu a,
.sidebar .menu .logout-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    font-size: 14px;
    line-height: 1.35;
    text-decoration: none;
}

.sidebar .menu svg,
.sidebar .menu .icon {
    display: block;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    stroke-width: 1.8;
}

/* Menú inferior: oculto en pantallas amplias */
nav.bottom-nav {
    display: none;
}

/* Menú inferior para celulares y tabletas pequeñas */
@media (max-width: 768px) {
    /* Cambiamos el menú lateral por el inferior */
    body .app > .sidebar {
        display: none;
    }

    /* Dejamos espacio para que el menú no tape el contenido */
    body {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    nav.bottom-nav {
        position: fixed;
        z-index: 1000;
        inset: auto 0 0 0;
        box-sizing: border-box;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: stretch;
        width: 100%;
        max-width: 100%;
        min-height: 64px;
        padding: 7px max(7px, env(safe-area-inset-right, 0px)) calc(7px + env(safe-area-inset-bottom, 0px)) max(7px, env(safe-area-inset-left, 0px));
        margin: 0;
        background: #151023;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.22);
        overflow: hidden;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    nav.bottom-nav > a {
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-width: 0;
        width: 100%;
        min-height: 48px;
        padding: 4px 1px;
        margin: 0;
        border: 0;
        border-radius: 10px;
        color: #c7c0d5;
        background: transparent;
        text-align: center;
        text-decoration: none;
        font-family: inherit;
        font-size: 10px;
        font-weight: 500;
        line-height: 1.15;
        letter-spacing: 0;
        white-space: normal;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
    }

    nav.bottom-nav > a > svg,
    nav.bottom-nav > a > i {
        display: block;
        width: 21px;
        height: 21px;
        min-width: 21px;
        min-height: 21px;
        flex: 0 0 21px;
        stroke-width: 1.8;
    }

    nav.bottom-nav > a > span {
        display: block;
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 0;
        font-size: inherit;
        font-weight: inherit;
        line-height: inherit;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: clip;
    }

    nav.bottom-nav > a.active,
    nav.bottom-nav > a[aria-current="page"] {
        color: #fff;
        background: rgba(177, 104, 255, 0.16);
        font-weight: 700;
    }

    nav.bottom-nav > a:focus-visible {
        outline: 2px solid #b995ff;
        outline-offset: -2px;
    }
}

/* En teléfonos muy estrechos, reducimos un poco la tipografía */
@media (max-width: 360px) {
    nav.bottom-nav > a {
        font-size: 9px;
        gap: 3px;
    }

    nav.bottom-nav > a > svg,
    nav.bottom-nav > a > i {
        width: 19px;
        height: 19px;
        min-width: 19px;
        min-height: 19px;
        flex-basis: 19px;
    }
}


/*
|--------------------------------------------------------------------------
| QUIMIKA - NAVEGACIÓN INFERIOR MÓVIL
|--------------------------------------------------------------------------
|
| Cinco elementos uniformes.
| Iconos y textos pequeños.
| Compatible con pantallas reducidas.
|
*/

@media (max-width: 768px) {

    .bottom-nav {
        position: fixed;

        left: 0;
        right: 0;
        bottom: 0;

        z-index: 1000;

        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));

        width: 100%;

        min-height: 64px;

        padding:
            7px
            max(6px, env(safe-area-inset-right))
            calc(7px + env(safe-area-inset-bottom))
            max(6px, env(safe-area-inset-left));

        background: #10101a;

        border-top: 1px solid rgba(255, 255, 255, 0.10);

        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.20);

        box-sizing: border-box;
    }

    .bottom-nav a {
        display: flex;
        flex-direction: column;

        align-items: center;
        justify-content: center;

        min-width: 0;
        min-height: 48px;

        gap: 5px;
        padding: 4px 1px;

        color: #aaa6b8;

        font-size: 10px;
        font-weight: 500;
        line-height: 1.2;

        text-align: center;
        text-decoration: none;

        border: 0;
        border-radius: 10px;

        box-sizing: border-box;

        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav a svg,
    .bottom-nav a i {
        display: block;

        width: 20px !important;
        height: 20px !important;

        flex: 0 0 20px;

        stroke-width: 1.8;
    }

    .bottom-nav a span {
        display: block;

        max-width: 100%;

        font-size: 10px !important;
        font-weight: 500;
        line-height: 1.2;

        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .bottom-nav a.active,
    .bottom-nav a[aria-current="page"] {
        color: #ffad84;

        background: rgba(255, 120, 95, 0.10);
    }

    .bottom-nav a.active span,
    .bottom-nav a[aria-current="page"] span {
        font-weight: 700;
    }

    .bottom-nav a:focus-visible {
        outline: 2px solid #ffad84;
        outline-offset: -2px;
    }

    body {
        padding-bottom: calc(
            78px + env(safe-area-inset-bottom)
        );
    }

}

/*
|--------------------------------------------------------------------------
| PANTALLAS MUY PEQUEÑAS
|--------------------------------------------------------------------------
*/

@media (max-width: 360px) {

    .bottom-nav a {
        gap: 4px;
    }

    .bottom-nav a svg,
    .bottom-nav a i {
        width: 18px !important;
        height: 18px !important;

        flex-basis: 18px;
    }

    .bottom-nav a span {
        font-size: 9px !important;
    }

}

/* Textos del menú inferior */
.bottom-nav a > span {
    font-size: 11px !important;
    line-height: 1.2;
}