/* Multilevel Menu Styles */

/* Menu wrapper */
.menu__wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Menu levels container */
.menu__levels {
    position: relative;
    width: 100%;
}

/* Menu lists */
.menu__list {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #fff;
    border-radius: 8px;
}

.menu__list--main {
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 350px);
    position: relative;
}

.menu__list--sub {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    display: none;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 350px);
}

/* Menu items */
.menu__item {
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
}

/* First and last item border radius */
.menu__item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.menu__item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border-bottom: none;
}

/* When only one item exists */
.menu__item:only-child {
    border-radius: 8px;
}

.menu__item--back {
    background-color: #f8f8f8;
    border-bottom: 2px solid #e0e0e0;
}

.menu__item--title {
    padding: 15px 20px;
    font-weight: 600;
    background-color: #fafafa;
    border-bottom: 2px solid #e0e0e0;
}

.menu__category-title {
    display: block;
    color: #333;
    font-size: 16px;
}

/* Menu links */
.menu__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
}

/* Product count badge */
.menu__product-count {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
    font-weight: 400;
}

.menu__link:hover {
    background-color: #f5f5f5;
}

.menu__link--has-children {
    position: relative;
}

.menu__link--back {
    color: #666;
    font-weight: 500;
}

/* Menu arrows */
.menu__arrow {
    flex-shrink: 0;
    margin-left: 10px;
    transition: transform 0.2s ease;
}

.menu__arrow--back {
    margin-right: 10px;
    margin-left: 0;
}

/* Sublevel container */
.menu__sublevel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Animation for level transitions */
.menu__levels[data-level="0"] .menu__list--main {
    transform: translateX(0);
}

.menu__levels[data-level="1"] .menu__list--main {
    transform: translateX(-100%);
}

.menu__list--sub {
    transition: transform 0.3s ease;
}

/* Desktop styles */
@media (min-width: 992px) {
    .menu__body._active .menu__wrapper {
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
    
    .menu__list--main {
        max-height: calc(100vh - 300px);
    }
    
    .menu__list--sub {
        background-color: #fff;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }
}

/* Mobile styles */
@media (max-width: 991px) {
    .menu__wrapper {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .menu__list--main {
        max-height: calc(100vh - 250px);
    }
    
    .menu__link {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .menu__category-title {
        font-size: 15px;
    }
    
    .menu__item--title {
        padding: 12px 15px;
    }
}

/* Remove old menu toggle button styles */
.menu__toggle {
    display: none;
}

/* Update menu item row to work with new structure */
.menu__item-row {
    display: contents;
}

/* Ensure submenu styles don't conflict */
.menu__submenu {
    display: none !important;
}

/* Template should be hidden */
template {
    display: none;
}