* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-top: 120px;
}

body.menu-open {
    overflow: hidden;
    height: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== ВЕРХНЯЯ ЧАСТЬ ШАПКИ ===== */
.header{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-top {
    background: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

/* Логотип */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-tip{
    width: 120px;
    height: auto;
}

a:has(.logo) {
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 14px;
    font-weight: 700;
    color: #e31e24;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logo-subtitle {
    font-size: 11px;
    color: #999;
}

/* Навигация */
.nav-menu {
    display: flex;
    gap: 25px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #e31e24;
}

/* Социальные сети */
.social-links {
    display: flex;
    gap: 8px;
}

.social-link {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    text-decoration: none;
    transition: opacity 0.3s;
}

.social-link:hover {
    opacity: 0.8;
}

.social-link.vk { background: #4a76a8; }
.social-link.telegram { background: #0088cc; }
.social-link.whatsapp { background: #25d366; }
.social-link.viber { background: #665cac; }
.social-link.youtube { background: #ff0000; }

/* Контакты и вход */
.header-contacts {
    display: flex;
    align-items: center;
    gap: 20px;
}

.phone-block {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.phone-number {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
}

.work-hours {
    font-size: 11px;
    color: #999;
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    font-weight: 500;
}

.login-btn i {
    color: #e31e24;
}

/* ===== НИЖНЯЯ ЧАСТЬ ШАПКИ ===== */
.header-bottom {
    background: #e31e24;
    padding: 12px 0;
}

.header-bottom .container {
    gap: 20px;
}

/* Кнопка каталога */
.catalog-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background 0.3s;
}

.catalog-btn:hover {
    background: rgba(255,255,255,0.1);
}

.catalog-btn i {
    font-size: 16px;
}

.catalog-dropdown{
    position: relative;
}

.catalog-menu{
    position: absolute;
    top: 100%;
    left: 0;
    width: 280px;
    background: #fff;
    border-radius: 0 0 8px 8px;;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.20);
    transform: translateY(-5px);
    transition: all 0.6s ease; 
    z-index: 999;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
}

/* Класс для открытого меню */
.catalog-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Список категорий */
.catalog-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Элемент категории */
.catalog-category {
    border-bottom: 1px solid #f0f0f0;
}

.catalog-category:last-child {
    border-bottom: none;
}

/* Ссылка категории */
.catalog-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.catalog-link:hover {
    background: #f8f8f8;
    color: #e31e24;
}

/* Иконка категории */
.catalog-link i {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e31e24;
    font-size: 16px;
}

/* Стрелка справа */
.catalog-link::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    color: #ccc;
    font-size: 12px;
    transition: color 0.2s;
}

.catalog-link:hover::after {
    color: #e31e24;
}

/* Затемнение фона при открытом меню */
.catalog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 998;
}

.catalog-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Активное состояние кнопки каталога */
.catalog-btn.active {
    background: rgba(255, 255, 255, 0.2);
}

/* Поиск */
.search-box {
    flex: 1;
    display: flex;
    max-width: 500px;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 13px;
    outline: none;
}

.search-box input::placeholder {
    color: #999;
}

.search-btn {
    background: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    color: #999;
}

/* Корзина */
.cart {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
}

.cart-icon {
    position: relative;
}

.cart-icon i {
    font-size: 22px;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #7cb342;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-total {
    font-size: 15px;
    font-weight: 600;
}

/* ===== СТИЛИ ПОИСКА ===== */

/* Оверлей */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Контейнер результатов поиска */
.search-results {
    position: fixed;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-height: 500px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.search-results.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Шапка результатов */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f8f8;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}

.search-results-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.search-results-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    transition: color 0.2s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-results-close:hover {
    color: #e31e24;
}

/* Список результатов */
.search-results-list {
    overflow-y: auto;
    max-height: 350px;
    padding: 0;
    flex: 1;
}

/* Элемент результата */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f0f0f0;
}

/* Изображение товара */
.search-result-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Информация о товаре */
.search-result-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.search-result-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-name mark {
    background: #fff3cd;
    color: #333;
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-category {
    font-size: 12px;
    color: #999;
    display: block;
    margin-bottom: 6px;
}

/* Цены */
.search-result-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-price {
    font-size: 15px;
    font-weight: 700;
    color: #e31e24;
}

.search-result-old-price {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
}

/* Стрелка */
.search-result-arrow {
    color: #ccc;
    font-size: 12px;
    transition: color 0.2s;
    flex-shrink: 0;
}

.search-result-item:hover .search-result-arrow {
    color: #e31e24;
}

/* Нет результатов */
.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.search-no-results i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
    display: block;
}

.search-no-results p {
    font-size: 15px;
    color: #333;
    margin-bottom: 5px;
}

.search-no-results span {
    font-size: 13px;
}

/* Футер результатов */
.search-results-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: center;
    background: #f8f8f8;
    border-radius: 0 0 8px 8px;
    flex-shrink: 0;
}

.search-view-all {
    color: #e31e24;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.search-view-all:hover {
    opacity: 0.8;
}

body.search-open {
    overflow: hidden;
}

/* ===== АДАПТИВНОСТЬ ПОИСКА ===== */

/* Планшеты */
@media (max-width: 992px) {
    .search-results {
        top: 100px;
        left: 20px;
        right: 20px;
        width: auto;
        max-height: calc(100vh - 120px);
    }
    
    .search-results-list {
        max-height: calc(100vh - 220px);
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .search-results {
        top: 90px;
        left: 15px;
        right: 15px;
        width: auto;
        max-height: calc(100vh - 110px);
        border-radius: 12px;
    }
    
    .search-results-list {
        max-height: calc(100vh - 200px);
    }
    
    .search-result-item {
        padding: 12px 15px;
        gap: 12px;
    }
    
    .search-result-image {
        width: 55px;
        height: 55px;
    }
    
    .search-result-name {
        font-size: 14px;
    }
    
    .search-result-price {
        font-size: 15px;
    }
    
    .search-results-header {
        padding: 12px 15px;
    }
    
    .search-results-footer {
        padding: 12px 15px;
    }
}

/* Маленькие мобильные */
@media (max-width: 480px) {
    .search-results {
        top: 85px;
        left: 10px;
        right: 10px;
        max-height: calc(100vh - 100px);
    }
    
    .search-results-list {
        max-height: calc(100vh - 180px);
    }
    
    .search-result-item {
        padding: 10px;
        gap: 10px;
    }
    
    .search-result-image {
        width: 50px;
        height: 50px;
    }
    
    .search-result-name {
        font-size: 13px;
        margin-bottom: 2px;
    }
    
    .search-result-category {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .search-result-price {
        font-size: 14px;
    }
    
    .search-result-old-price {
        font-size: 11px;
    }
    
    .search-no-results {
        padding: 30px 15px;
    }
    
    .search-no-results i {
        font-size: 36px;
    }
}

/* ===== ОСНОВНАЯ АДАПТИВНОСТЬ ===== */

/* Планшет */
@media (max-width: 992px) {
    body {
        padding-top: 100px;
    }

    .nav-menu {
        display: none;
    }

    .social-links {
        display: none;
    }

    .logo-tip {
        width: 90px;
    }
}

/* Большие телефоны */
@media (max-width: 768px) {
    body {
        padding-top: 90px;
    }

    .header-top .container {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: space-between;
    }

    .phone-block {
        display: none;
    }

    .header-contacts {
        gap: 12px;
    }

    .logo-tip {
        width: 80px;
    }

    /* Нижняя часть шапки */
    .header-bottom .container {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 15px;
    }

    /* Каталог слева */
    .catalog-btn span {
        display: inline;
        font-size: 13px;
    }

    .catalog-btn {
        padding: 10px 15px;
        gap: 8px;
        white-space: nowrap;
        justify-self: start;
    }

    /* Поиск по центру */
    .search-box {
        justify-self: center;
        width: 100%;
        max-width: 280px;
    }

    .search-box input {
        padding: 10px 15px;
        font-size: 13px;
        width: 100%;
    }

    .search-btn {
        padding: 10px 15px;
    }

    /* Корзина справа */
    .cart {
        justify-self: end;
    }
}

/* Телефоны */
@media (max-width: 480px) {
    body {
        padding-top: 85px;
    }

    .header-top {
        padding: 10px 0;
    }

    .header-bottom {
        padding: 8px 0;
    }

    .header-bottom .container {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 10px;
    }

    /* Каталог слева */
    .catalog-btn span {
        display: inline;
        font-size: 12px;
    }

    .catalog-btn {
        padding: 8px 10px;
        gap: 6px;
        white-space: nowrap;
        justify-self: start;
    }

    .catalog-btn i {
        font-size: 14px;
    }

    /* Поиск по центру */
    .search-box {
        justify-self: center;
        width: 100%;
        max-width: 180px;
    }

    .search-box input {
        font-size: 11px;
        padding: 8px 12px;
        width: 100%;
    }

    .search-btn {
        padding: 8px 12px;
    }

    /* Корзина справа */
    .cart {
        justify-self: end;
    }

    .cart-total {
        display: none;
    }

    .login-btn span {
        display: none;
    }

    /* Логотип */
    .logo-tip {
        width: 70px;
    }

    .logo-title {
        font-size: 12px;
    }

    .logo-subtitle {
        font-size: 10px;
    }
}