/* ============================================
   DESKTOP MEGA MENU
   ============================================ */

#catalog-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border-top: 1px solid #e0e0e0;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 9999;
    display: none;
    padding: 0;
    overflow: hidden; /* Чтобы контент не вылезал за скругления */
}

#catalog-dropdown.active {
    display: block;
}

.kst-mm-desktop {
    display: flex;
    min-height: 400px;
}

/* Левая колонка */
.kst-mm-left {
    width: 280px;
    flex-shrink: 0;
    border-right: 1px solid #f0f0f0;
    background: #fafafa;
}

.kst-mm-left ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kst-mm-parent-item {
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700; /* Жирные главные категории */
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: none; /* Убрали оранжевую полоску */
    border-bottom: 1px solid #f0f0f0;
}

.kst-mm-parent-item:hover,
.kst-mm-parent-item.active {
    background: #fff;
    color: #FF6600;
}

.kst-mm-count {
    color: #999;
    font-size: 13px;
    font-weight: 400;
}

.kst-mm-all-cats {
    padding: 12px 20px;
    border-top: 1px solid #e0e0e0;
    margin-top: 10px;
}

.kst-mm-all-cats a {
    color: #FF6600;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.kst-mm-all-cats a:hover {
    text-decoration: underline;
}

/* Правая колонка */
.kst-mm-right {
    flex: 1;
    padding: 20px 28px;
    background: #fff;
    position: relative;
}

.kst-mm-subpanel {
    display: none;
}

.kst-mm-subpanel.active {
    display: block;
    animation: kstFadeIn 0.2s ease;
}

@keyframes kstFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.kst-mm-sub-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0; /* Убрали gap — отступы только через padding */
}

.kst-mm-sub-list li {
    margin: 0;
}

.kst-mm-sub-list a {
    display: block;
    padding: 12px 0; /* Отступ 12px между строками */
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    border-bottom: 1px solid #f5f5f5; /* Тонкий разделитель вместо margin */
}

.kst-mm-sub-list a:hover {
    color: #FF6600;
}

.kst-mm-sub-list .kst-mm-sub-list {
    margin-top: 4px;
    margin-left: 16px;
    grid-template-columns: 1fr;
    border-left: 2px solid #f0f0f0;
    padding-left: 12px;
}

.kst-mm-sub-list .kst-mm-sub-list a {
    padding: 8px 0;
    font-size: 13px;
}

/* ============================================
   MOBILE FULLSCREEN MENU (Ozon style)
   ============================================ */
.kst-mm-mobile-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.kst-mm-mobile-wrapper.kst-mm-open {
    transform: translateX(0);
}

.kst-mm-mobile-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    flex-shrink: 0;
}

.kst-mm-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #333;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.kst-mm-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.kst-mm-mobile-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.kst-mm-m-level {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kst-mm-back-item {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
    border-bottom: 1px solid #e0e0e0;
}

.kst-mm-back-btn {
    width: 100%;
    text-align: left;
    padding: 16px 20px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #FF6600;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.kst-mm-m-item,
.kst-mm-m-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    cursor: pointer;
}

.kst-mm-m-item:active,
.kst-mm-m-link:active {
    background: #f8f9fa;
}

.kst-mm-m-link {
    color: #333;
}

.kst-mm-arrow {
    color: #ccc;
    font-size: 20px;
    font-weight: 300;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */
@media (max-width: 992px) {
    .kst-mm-desktop {
        display: none;
    }
    
    #catalog-dropdown {
        width: 100%;
        left: 0;
        transform: none;
    }
}

@media (max-width: 768px) {
    #catalog-dropdown {
        max-width: 100%;
    }
}