/* Mobile Drawer Menu Styles */

/* Design Tokens */
:root {
    /* Brand Colors */
    --brand-blue-primary: #191E67;
    --brand-blue-secondary: #4564ED;
    --brand-blue-container: #F0F3FE;

    /* Background Colors */
    --background-white: #FFFFFF;
    --background-primary: #F3F3F3;

    /* Text Colors */
    --text-primary: #3D3D3D;
    --text-secondary: #888888;

    /* Border Colors */
    --border-default: #E7E7E7;

    /* Font Weights */
    --font-regular: 400;
    --font-medium: 510;
    --font-semibold: 590;
    --font-bold: 700;

    /* Spacing */
    --space-4: 4px;
    --space-8: 8px;
    --space-12: 12px;
    --space-16: 16px;
    --space-20: 20px;

    /* Border Radius */
    --radius-sm: 4.763px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Overlay */
.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Drawer Container - Full Screen */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background: var(--background-primary);
    z-index: 10000;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-drawer[data-drawer-state="open"],
.mobile-drawer.active {
    transform: translateX(0);
}

/* Header positioning when drawer is open - Only on mobile */
@media (max-width: 991px) {
    body:has(.mobile-drawer.active) .header,
    body:has(.mobile-drawer[data-drawer-state="open"]) .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10001;
        width: 100%;
    }

    body:has(.mobile-drawer.active) .header-menu,
    body:has(.mobile-drawer[data-drawer-state="open"]) .header-menu {
        position: relative;
        z-index: 10001;
        background: #FFFFFF;
        box-shadow: 0px 4px 4px -8px rgba(0, 0, 0, 0.08),
                    0px 4px 16px 10px rgba(16, 24, 40, 0.02),
                    0px 2px 32px -4px rgba(16, 24, 40, 0.03);
    }

    body:has(.mobile-drawer.active) .header-menu .search-box,
    body:has(.mobile-drawer[data-drawer-state="open"]) .header-menu .search-box {
        background: var(--brand-blue-container);
        border: 1px solid var(--border-default);
    }

    body:has(.mobile-drawer.active) .header-menu .search-input::placeholder,
    body:has(.mobile-drawer[data-drawer-state="open"]) .header-menu .search-input::placeholder {
        color: var(--text-secondary);
    }
}

/* Hide mobile location bar when drawer is open */
body:has(.mobile-drawer.active) .mobile-location-bar,
body:has(.mobile-drawer[data-drawer-state="open"]) .mobile-location-bar {
    display: none;
}

/* Hide overlay when using full screen drawer */
body:has(.mobile-drawer.active) .mobile-drawer-overlay,
body:has(.mobile-drawer[data-drawer-state="open"]) .mobile-drawer-overlay {
    display: none;
}

/* Drawer Content */
.mobile-drawer-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 56px; /* Height of mobile header menu */
}

/* Login Banner */
.mobile-drawer .login-banner {
    position: relative;
    width: 100%;
    min-height: auto;
    background: var(--background-white);
    border-top: 0.586px solid var(--border-default);
    overflow: hidden;
    padding: var(--space-16);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.login-banner .banner-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    flex: 1;
    max-width: 204px;
}

.login-banner .banner-title {
    font-family: 'SF Pro', sans-serif;
    font-weight: var(--font-bold);
    font-size: 14px;
    line-height: 18.751px;
    letter-spacing: -0.14px;
    color: var(--text-primary);
    margin: 0;
    width: 220px;
}

.login-banner .banner-subtitle {
    font-family: 'SF Pro', sans-serif;
    font-weight: var(--font-regular);
    font-size: 10px;
    line-height: 14.063px;
    letter-spacing: -0.1px;
    color: var(--text-secondary);
    margin: 0;
    width: 235px;
}

.login-banner .btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 9.376px;
    gap: var(--space-8);
    border: 0.879px solid var(--brand-blue-secondary);
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: 'SF Pro', sans-serif;
    font-weight: var(--font-medium);
    font-size: 10px;
    line-height: 11.72px;
    color: var(--brand-blue-secondary);
    cursor: pointer;
    width: fit-content;
    white-space: pre;
    transition: all 0.2s ease;
}

.login-banner .btn-login:hover {
    background: var(--brand-blue-secondary);
    color: var(--background-white);
}

.login-banner .banner-illustration {
    width: 154px;
    height: auto;
    max-height: 86px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Navigation */
.drawer-nav {
    display: flex;
    flex-direction: column;
    padding: var(--space-16) 0;
    width: 100%;
}

.drawer-nav .nav-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-20);
    padding: 0 var(--space-16);
}

/* Menu Item */
.menu-item {
    background: var(--background-white);
    border-radius: var(--radius-md);
    width: 100%;
}

.menu-item.expandable {
    border-radius: var(--radius-lg);
}

/* Add extra margin for expandable items */
.menu-item.expandable + .menu-item.expandable,
.menu-item.expandable + .menu-item {
    margin-top: var(--space-4);
}

.menu-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-12);
    gap: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.menu-item-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.menu-title {
    font-family: 'SF Pro', sans-serif;
    font-weight: var(--font-semibold);
    font-size: 16px;
    line-height: 24px;
    color: var(--text-primary);
    white-space: pre;
}

/* Chevron Icon */
.chevron {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transform: rotate(180deg) scaleY(-1);
    transition: transform 0.3s ease;
}

.menu-item-header[aria-expanded="true"] .chevron,
.drawer-nav-toggle.active .chevron {
    transform: rotate(0deg) scaleY(1);
}

/* Submenu Dropdown */
.menu-dropdown,
.drawer-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 var(--space-12);
}

.menu-dropdown[hidden] {
    display: block;
}

.menu-dropdown:not([hidden]),
.drawer-submenu.active {
    max-height: 3000px;
    padding-bottom: var(--space-12);
}

/* Submenu Category */
.drawer-submenu-category {
    background: #F7F7F8;
    border-radius: var(--radius-md);
    padding: var(--space-12);
    margin-bottom: 40px;
}

.drawer-submenu-category:last-child {
    margin-bottom: 0;
}

.drawer-submenu-category.no-icon .category-links {
    margin-top: 0;
}

/* Category Header */
.category-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
    cursor: pointer;
    padding: 4px;
    margin: -4px -4px 0px -4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.category-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

.category-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    pointer-events: none;
}

.category-title {
    font-family: 'SF Pro', sans-serif;
    font-weight: var(--font-semibold);
    font-size: 16px;
    line-height: 1.4;
    color: var(--text-primary);
    pointer-events: none;
}

/* Category Links */
.category-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
}

.drawer-submenu-link {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    font-family: 'SF Pro', sans-serif;
    font-size: 16px;
    font-weight: var(--font-regular);
    line-height: 1.4;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease, font-weight 0.2s ease;
}

.drawer-submenu-link:hover {
    color: var(--brand-blue-secondary);
}

.drawer-submenu-link.highlight {
    font-weight: var(--font-bold);
    color: #FF730A;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 999px;
    font-family: 'SF Pro', sans-serif;
    font-weight: var(--font-medium);
    font-size: 12px;
    line-height: 0;
    white-space: nowrap;
}

.badge-new {
    background: #FF2156;
    color: #FFFFFF;
}

/* Hide on Desktop */
@media (min-width: 992px) {
    .mobile-drawer,
    .mobile-drawer-overlay {
        display: none;
    }
}
