/* ============================================================
   Mobile drawer — shared shell for nav-links and categories
   Mobile-only (<= 768px). Hidden / no-op on desktop.
   ============================================================ */

.m-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    width: min(85vw, 360px);
    max-width: 360px;
    background: #FFFFFF;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.2s ease-in, visibility 0s 0.2s;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    pointer-events: none;
}

.m-drawer.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.25s ease-out, visibility 0s;
}

@media (min-width: 769px) {
    .m-drawer { display: none; }
}

/* Drawer header bar (logo + close X) */
.m-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    height: 56px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.m-drawer__title {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 17px;
    font-weight: 600;
    color: #0B0427;
    line-height: 1.2;
    text-align: right;
}

.m-drawer__close {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #46494F;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease;
}

.m-drawer__close:hover,
.m-drawer__close:focus-visible {
    color: #0B0427;
    outline: none;
}


/* Drawer body (scrolls internally) */
.m-drawer__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
}

/* Drawer footer (used by nav-links drawer for logout) */
.m-drawer__footer {
    flex-shrink: 0;
    padding: 8px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ============================================================
   List, items, accordion
   ============================================================ */

.m-drawer__list,
.m-drawer__sublist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.m-drawer__item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.m-drawer__item:last-child {
    border-bottom: none;
}

.m-drawer__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #46494F;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    text-align: right;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.m-drawer__row:hover,
.m-drawer__row:focus-visible {
    background-color: rgba(0, 0, 0, 0.03);
    outline: none;
}

/* Split-row variant: parent category with sub-categories. The row becomes a
   layout container holding two interactive children — a link covering most
   of the row (navigates to the parent category page) and a separate expand
   button on the leading edge (toggles the sublist). The container itself is
   no longer interactive, so its hover state goes back to transparent. */
.m-drawer__row--split {
    padding: 0;
}

.m-drawer__row--split:hover,
.m-drawer__row--split:focus-visible {
    background-color: transparent;
}

.m-drawer__row__link {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: inherit;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    text-align: right;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.m-drawer__row__link:hover,
.m-drawer__row__link:focus-visible {
    background-color: rgba(0, 0, 0, 0.03);
    outline: none;
}

/* Standalone expand button — sized for thumb tap (~56px wide). Subtle
   border on the side adjacent to the link clarifies that this is its own
   touch target rather than just decoration. */
.m-drawer__expand {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: 56px;
    padding: 0;
    background: transparent;
    border: none;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    cursor: pointer;
    color: inherit;
    transition: background-color 0.15s ease;
}

.m-drawer__expand:hover,
.m-drawer__expand:focus-visible {
    background-color: rgba(0, 0, 0, 0.04);
    outline: none;
}

.m-drawer__label {
    flex: 1;
    text-align: right;
}

.m-drawer__chevron {
    font-size: 12px;
    color: #6B6E74;
    transition: transform 0.2s ease;
    margin-left: 4px;
}

.m-drawer__item.has-children.open > .m-drawer__row .m-drawer__chevron {
    transform: rotate(180deg);
}

.m-drawer__item.has-children.open > .m-drawer__row {
    background-color: rgba(32, 32, 179, 0.04);
}

/* Sublist (children) — collapsed by default, expand when parent has .open */
.m-drawer__sublist {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.25s ease-in-out;
    background: rgba(0, 0, 0, 0.015);
}

.m-drawer__item.has-children.open > .m-drawer__sublist {
    max-height: 600px;
    opacity: 1;
}

.m-drawer__sublink {
    display: block;
    padding: 12px 32px 12px 16px; /* extra right padding = indent under parent in RTL */
    color: #6B6E74;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    text-align: right;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.m-drawer__sublist > li:last-child .m-drawer__sublink {
    border-bottom: none;
}

.m-drawer__sublink:hover,
.m-drawer__sublink:focus-visible {
    background-color: rgba(0, 0, 0, 0.03);
    outline: none;
}

/* Footer logout link */
.m-drawer__footer .m-drawer__row {
    color: #46494F;
    gap: 8px;
}

.m-drawer__footer .m-drawer__row i {
    font-size: 16px;
}

/* Category FA icon (cats drawer only — nav drawer rows have no .m-drawer__icon).
   Mirrors desktop's .cat-menu__icon styling so the FA glyph renders at the
   same size/color as in the desktop menu. */
.m-drawer__icon {
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    color: #46494F;
    font-size: 18px;
    margin-left: 12px;
}
