/* =====================================================
   Navbar mobile — folha com acordeões
   Carregada pelo partial autentificado/header.html.
   ===================================================== */

.os-nav-sheet {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: none;
}

.os-nav-sheet.is-open {
    display: block;
}

.os-nav-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.os-nav-sheet.is-open .os-nav-sheet__backdrop {
    opacity: 1;
}

.os-nav-sheet__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    width: min(92vw, 400px);
    flex-direction: column;
    background: #ffffff;
    box-shadow: -18px 0 40px rgba(15, 23, 42, 0.18);
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.os-nav-sheet.is-open .os-nav-sheet__panel {
    transform: translateX(0);
}

.os-nav-sheet__head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.os-nav-sheet__head img {
    width: auto;
    height: 30px;
}

.os-nav-sheet__close {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    color: #334155;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
}

.os-nav-sheet__close:hover,
.os-nav-sheet__close:focus-visible {
    color: var(--primary-orange);
    border-color: rgba(var(--primary-orange-rgb), 0.45);
    outline: none;
}

.os-nav-sheet__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.85rem 1rem 1.2rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.os-nav-section + .os-nav-section {
    margin-top: 1.1rem;
}

.os-nav-section__label {
    margin: 0 0 0.35rem;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.os-nav-acc {
    border-radius: 12px;
}

.os-nav-acc + .os-nav-acc {
    margin-top: 2px;
}

.os-nav-acc__trigger {
    display: flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    gap: 0.7rem;
    padding: 0.45rem 0.6rem;
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 700;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
}

.os-nav-acc__trigger:hover,
.os-nav-acc__trigger.is-open {
    background: #f1f5f9;
}

.os-nav-acc__icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    color: var(--primary-orange);
    background: rgba(var(--primary-orange-rgb), 0.12);
    border-radius: 10px;
    font-size: 1rem;
}

.os-nav-acc__chevron {
    margin-left: auto;
    color: #94a3b8;
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.os-nav-acc__trigger.is-open .os-nav-acc__chevron {
    transform: rotate(180deg);
}

.os-nav-acc__panel {
    display: none;
    padding: 0.1rem 0 0.35rem;
}

.os-nav-acc__panel.is-open {
    display: block;
}

.os-nav-submenu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.os-nav-submenu a {
    display: block;
    padding: 0.58rem 0.7rem 0.58rem 3.15rem;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 9px;
}

.os-nav-submenu a:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.os-nav-submenu a.is-current {
    color: var(--primary-orange);
    font-weight: 700;
    background: rgba(var(--primary-orange-rgb), 0.1);
    box-shadow: inset 3px 0 var(--primary-orange);
}

.os-nav-link {
    display: flex;
    min-height: 50px;
    align-items: center;
    gap: 0.7rem;
    padding: 0.45rem 0.6rem;
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 12px;
}

.os-nav-link:hover {
    background: #f1f5f9;
}

.os-nav-account {
    flex: 0 0 auto;
    padding: 0.8rem 1rem calc(0.8rem + env(safe-area-inset-bottom));
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.os-nav-account__user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.6rem;
}

.os-nav-account__avatar {
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #ffffff;
    background: var(--primary-orange);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 800;
}

.os-nav-account__id {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.os-nav-account__id strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.os-nav-account__id span {
    color: #64748b;
    font-size: 0.75rem;
}

.os-nav-account__plan {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    padding: 0.25rem 0.6rem;
    color: #166a25;
    background: rgba(22, 106, 37, 0.1);
    border: 1px solid rgba(22, 106, 37, 0.28);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.os-nav-account__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
}

.os-nav-account__action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.55rem 0.3rem;
    color: #475569;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.os-nav-account__action i {
    font-size: 0.95rem;
}

.os-nav-account__action:hover,
.os-nav-account__action:focus-visible {
    color: var(--primary-orange);
    border-color: rgba(var(--primary-orange-rgb), 0.45);
    outline: none;
}

.os-nav-account__action--danger {
    color: #dc2626;
}

.os-nav-account__action--danger:hover,
.os-nav-account__action--danger:focus-visible {
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.45);
}

/* ---- Ações de visitante (header anônimo) ---- */
.os-nav-guest__primary {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: var(--primary-orange);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.os-nav-guest__primary:hover,
.os-nav-guest__primary:focus-visible {
    color: #ffffff;
    background: var(--primary-orange-hover);
    outline: none;
}

.os-nav-guest__secondary {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.5rem;
}

.os-nav-guest__secondary > * {
    flex: 1 1 0;
}

body.os-nav-locked {
    overflow: hidden;
}

@media (min-width: 992px) {
    .os-nav-sheet,
    .os-nav-toggle {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .os-nav-toggle {
        display: inline-flex;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        padding: 0;
        color: #1e293b;
        border-radius: 10px;
    }

    .os-nav-toggle:hover,
    .os-nav-toggle:focus-visible {
        background: rgba(15, 23, 42, 0.06);
        outline: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .os-nav-sheet__panel,
    .os-nav-sheet__backdrop,
    .os-nav-acc__chevron {
        transition: none;
    }
}
