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

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

.bm-panel {
    position: fixed;
    top: 0;
    right: -450px; /* Increased width for subcategories */
    width: 450px; /* Increased from 400px */
    height: 100vh;
    background: #ffffff;
    transition: right 0.3s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.bm-panel.active {
    right: 0;
}

.bm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e5e5e5;
}

.bm-logo {
    font-size: 22px;
    font-weight: 700;
    color: #E52533;
    letter-spacing: -0.5px;
}

.bm-close {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 24px;
    transition: all 0.2s ease;
    border-radius: 50%;
    padding: 0 !important;
}

.bm-close:hover {
    background: #f5f5f5;
    color: #E52533;
    transform: rotate(90deg);
}

.bm-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.bm-body::-webkit-scrollbar {
    width: 4px;
}

.bm-body::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.bm-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.bm-nav {
    margin-bottom: 40px;
}

.bm-nav-link {
    display: block;
    padding: 12px 0;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.bm-nav-main {
    font-weight: 500;
}

.bm-nav-link:hover {
    color: #E52533;
    padding-left: 10px;
}

/* Active state for navigation links */
.bm-nav-link.active {
    color: #E52533;
    font-weight: 600;
    padding-left: 10px;
    position: relative;
}

.bm-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: #E52533;
}

.bm-nav-group {
    margin-bottom: 25px;
}

.bm-nav-title {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.bm-nav-children {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bm-nav-children .bm-nav-link {
    font-size: 14px;
    padding: 8px 0;
    border: none;
}

.bm-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bm-section-title i {
    font-size: 18px;
    color: #E52533;
}

.bm-products {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e5e5e5;
}

.bm-categories {
    display: grid;
    gap: 10px;
}

/* Enhanced category with subcategories */
.bm-category-item {
    border-radius: 8px;
    background: #f8f8f8;
    transition: all 0.2s ease;
    overflow: hidden;
}

.bm-category {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.bm-category-expandable {
    cursor: pointer;
}

.bm-category:hover {
    background: #E52533;
}

.bm-category:hover .bm-category-name {
    color: #ffffff;
}

.bm-category:hover .bm-category-count,
.bm-category:hover .bm-category-expand {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Active category state */
.bm-category.active {
    background: #E52533;
}

.bm-category.active .bm-category-name {
    color: #ffffff;
    font-weight: 600;
}

.bm-category.active .bm-category-count,
.bm-category.active .bm-category-expand {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.bm-category-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    flex: 1;
}

.bm-category-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bm-category-count {
    background: #ffffff;
    color: #999;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.bm-category-expand {
    width: 24px;
    height: 24px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
    transition: all 0.3s ease;
}

.bm-category-item.expanded .bm-category-expand {
    transform: rotate(180deg);
}

/* Subcategories */
.bm-subcategories {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #ffffff;
}

.bm-category-item.expanded .bm-subcategories {
    max-height: 500px;
}

.bm-subcategory {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px 10px 35px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    border-top: 1px solid #f0f0f0;
    position: relative;
}

.bm-subcategory::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #ddd;
    border-radius: 50%;
}

.bm-subcategory:hover {
    background: #f8f8f8;
    color: #E52533;
    padding-left: 40px;
}

.bm-subcategory:hover::before {
    background: #E52533;
}

/* Active subcategory state */
.bm-subcategory.active {
    background: #f0f0f0;
    color: #E52533;
    font-weight: 500;
}

.bm-subcategory.active::before {
    background: #E52533;
    width: 8px;
    height: 8px;
}

.bm-subcategory-count {
    background: #f0f0f0;
    color: #999;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.bm-contact-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bm-contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: #f8f8f8;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.bm-contact-item:hover {
    background: #e5e5e5;
}

a.bm-contact-item:hover {
    color: #E52533;
}

.bm-contact-item i {
    width: 35px;
    height: 35px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #E52533;
    font-size: 14px;
    flex-shrink: 0;
}

body.menu-open {
    overflow: hidden;
}

@media (max-width: 480px) {
    .bm-panel {
        width: 100%;
        right: -100%;
    }

    .bm-header {
        padding: 15px 20px;
    }

    .bm-body {
        padding: 20px;
    }

    .bm-categories {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .bm-panel {
        width: 420px;
        right: -420px;
    }
}

body.admin-bar .bm-panel {
    height: calc(100vh - 32px);
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .bm-panel {
        height: calc(100vh - 46px);
        top: 46px;
    }
}