/* Navid user panel layout + sidebar — Figma 176:8362 / 3:2199 */

.navid-profile-layout {
    --navid-profile-page-top: 56px;
    --navid-profile-page-bottom: 104px;
    --navid-profile-col-gap: 56px;
    --navid-profile-content-w: 900px;
    --navid-profile-sidebar-w: 324px;
    --navid-profile-menu-w: 268px;
    --navid-profile-sidebar-inset: 56px;
    --navid-profile-title-gap: 40px;
    --navid-profile-field-gap: var(--navid-form-field-gap, 16px);
    --navid-profile-field-row-gap: var(--navid-form-row-gap, 24px);
    --navid-profile-form-button-gap: 84px;
    --navid-profile-item-h: 56px;
}

/* Page shell */
main.main-content.navid-profile-layout {
    margin-top: var(--navid-profile-page-top) !important;
    margin-bottom: var(--navid-profile-page-bottom) !important;
}

.navid-profile-layout__row {
    align-items: flex-start;
    --bs-gutter-x: var(--navid-profile-col-gap);
}

main.navid-profile-layout .navid-profile-layout__sidebar,
main.navid-profile-layout .navid-profile-layout__row > [class*='col-']:not(.navid-profile-layout__sidebar) {
    padding-top: 0;
    padding-bottom: 0;
}

/* Sidebar */
.navid-profile-sidebar {
    width: 100%;
    max-width: var(--navid-profile-sidebar-w);
    margin-left: auto;
    margin-right: 0;
    padding-left: var(--navid-profile-sidebar-inset);
    border-left: 1px solid var(--navid-tertiary);
    border-radius: 4px;
    background: var(--navid-white);
    box-sizing: border-box;
    font-family: var(--navid-font);
}

.navid-profile-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: var(--navid-profile-menu-w);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.navid-profile-sidebar__item-wrap {
    width: 100%;
}

.navid-profile-sidebar__item {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: var(--navid-profile-item-h);
    width: 100%;
    padding: 12px 16px 12px 18px;
    border: 2px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--navid-gray);
    font-size: 16px;
    font-weight: 500;
    line-height: normal;
    text-decoration: none !important;
    box-sizing: border-box;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.navid-profile-sidebar__label {
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
    white-space: nowrap;
}

.navid-profile-sidebar__icon {
    display: block;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    overflow: visible;
    color: inherit;
    box-sizing: content-box;
}

/* Bootstrap sets border-box on * which breaks SVG <rect> geometry */
.navid-profile-sidebar__icon *,
.navid-profile-sidebar__icon-svg * {
    box-sizing: content-box;
}

/* Match Figma stroke weight at 24px (path-only icons) */
.navid-profile-sidebar__icon-svg path,
.navid-profile-sidebar__icon-svg line {
    vector-effect: non-scaling-stroke;
    stroke-width: 2px;
}

.navid-profile-sidebar__item:hover {
    color: var(--navid-secondary);
}

.navid-profile-sidebar__item--active {
    border-color: var(--navid-primary);
    padding-right: 20px;
    color: var(--navid-primary);
    font-weight: 600;
    background: var(--navid-white);
}

.navid-profile-sidebar__item--active:hover {
    color: var(--navid-primary);
}

.navid-profile-sidebar__item--logout:hover {
    color: var(--navid-error);
}

/* Legacy user panel pages (orders, wallet, …) */
main.navid-profile-layout .navid-profile-layout__row > [class*='col-']:not(.navid-profile-layout__sidebar) .section-title {
    margin-bottom: var(--navid-profile-title-gap);
    padding: 0;
    border: 0;
}

main.navid-profile-layout .navid-profile-layout__row > [class*='col-']:not(.navid-profile-layout__sidebar) .section-title h2 {
    margin: 0;
    min-height: var(--navid-profile-item-h);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--navid-secondary);
    font-size: 32px;
    font-weight: 500;
    line-height: normal;
    text-align: right;
}

@media (max-width: 991px) {
    .navid-profile-layout {
        --navid-profile-page-top: 32px;
        --navid-profile-page-bottom: 64px;
        --navid-profile-title-gap: 24px;
        --navid-profile-form-button-gap: 40px;
        --navid-profile-col-gap: 24px;
    }

    .navid-profile-sidebar {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        margin-bottom: var(--navid-profile-field-row-gap);
        border-left: none;
    }

    .navid-profile-sidebar__list {
        max-width: none;
    }

    main.navid-profile-layout .navid-profile-layout__row > [class*='col-']:not(.navid-profile-layout__sidebar) .section-title h2 {
        font-size: 24px;
        min-height: auto;
    }
}

