/* Hide default Bootstrap mobile collapse menu to prevent overlapping */
@media (max-width: 991.98px) {
    #navbarCollapse {
        display: none !important;
    }
    .category-navbar {
        display: none !important;
    }
}

/* ========================================== */
/* MOBILE CATEGORY DRAWER CORE STYLING        */
/* ========================================== */
body.drawer-open {
    overflow: hidden !important;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(1.5px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.mobile-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 300px;
    height: 100%;
    background: #ffffff;
    z-index: 99999;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.mobile-drawer.open {
    left: 0;
}

/* Sticky Header */
.drawer-header {
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.drawer-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 8px 20px;
}

.drawer-title {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a2a3a;
}

.close-drawer-btn {
    background: none;
    border: none;
    font-size: 26px;
    color: #888888;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    transition: color 0.2s;
}

.close-drawer-btn:hover {
    color: #333333;
}

/* Back button */
.drawer-header-back-wrapper {
    padding: 4px 20px 4px 20px;
}

.back-btn-static {
    background: none;
    border: none;
    color: #4b5563;
    font-family: 'Outfit', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 0;
    text-align: left;
    transition: transform 0.2s;
}

.back-btn-static i {
    font-size: 12px;
}

.back-target-bold {
    font-weight: 700;
    color: #1a2a3a;
}

.drawer-header-orange-line {
    height: 3px;
    background-color: var(--bg-color, #f36c21); /* Dynamic brand background color */
    width: 100%;
    margin-top: 8px;
}

/* Drawer Body & Panels */
.drawer-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #ffffff;
}

.panels-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.drawer-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: #ffffff;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
    visibility: hidden;
    transform: translateX(100%);
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

.drawer-panel.active {
    visibility: visible;
    transform: translateX(0);
}

.drawer-panel.slide-left {
    visibility: hidden;
    transform: translateX(-100%);
}

/* Uppercase bold parent headers */
.panel-category-title {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    color: #111111;
    padding: 20px 20px 10px 20px;
    letter-spacing: 0.5px;
}

/* Menu List Styling */
.drawer-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.drawer-menu-list li {
    border-bottom: 1px solid #f3f4f6;
}

.menu-row {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.menu-item-link {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 48px; /* High-UX Touch Target (at least 44px) */
    padding: 14px 20px;
    background: none;
    border: none;
    text-align: left;
    font-family: 'Outfit', sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    color: #111111;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none !important;
}

.menu-item-link:hover, .menu-item-link:active {
    background-color: #fafafa;
    color: var(--bg-color, #f36c21);
}

.menu-item-link.solo {
    width: 100%;
}

.menu-item-link.all-products {
    font-weight: 700;
}

.menu-item-link.shop-all-link {
    color: var(--bg-color, #f36c21);
    font-weight: 700;
    border-bottom: 1px solid #f3f4f6;
}

.chevron-toggle-btn {
    width: 52px; /* Fixed-width ~52px */
    min-height: 48px; /* High-UX Touch Target (at least 44px) */
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-left: 1px solid #f3f4f6; /* Visible left border/divider */
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chevron-toggle-btn:hover, .chevron-toggle-btn:active {
    background-color: #fafafa;
}

.chevron-icon {
    font-size: 11px;
    color: #9ca3af;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s;
}

/* Hovering on the button/row triggers chevron hover color */
.menu-row:hover .chevron-icon, .chevron-toggle-btn:hover .chevron-icon {
    color: var(--bg-color, #f36c21);
}

/* Rotation of 90 degrees when open */
.chevron-toggle-btn.submenu-open .chevron-icon {
    transform: rotate(90deg);
    color: var(--bg-color, #f36c21) !important;
}
