.catalog-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #2b2935;
    padding: 0 20px 0 10px;
    border: 1px solid #90adb8;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    height: 40px;
    transition: border-color 0.2s;
    font-size: 15px;
}
.catalog-btn:hover { border-color: #3ec6ff; }

.catalog-icon line {
    transition: all 0.3s ease;
    transform-origin: center;
}

.catalog-btn.active .line1 {
    transform: rotate(45deg) translate(1px, 5px);
}
.catalog-btn.active .line2 {
    opacity: 0;
}
.catalog-btn.active .line3 {
    transform: rotate(-45deg) translate(1px, -5px);
}
.catalog-menu {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background: #fff;
    color: #000;
    z-index: 999;
    display: none;
    max-height: calc(100vh - 100px); /* ограничиваем высоту */
    overflow: hidden; /* прячем общий скролл */
}

.catalog-menu.show {
    display: block;
}

.catalog-menu__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: -1;
}

.catalog-menu__wrapper {
    display: grid;
    grid-template-columns: 180px 260px 1fr;
    max-width: calc(100% - 30px);
    margin: 0 auto;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    height: calc(100vh - 100px);
    padding-bottom: 20px;
}

/* Left: shops */
.catalog-menu__shops {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #222;
}

.catalog-menu__shops,
.catalog-menu__categories,
.catalog-menu__subcategories {
    overflow-y: auto;
    max-height: calc(100vh - 100px);
}

/* Чтобы скролл выглядел аккуратно */
.catalog-menu__shops::-webkit-scrollbar,
.catalog-menu__categories::-webkit-scrollbar,
.catalog-menu__subcategories::-webkit-scrollbar {
    width: 4px;
}
.catalog-menu__shops::-webkit-scrollbar-thumb,
.catalog-menu__categories::-webkit-scrollbar-thumb,
.catalog-menu__subcategories::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
.catalog-menu__shops::-webkit-scrollbar-thumb:hover,
.catalog-menu__categories::-webkit-scrollbar-thumb:hover,
.catalog-menu__subcategories::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}
.catalog-menu__shops,
.catalog-menu__categories,
.catalog-menu__subcategories {
    scrollbar-width: thin;            /* тонкий скролл для Firefox */
    scrollbar-color: #bbb transparent; /* цвет ползунка и трека */
}
.shop-switch {
    padding: 14px 20px;
    cursor: pointer;
    font-weight: 500;
    color: #556e82;
    transition: background 0.2s, color 0.2s;
    font-size: 20px;
}
.shop-cat-note {
    font-size: 14px;
    margin-top: 10px;
    font-weight: 400;
    line-height: 1.2;
}
.shop-switch.active {
    background: #f4f9fb;
}
.shop-switch:hover { color: #3ec6ff; }
.shop-switch.active:hover {
    color: #556e82;
}
/* Middle: categories */
.catalog-menu__categories {
    background: #fff;
}
.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.category-list li {
    padding: 12px 18px;
    cursor: pointer;
    color: #2b2935;
    transition: background 0.15s;
}
.category-list li:hover {
    background: #f4f9fb;
    color: #3ec6ff;
}

/* Right: subcategories */
.catalog-menu__subcategories {
    padding: 16px 20px;
    background: #fff;
}
.subcategory-list a {
    display: block;
    padding: 8px 12px;
    background: #fff;
    color: #eee;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
}

/* Responsive */
@media (max-width: 768px) {
    .catalog-menu__wrapper {
        grid-template-columns: 1fr;
        height: 100vh;
        border-radius: 0;
    }
    .catalog-menu__shops {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid #222;
    }
    .shop-switch {
        flex: 1;
        text-align: center;
    }
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #3ec6ff;
    font-weight: 600;
    margin-bottom: 10px;
}
.back-btn:hover { text-decoration: underline; }

.subcategory-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f9f9f9;
    margin-bottom: 6px;
    transition: background 0.15s;
    width: 230px;
    max-width: 100%;
}
.subcategory-item:hover {
    background: #e8f6ff;
}
.next-arrow {
    color: #aaa;
    font-size: 18px;
}
.subcat-toggle{
    font-size: 20px;
}

/* Левая часть — название категории */
.subcat-name {
    flex: 1;
    padding: 10px 12px;
    cursor: pointer;
}

/* Правая часть — зона раскрытия */
.subcat-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15%;
    cursor: pointer;
    transition: background 0.15s;
}

/* Если у категории нет подкатегорий — вся плашка кликабельная */
.subcategory-item:not(:has(.subcat-toggle)) .subcat-name {
    width: 100%;
    padding-right: 12px;
}
.subcategory-item:not(:has(.subcat-toggle)) {
    cursor: pointer;
}
.subcategory-item:not(:has(.subcat-toggle)):hover {
    background: #f3f3f3;
}


#category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 6px 8px;
    background: #f4f9fb;
    margin: 5px;
}

#category-list .cat-name {
    flex: 1;
    cursor: pointer;
}

#category-list .cat-toggle {
    cursor: pointer;
    padding-left: 10px;
    opacity: 0.8;
    font-size: 20px;
}
#category-list .cat-toggle:hover {
    opacity: 1;
}