/* ——— Mobile profile hub + sub-pages (Figma 3:18470, 3:15569) ——— */
.navid-profile-mobile-header,
.navid-account-hub {
    display: none;
}

@media (max-width: 991px) {
    body.navid-profile-page-active,
    body.navid-profile-page-active.navid-mobile-chrome,
    body.navid-account-hub-active,
    body.navid-account-hub-active.navid-mobile-chrome {
        --navid-profile-mobile-header-h: 88px;
        --navid-profile-mobile-content-top: 120px;
        --navid-profile-mobile-sticky-h: 56px;
        padding-top: 0 !important;
        padding-bottom: var(--navid-mobile-bottom-nav-h, 88px) !important;
    }

    body.navid-profile-page-active:has(.navid-profile-page__actions),
    body.navid-profile-page-active.navid-mobile-chrome:has(.navid-profile-page__actions) {
        padding-bottom: calc(var(--navid-mobile-bottom-nav-h, 88px) + var(--navid-profile-mobile-sticky-h, 56px) + 16px) !important;
    }

    body.navid-profile-page-active header.navid-header,
    body.navid-account-hub-active header.navid-header {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto;
        min-height: 0;
        background: transparent;
        box-shadow: none;
        pointer-events: none;
        z-index: 1000;
    }

    body.navid-profile-page-active header.navid-header .navid-header__mobile-wrap,
    body.navid-account-hub-active header.navid-header .navid-header__mobile-wrap {
        background: transparent;
        pointer-events: none;
    }

    body.navid-profile-page-active header.navid-header .navid-header__mobile,
    body.navid-profile-page-active header.navid-header .navid-header__mobile-search,
    body.navid-account-hub-active header.navid-header .navid-header__mobile,
    body.navid-account-hub-active header.navid-header .navid-header__mobile-search {
        display: none !important;
    }

    body.navid-profile-page-active .navid-bottom-nav,
    body.navid-account-hub-active .navid-bottom-nav {
        pointer-events: auto;
    }

    body.navid-profile-page-active footer.navid-footer,
    body.navid-account-hub-active footer.navid-footer {
        display: none !important;
    }

    .navid-profile-mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
        display: grid;
        grid-template-columns: 56px 1fr 56px;
        align-items: center;
        gap: 8px;
        min-height: var(--navid-profile-mobile-header-h, 88px);
        padding: 16px 8px;
        background: var(--navid-white);
        border-bottom: 1px solid var(--navid-tertiary);
        box-sizing: border-box;
    }

    .navid-profile-mobile-header__menu,
    .navid-profile-mobile-header__back {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 56px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 4px;
        background: transparent;
        color: var(--navid-gray);
        text-decoration: none !important;
        cursor: pointer;
    }

    .navid-profile-mobile-header__menu .navid-icon,
    .navid-profile-mobile-header__back .navid-icon {
        width: 24px;
        height: 24px;
    }

    .navid-profile-mobile-header--hub .navid-profile-mobile-header__title,
    .navid-profile-mobile-header--sub .navid-profile-mobile-header__title {
        font-size: 16px;
        font-weight: 400;
        color: var(--navid-gray);
    }

    .navid-profile-mobile-header__title {
        margin: 0;
        color: var(--navid-secondary);
        font-size: 18px;
        font-weight: 600;
        line-height: normal;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .navid-profile-mobile-header__spacer {
        display: block;
        width: 56px;
        height: 56px;
    }

    /* Account hub full page */
    body.navid-account-hub-active .navid-account-hub {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
        width: 100%;
        min-height: calc(100dvh - var(--navid-profile-mobile-content-top, 120px) - var(--navid-mobile-bottom-nav-h, 88px));
        margin-top: var(--navid-profile-mobile-content-top, 120px);
        padding: 0;
        box-sizing: border-box;
        font-family: var(--navid-font);
    }

    .navid-account-hub__user {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 16px 24px 0;
        border-bottom: 1px solid var(--navid-tertiary);
    }

    .navid-account-hub__user-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 56px;
        width: 100%;
    }

    .navid-account-hub__user-edit {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 56px;
        height: 56px;
        color: var(--navid-primary);
        text-decoration: none !important;
    }

    .navid-account-hub__user-edit-icon {
        display: block;
        width: 24px;
        height: 24px;
    }

    .navid-account-hub__user-name {
        margin: 0;
        flex: 1 1 auto;
        min-width: 0;
        color: var(--navid-gray);
        font-size: 20px;
        font-weight: 500;
        line-height: normal;
        text-align: right;
    }

    .navid-account-hub__user-phone {
        margin: 0;
        padding-right: 16px;
        color: var(--navid-gray);
        font-size: 13px;
        font-weight: 400;
        line-height: normal;
        text-align: right;
        direction: ltr;
    }

    .navid-account-hub__menu {
        flex: 1 1 auto;
        min-height: 0;
        padding-bottom: 24px;
    }

    .navid-account-hub__list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .navid-account-hub__item-wrap {
        width: 100%;
    }

    .navid-account-hub__item {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        width: 100%;
        min-height: 56px;
        padding: 9.5px 16px;
        border: 2px solid transparent;
        border-radius: 4px;
        background: transparent;
        color: var(--navid-gray);
        font-family: inherit;
        font-size: 16px;
        font-weight: 400;
        line-height: normal;
        text-decoration: none !important;
        box-sizing: border-box;
        cursor: pointer;
        transition: color 0.15s ease, border-color 0.15s ease;
    }

    .navid-account-hub__item-label {
        flex: 1 1 auto;
        min-width: 0;
        text-align: right;
    }

    .navid-account-hub__item-icon {
        display: block;
        flex-shrink: 0;
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        color: inherit;
    }

    .navid-account-hub__item-chevron {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
        color: var(--navid-gray);
    }

    .navid-account-hub__item--logout {
        padding-left: 36px;
        color: var(--navid-error);
    }

    .navid-account-hub__item:hover {
        color: var(--navid-secondary);
    }

    .navid-account-hub__item--logout:hover {
        color: var(--navid-error);
    }

    /* Profile sub-pages */
    main.main-content.navid-profile-layout {
        margin-top: var(--navid-profile-mobile-content-top, 120px) !important;
        margin-bottom: 0 !important;
        padding-top: 0 !important;
    }

    main.navid-profile-layout .container.main-container {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    main.navid-profile-layout .navid-profile-layout__row {
        --bs-gutter-x: 0;
        margin-left: 0;
        margin-right: 0;
    }

    body.navid-profile-page-active .navid-profile-layout__sidebar {
        display: none !important;
    }

    body.navid-profile-page-active .navid-profile-layout__content {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        padding: 0 16px 16px;
        box-sizing: border-box;
    }

    body.navid-profile-page-active .navid-profile-page,
    body.navid-profile-page-active .navid-wallet-page {
        max-width: none;
    }

    body.navid-profile-page-active .navid-profile-page__title,
    body.navid-profile-page-active .navid-wallet-page__title,
    body.navid-profile-page-active .navid-orders-page__title,
    body.navid-profile-page-active .navid-tickets-page__title,
    body.navid-profile-page-active .navid-comments-page__title,
    body.navid-profile-page-active .navid-favorites-page__title,
    body.navid-profile-page-active .navid-notifications-page__title {
        display: none;
    }

    body.navid-profile-page-active main.navid-profile-layout .navid-profile-layout__row > [class*='col-']:not(.navid-profile-layout__sidebar) .section-title {
        display: none;
    }

    body.navid-profile-page-active .navid-profile-page__section {
        gap: 24px;
    }

    body.navid-profile-page-active .navid-profile-page__fields {
        gap: var(--navid-form-row-gap, 24px);
    }

    body.navid-profile-page-active .navid-profile-page__row {
        display: flex;
        flex-direction: column;
        gap: var(--navid-form-field-gap, 16px);
    }

    body.navid-profile-page-active .navid-profile-page__actions {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: calc(var(--navid-mobile-bottom-nav-h, 88px) + 16px);
        z-index: 1002;
        margin: 0;
    }

    /* Drawer is inside header (z-index 1000); keep save hidden while drawer is open or closing */
    body.navid-profile-page-active:has(#navid-mobile-drawer.is-open) header.navid-header,
    body.navid-profile-page-active:has(#navid-mobile-drawer.is-closing) header.navid-header,
    body.navid-account-hub-active:has(#navid-mobile-drawer.is-open) header.navid-header,
    body.navid-account-hub-active:has(#navid-mobile-drawer.is-closing) header.navid-header {
        z-index: 1105;
    }

    body.navid-profile-page-active:has(#navid-mobile-drawer.is-open) .navid-profile-page__actions,
    body.navid-profile-page-active:has(#navid-mobile-drawer.is-closing) .navid-profile-page__actions {
        visibility: hidden;
        pointer-events: none;
    }

    body.navid-profile-page-active .navid-profile-page__actions .navid-btn {
        width: 100%;
        justify-content: center;
    }

    body.navid-profile-page-active .navid-profile-page__actions .navid-btn__icon {
        display: none;
    }
}
