* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: #ffffff;
}

/* Переключатели видимости */
.desktop-only { display: flex !important; }
.mobile-only { display: none !important; }

/* ПК Шапка */
.main-header {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    height: 70px;
    border-bottom: 1px solid #e0e0e0;
    width: 100%;
}

.catalog-btn {
    background-color: #111111;
    color: #ffffff;
    border: none;
    height: 100%;
    padding: 0 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
}
.catalog-btn .icon-close { display: none; }
.catalog-btn.is-open { background-color: #6a9d04 !important; }

.nav-links .nav-item {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    padding: 0 20px;
    height: 70px;
    display: flex;
    align-items: center;
    gap: 5px;
    border-right: 1px solid #eee;
}

.logo-container { flex-grow: 1; display: flex; justify-content: center; font-size: 32px; font-weight: 900; }
.logo { text-decoration: none; }
.logo .l-l { color: #ff2a2a; }
.logo .l-i { color: #00b0ff; }
.logo .l-m { color: #ffcc00; }
.logo .l-p { color: #00e676; }
.logo .l-o { color: #e040fb; }
.logo .l-p2 { color: #ff6e40; }
.logo .l-o2 { color: #00b0ff; }

.right-actions { display: flex; align-items: center; height: 100%; }
.search-box { padding: 0 20px; display: flex; align-items: center; gap: 8px; color: #aaa; }
.search-box input { border: none; outline: none; font-size: 14px; width: 180px; }
.action-icon-btn { background: none; border: none; padding: 0 20px; color: #666; }

/* Сетка ПК каталога */
.mega-menu {
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    z-index: 999;
    display: none !important;
}
.mega-menu.is-active { display: block !important; }
.mega-menu__container { display: grid; grid-template-columns: 280px 240px 1fr 300px; min-height: 400px; }
.mega-menu__col-1 { background-color: #fcfcfc; border-right: 1px solid #f0f0f0; }
.mega-menu__col-2 { background-color: #ffffff; border-right: 1px solid #f0f0f0; }
.mega-menu__col-3 { padding: 20px; }
.mega-menu__banner { padding: 20px; border-left: 1px solid #f0f0f0; }

.main-categories li, .sub-categories li { padding: 12px 24px; font-size: 14px; display: flex; justify-content: space-between; cursor: pointer; align-items: center; }
.main-categories li a, .sub-categories li a { text-decoration: none; color: #000000; }
.main-categories li.active, .sub-categories li.active { background-color: #f4f4f4; font-weight: bold; }
.end-categories li { margin-bottom: 10px; list-style: none; }
.end-categories li a { text-decoration: none; color: #444; font-size: 14px; }

/* По умолчанию скрываем все подкатегории 2 и 3 уровня */
.mega-menu__col-2 .sub-categories li,
.mega-menu__col-3 .end-categories li {
    display: none !important;
}

/* Показываем подкатегории 2 уровня, если у их родителя (из 1 колонки) есть класс active */
.mega-menu__col-1 .main-categories li.active ~ .mega-menu__col-2 .sub-categories li, /* Для некоторых статических версток, но надежнее через JS класс ниже */
.mega-menu__col-2 .sub-categories li.parent-active {
    display: flex !important; /* или block, в зависимости от вашей верстки */
}

/* Показываем подподкатегории 3 уровня, если их родитель (из 2 колонки) активен */
.mega-menu__col-3 .end-categories li.parent-active {
    display: block !important;
}

.custom-burger-icon {
    width: 28px;
    height: 28px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
}

.custom-burger-icon span {
    background-color: #ffffff;
    border-radius: 1px;
    display: block;
}


/* ================================================================= */
/* МОБИЛЬНЫЕ СТИЛИ (ЭКРАНЫ МЕНЬШЕ 768px)                             */
/* ================================================================= */
@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; }

    .main-header {
        justify-content: space-between !important;
        height: 65px; /* Фиксированная высота шапки */
        padding: 0;
        border-bottom: 1px solid #e8e8e8;
    }

    /* Мобильная кнопка каталога (черный квадрат) */
    .catalog-btn {
        width: 65px; /* Занимает всю высоту шапки */
        height: 65px;
        background-color: #141814 !important; /* Тёмно-серый/чёрный из макета */
        border: none;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 0;
        transition: background-color 0.15s ease;
    }

    /* Состояние кнопки при открытом меню (становится ярко-зеленой) */
    .catalog-btn.is-open {
        background-color: #00cc00 !important; 
    }

    /* Кастомная иконка-плитка из 4-х квадратов */
    .custom-burger-icon {
        width: 18px;
        height: 18px;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 3px;
    }

    .custom-burger-icon span {
        background-color: #ffffff;
        border-radius: 1px;
        display: block;
    }

    /* Центрирование логотипа */
    .logo-container {
        flex-grow: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 26px;
    }

    /* Правый блок с лупой */
    .header-right-mobile {
        width: 65px;
        height: 65px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-left: 1px solid #f0f0f0;
    }

    .mobile-search-toggle {
        background: none;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        cursor: pointer;
    }

    /* Мобильная выезжающая шторка меню */
    .mobile-menu-drawer {
        display: block !important;
        position: fixed;
        top: 65px; /* Строго под мобильной шапкой */
        left: -100%;
        width: 100%;
        height: calc(100vh - 125px); /* Вычитаем высоту шапки и нижнего таббара */
        background-color: #ffffff;
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
    }
    .mobile-menu-drawer.is-active { 
        left: 0 !important; 
    }

    .drawer-scroll-container { display: flex; width: 200%; height: 100%; transition: transform 0.3s ease; }
    .drawer-scroll-container.slide-next { transform: translateX(-50%); }
    .drawer-level { width: 50%; height: 100%; overflow-y: auto; }

    /* Списки категорий */
    .mobile-menu-list { 
        list-style: none; 
    }
    
    .mobile-menu-list li { 
        padding: 22px 20px; /* Увеличенные отступы как на макете */
        font-size: 16px; 
        color: #000000; 
        font-weight: 400;
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        border-bottom: 1px solid #f2f2f2; 
    }
    
    .mobile-menu-list li a { text-decoration: none; color: inherit; width: 100%; display: block; }

    /* Цвет стрелочек в списке */
    .arrow-icon {
        color: #000000; 
    }

    /* Кнопка возврата назад */
    .back-btn { background: none; border: none; padding: 15px 20px; color: #888; font-size: 14px; display: flex; align-items: center; gap: 5px; }
    .level2-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; }
    .level2-header h2 { font-size: 22px; font-weight: 800; text-transform: uppercase; }
    .view-all-link { color: #222; font-size: 14px; text-decoration: none; border: 1px solid #ddd; padding: 5px 12px; border-radius: 4px; }

    /* TabBar */
    .mobile-tabbar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background-color: #ffffff;
        border-top: 1px solid #e0e0e0;
        z-index: 1001;
        justify-content: space-around;
        align-items: center;
    }
    .tabbar-item { background: none; border: none; display: flex; flex-direction: column; align-items: center; font-size: 10px; color: #888; flex: 1; gap: 4px; }
    .tabbar-item.active { color: #6a9d04; font-weight: bold; }
}


/* поиск */
/* --- СТИЛИ ПОИСКА И ПРАВОЙ ПАНЕЛИ ПК --- */
.header-right-group {
    display: flex;
    align-items: center;
    height: 100%;
    border-left: 1px solid #e0e0e0;
    position: relative; /* Чтобы выпадающее окно позиционировалось относительно всей группы */
}

.search-container {
    height: 100%;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 15px 0 20px;
    height: 100%;
    border-right: 1px solid #e0e0e0;
}

/* Серая круглая точка/лупа перед текстом */
.search-dot-icon {
    width: 14px;
    height: 14px;
    background-color: #a0a0a0;
    border-radius: 50%;
    margin-right: 12px;
    display: inline-block;
}

.search-box input {
    border: none;
    outline: none;
    font-size: 15px;
    color: #111111;
    width: 240px;
    font-weight: 400;
}

.search-box input::placeholder {
    color: #b0b0b0;
}

/* Кнопка очистки (крестик) */
.clear-search-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #a0a0a0;
    cursor: pointer;
    padding: 0 5px;
}

/* Кнопки Избранное и Профиль */
.header-right-group .action-icon-btn {
    background: none;
    border: none;
    height: 100%;
    padding: 0 0 0 25px;
    color: #a0a0a0;
    /* border-right: 1px solid #e0e0e0; */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.wishlist-badge {
    position: absolute;
    top: -10px;
}
.wishlist-box {
    top: 2px;
}
/* Черная кнопка корзины */
.header-right-group .cart-box {
    background-color: #141814;
    color: #ffffff;
    height: 100%;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.header-right-group .cart-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #00cc00; /* Зеленый круг уведомления */
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- ВЫПАДАЮЩЕЕ ОКНО РЕЗУЛЬТАТОВ ПОИСКА --- */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0; /* Растягивается точно от левого края поиска до правого края корзины */
    background: #ffffff;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid #e8e8e8;
    border-top: none;
    z-index: 999;
    display: none; /* Скрыто по умолчанию */
}

/* Класс для открытия поиска через JS */
.search-container.is-open .search-dropdown {
    display: block;
}

.search-results-list {
    max-height: 400px;
    overflow-y: auto;
}

/* Элемент товара */
.search-product-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid #f5f5f5;
    gap: 20px;
    cursor: pointer;
}

.search-product-item:hover {
    background-color: #fafafa;
}

/* .product-thumb {
    width: 45px;
    height: 45px;
    object-fit: contain;
} */

.product-info {
    flex-grow: 1;
}

.product-category {
    display: block;
    font-size: 11px;
    color: #c0c0c0;
    margin-bottom: 3px;
}

.product-title {
    font-size: 13px;
    font-weight: 700;
    color: #111111;
    line-height: 1.4;
}

/* Цены */
.product-price-block {
    text-align: right;
    display: flex;
    align-items: center;
    gap: 15px;
}

.current-price {
    font-size: 14px;
    font-weight: 700;
    color: #111111;
    white-space: nowrap;
}

.old-price-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.old-price {
    font-size: 11px;
    color: #cccccc;
    text-decoration: line-through;
}

/* Ярко-желтый маркер скидки */
.discount-badge {
    background-color: #ffe600;
    color: #111111;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 2px;
}

/* Серая кнопка "Все результаты" */
.all-results-btn {
    display: block;
    text-align: center;
    padding: 16px;
    background-color: #f5f5f5;
    text-decoration: none;
    color: #111111;
    font-size: 14px;
    font-weight: 500;
    margin: 15px 25px;
    border-radius: 4px;
    transition: background 0.2s;
}

.all-results-btn:hover {
    background-color: #e8e8e8;
}

@media (max-width: 768px) {
    /* ... ваши предыдущие мобильные стили ... */

    /* Убедитесь, что у кнопки лупы в шапке стоит id="mobileSearchToggle" */
    .mobile-search-toggle {
        background: none;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        cursor: pointer;
    }

    /* Окно поиска, выезжающее справа */
    .mobile-search-drawer {
        display: block !important;
        position: fixed;
        top: 0;
        right: -100%; /* Изначально спрятано справа */
        width: 100%;
        height: 100vh;
        background-color: #ffffff;
        z-index: 2000; /* Перекрывает шапку и каталог */
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Класс активации шторки */
    .mobile-search-drawer.is-active {
        right: 0 !important;
    }

    /* Верхняя панель инпута */
    .mobile-search-header {
        display: flex;
        align-items: center;
        height: 65px;
        border-bottom: 1px solid #e8e8e8;
        padding: 0 15px;
        gap: 10px;
    }

    .search-back-btn {
        background: none;
        border: none;
        color: #111111;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 5px;
    }

    .mobile-search-field {
        flex-grow: 1;
        display: flex;
        align-items: center;
        background-color: #f5f5f5;
        border-radius: 30px; /* Скругленная строка как в мобильных трендах */
        padding: 0 15px;
        height: 42px;
    }

    .mobile-search-field input {
        background: none;
        border: none;
        outline: none;
        font-size: 15px;
        color: #111111;
        width: 100%;
        padding-left: 5px;
    }

    /* Скролл-зона для результатов */
    .mobile-search-content {
        height: calc(100vh - 65px);
        overflow-y: auto;
        padding-bottom: 30px;
    }

    /* Адаптация карточек товаров под узкий экран */
    .mobile-search-content .search-product-item {
        padding: 15px;
        gap: 12px;
    }

    .mobile-search-content .product-title {
        font-size: 12px;
        font-weight: 500;
    }

    .mobile-search-content .product-price-block {
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
    }

    .mobile-search-content .all-results-btn {
        margin: 20px 15px;
    }
}

/* Контейнер теперь вмещает в себя 3 экрана */
.drawer-scroll-container {
    display: flex;
    transition: transform 0.3s ease-in-out;
    width: 300% !important; /* Три экрана по 100% */
    transform: translateX(0);
}

.drawer-level {
    width: 33.333% !important; /* Каждая колонка занимает ровно треть контейнера */
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Шаг 2: Сдвиг на один экран влево */
.drawer-scroll-container.slide-to-level2 {
    transform: translateX(-33.333%) !important;
}

/* Шаг 3: Сдвиг на два экрана влево */
.drawer-scroll-container.slide-to-level3 {
    transform: translateX(-66.666%) !important;
}

/* Красивое оформление заголовков внутри уровней */
.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}
.level-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

/* стилизация живого поиска  начало */
#autosearch_search_results {
    top: 70px;
    min-width: 400px;
    min-height: 400px;
}
@media (max-width: 768px) {
    #autosearch_search_results {
        top: 65px;
        min-width: 100%;
        min-height: calc(100vh - 65px);
        min-width: 400px;
        min-height: 400px;
        left: -50px;
        border: none;
        box-shadow: none;
    }
}
/* стилизация живого поиска конец */

.mobile-header-active.mobile-sticky-default header {
    top: 0px;
}
@media (max-width: 768px) {
    .wishlist-badge,
    .cart-badge {
        position: absolute;
        top: 5px;
        left: px;
        margin-left: 30px;
        background: #6a9d04;
        color: white;
        width: 15px;
        border-radius: 25px;
    }
}



