/**
 * Mobile nested sidebar drawer — slides secondary panels over the main menu.
 * Used inside .aiz-top-menu-sidebar .collapse-sidebar (main shell unchanged).
 */

.mobile-nested-sidebar {
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - 140px);
    flex: 1 1 auto;
}

.aiz-top-menu-sidebar .collapse-sidebar {
    display: flex;
    flex-direction: column;
}

.mobile-nested-sidebar__layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    z-index: 1;
}

.mobile-nested-sidebar__layer--main {
    position: relative;
    transform: translateX(0);
    z-index: 1;
    min-height: inherit;
}

.mobile-nested-sidebar__layer--main.is-behind {
    overflow: hidden;
}

.mobile-nested-sidebar__layer--drawer {
    transform: translateX(100%);
    z-index: 3;
    box-shadow: -6px 0 28px rgba(15, 23, 42, 0.1);
}

.mobile-nested-sidebar__layer--drawer.is-active {
    transform: translateX(0);
}

[dir="rtl"] .mobile-nested-sidebar__layer--drawer {
    transform: translateX(-100%);
    box-shadow: 6px 0 28px rgba(15, 23, 42, 0.1);
}

[dir="rtl"] .mobile-nested-sidebar__layer--drawer.is-active {
    transform: translateX(0);
}

/* Drawer header */
.mobile-ns-drawer-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 0.75rem 1rem;
}

.mobile-ns-drawer-head__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-ns-drawer-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #1a1a2e;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.mobile-ns-drawer-back:active,
.mobile-ns-drawer-back:hover {
    background: rgba(15, 23, 42, 0.06);
}

.mobile-ns-drawer-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.01em;
}

/* Main menu trigger rows (Categories / Brands) */
.mobile-ns-menu-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mobile-ns-menu-trigger__chevron {
    font-size: 1.1rem;
    color: #b5b5bf;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

[dir="rtl"] .mobile-ns-menu-trigger__chevron {
    transform: scaleX(-1);
}

/* Search */
.mobile-ns-brand-search-wrap {
    padding: 0.75rem 1rem 0;
}

.mobile-ns-brand-search {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    border-radius: 12px;
    background: #f4f5f7;
    border: 1px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.mobile-ns-brand-search:focus-within {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.12);
}

.mobile-ns-brand-search__icon {
    color: #91919b;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.mobile-ns-brand-search__input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    color: #1a1a2e;
    outline: none;
    min-width: 0;
}

.mobile-ns-brand-search__input::placeholder {
    color: #91919b;
}

/* Categories list */
.mobile-ns-drawer-body {
    padding: 0.5rem 0 1rem;
}

.mobile-ns-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-ns-cat-list__item {
    margin: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.mobile-ns-cat-list__item:last-child {
    border-bottom: none;
}

.mobile-ns-cat-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    text-decoration: none;
    color: #1a1a2e;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-ns-cat-link:active,
.mobile-ns-cat-link:hover {
    background: rgba(15, 23, 42, 0.04);
}

.mobile-ns-cat-link__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f4f5f7;
    overflow: hidden;
    flex-shrink: 0;
}

.mobile-ns-cat-link__icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.mobile-ns-cat-link__name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    min-width: 0;
}

.mobile-ns-cat-link__chevron {
    font-size: 1rem;
    color: #b5b5bf;
    flex-shrink: 0;
}

[dir="rtl"] .mobile-ns-cat-link__chevron {
    transform: scaleX(-1);
}

/* Brand groups */
.mobile-ns-brand-groups {
    padding: 0.5rem 0 1.5rem;
}

.mobile-ns-brand-group {
    padding: 0 1rem;
    margin-bottom: 1.25rem;
}

.mobile-ns-brand-group__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.625rem;
    padding-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #1a1a2e;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.mobile-ns-brand-group__title img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.85;
}

.mobile-ns-brand-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-ns-brand-list__item {
    margin: 0;
}

.mobile-ns-brand-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #3d3d4e;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-ns-brand-link::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d1d5db;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

[dir="rtl"] .mobile-ns-brand-link::before {
    margin-right: 0;
    margin-left: 0.75rem;
}

.mobile-ns-brand-link:active,
.mobile-ns-brand-link:hover {
    background: rgba(15, 23, 42, 0.04);
    color: #1a1a2e;
}

.mobile-ns-brand-group.is-hidden {
    display: none;
}

.mobile-ns-brand-link.is-hidden {
    display: none;
}

/* Loading & empty states */
.mobile-ns-drawer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #91919b;
    gap: 0.75rem;
}

.mobile-ns-drawer-loading__spinner {
    font-size: 1.75rem;
    animation: mobile-ns-spin 0.8s linear infinite;
}

@keyframes mobile-ns-spin {
    to { transform: rotate(360deg); }
}

[dir="rtl"] .mobile-ns-drawer-back .las.la-arrow-left {
    transform: scaleX(-1);
}
    text-align: center;
    padding: 2.5rem 1rem;
    color: #91919b;
    font-size: 0.875rem;
}

.mobile-ns-divider {
    margin: 0.25rem 0;
    border: none;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}
