@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
    --menu-shadow: 0 24px 44px rgba(9, 9, 18, 0.34);
    --menu-accent: #FF6709;
    --menu-accent-soft: rgba(255, 103, 9, 0.14);
    --meseros-font-family: "Inter", "Inter Fallback", sans-serif;
}

.meseros-shared-sidebar {
    width: 92px;
    flex: 0 0 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 0.75rem;
    border-radius: 28px;
    background: rgba(31, 31, 46, 0.92);
    box-shadow: var(--menu-shadow);
}

.brand-badge {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #ffba74, var(--menu-accent));
    color: #1c2034;
    font-size: 1.35rem;
    font-weight: 800;
}

.meseros-shared-nav {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 0.5rem;
}

.nav-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.25rem;
    border-radius: 18px;
    color: #aaabc1;
    font-size: 0.73rem;
    text-align: center;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    border: 0;
    background-color: transparent;
    text-decoration: none;
}

.nav-link-item:hover,
.nav-link-item:focus-visible,
.nav-link-item.is-active {
    color: #ffffff;
    background: rgba(255, 103, 9, 0.22);
    transform: translateY(-1px);
    outline: none;
}

.nav-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.04);
}

.nav-icon-wrap svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.theme-icon-moon {
    display: none;
}

.sidebar-profile {
    margin-top: auto;
    width: 100%;
    text-align: center;
}

.sidebar-profile img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 0.5rem;
}

.sidebar-profile strong,
.sidebar-profile span {
    display: block;
}

.sidebar-profile strong {
    font-size: 0.78rem;
    color: #f5f4fb;
}

.sidebar-profile span {
    font-size: 0.7rem;
    color: #aaabc1;
}

body.theme-light .meseros-shared-sidebar {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 30px rgba(153, 140, 122, 0.18);
}

body.theme-light .nav-link-item {
    color: #635d6b;
}

body.theme-light .nav-link-item:hover,
body.theme-light .nav-link-item:focus-visible,
body.theme-light .nav-link-item.is-active {
    color: #2c2734;
}

body.theme-light .nav-icon-wrap {
    background: rgba(39, 34, 48, 0.06);
}

body.theme-light .sidebar-profile strong {
    color: #2c2734;
}

body.theme-light .sidebar-profile span {
    color: #726b79;
}

body.theme-light .theme-icon-sun {
    display: none;
}

body.theme-light .theme-icon-moon {
    display: block;
}

@media (max-width: 991.98px) {
    .meseros-shared-sidebar {
        width: 100%;
        flex-basis: auto;
        flex-direction: row;
        justify-content: space-between;
        padding: 0.9rem 1rem;
        position: sticky;
        top: 0.75rem;
        z-index: 40;
        backdrop-filter: blur(10px);
    }

    .meseros-shared-nav {
        width: auto;
        flex-direction: row;
        align-items: center;
        margin-top: 0;
    }

    .nav-link-item {
        min-width: 72px;
    }

    .nav-theme-toggle {
        min-width: 96px;
    }

    .sidebar-profile {
        margin-top: 0;
        width: auto;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        text-align: left;
    }

    .sidebar-profile img {
        margin-bottom: 0;
    }
}

@media (max-width: 767.98px) {
    body {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5.9rem);
    }

    .meseros-shared-sidebar {
        position: fixed;
        left: 0.8rem;
        right: 0.8rem;
        bottom: 0.8rem;
        top: auto;
        width: auto;
        gap: 0;
        padding: 0.38rem 0.45rem calc(0.42rem + env(safe-area-inset-bottom, 0px));
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 18px 30px rgba(19, 25, 35, 0.16);
        border: 1px solid rgba(27, 24, 36, 0.08);
        backdrop-filter: blur(18px);
        overflow: visible;
        align-items: flex-end;
    }

    .brand-badge,
    .sidebar-profile,
    .nav-link-item[href="productos.php"],
    .nav-theme-toggle {
        display: none;
    }

    .meseros-shared-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0;
        align-items: center;
        justify-items: center;
    }

    .nav-link-item {
        width: 100%;
        min-width: 0;
        min-height: 54px;
        padding: 0.28rem 0.05rem 0.18rem;
        gap: 0.28rem;
        border-radius: 14px;
        color: #8b8f98;
        font-size: 0.74rem;
        font-weight: 700;
        line-height: 1.1;
        background: transparent;
        transform: none;
        justify-content: center;
    }

    .nav-link-item:hover,
    .nav-link-item:focus-visible,
    .nav-link-item.is-active {
        background: transparent;
        color: #2e333d;
        transform: none;
    }

    .nav-link-item:nth-child(1) {
        order: 1;
    }

    .nav-link-item:nth-child(2) {
        order: 2;
    }

    .nav-link-item:nth-child(4) {
        order: 4;
    }

    .nav-link-item:nth-child(5) {
        order: 3;
    }

    .nav-link-item:nth-child(6) {
        order: 5;
    }

    .nav-icon-wrap {
        width: 30px;
        height: 30px;
        border-radius: 10px;
        background: transparent;
    }

    .nav-icon-wrap svg {
        width: 17px;
        height: 17px;
        stroke-width: 1.9;
    }

    .nav-link-item.is-active .nav-icon-wrap {
        background: rgba(72, 138, 59, 0.12);
    }

    .nav-link-item.is-active span:last-child {
        color: #4d8f3c;
        font-weight: 700;
    }

    .nav-link-item span:last-child {
        width: 100%;
        display: block;
        text-align: center;
        white-space: nowrap;
    }

    .nav-link-mobile-primary {
        position: relative;
        transform: translateY(-18px);
        z-index: 2;
    }

    .nav-link-mobile-primary:hover,
    .nav-link-mobile-primary:focus-visible,
    .nav-link-mobile-primary.is-active {
        transform: translateY(-18px);
    }

    .nav-link-mobile-primary .nav-icon-wrap {
        width: 46px;
        height: 46px;
        border-radius: 999px;
        background: #10181a;
        color: #ffffff;
        box-shadow: 0 12px 22px rgba(16, 24, 26, 0.22);
    }

    .nav-link-mobile-primary .nav-icon-wrap svg {
        width: 19px;
        height: 19px;
    }

    .nav-link-mobile-primary span:last-child {
        color: #5d626c;
        font-size: 0.82rem;
        font-weight: 800;
    }

    .nav-link-mobile-primary.is-active .nav-icon-wrap {
        background: linear-gradient(180deg, #ff7f2f, #FF6709);
        box-shadow: 0 12px 22px rgba(255, 103, 9, 0.24);
    }

    .nav-link-mobile-primary.is-active span:last-child {
        color: #FF6709;
    }

    body.theme-light .meseros-shared-sidebar {
        background: rgba(255, 255, 255, 0.96);
        border-color: rgba(27, 24, 36, 0.08);
        box-shadow: 0 22px 38px rgba(19, 25, 35, 0.12);
    }

    body.theme-light .nav-link-item {
        color: #8b8f98;
    }

    body.theme-light .nav-link-item:hover,
    body.theme-light .nav-link-item:focus-visible,
    body.theme-light .nav-link-item.is-active {
        color: #2e333d;
    }

    body.theme-light .nav-link-item.is-active .nav-icon-wrap {
        background: rgba(72, 138, 59, 0.12);
    }
}

@media (max-width: 575.98px) {
    .meseros-shared-sidebar {
        left: 0.55rem;
        right: 0.55rem;
        bottom: 0.55rem;
        padding-left: 0.3rem;
        padding-right: 0.3rem;
    }

    .meseros-shared-nav {
        gap: 0.05rem;
    }

    .nav-link-item {
        min-height: 50px;
        font-size: 0.68rem;
    }

    .nav-icon-wrap {
        width: 28px;
        height: 28px;
    }

    .nav-link-mobile-primary .nav-icon-wrap {
        width: 42px;
        height: 42px;
    }

    .nav-link-mobile-primary {
        transform: translateY(-15px);
    }

    .nav-link-mobile-primary:hover,
    .nav-link-mobile-primary:focus-visible,
    .nav-link-mobile-primary.is-active {
        transform: translateY(-15px);
    }

    .nav-link-mobile-primary span:last-child {
        font-size: 0.76rem;
    }
}
