/* CSS стили для хедера - вынесены из header.php */

/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
}

/* Иконки */
.icon-fallback {
    display: inline-block;
    width: 16px;
    height: 16px;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    margin-right: 5px;
}

.header-icon .icon-fallback {
    font-size: 16px;
    margin-right: 0;
}

/* Десктопный хедер */
.desktop-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* Верхняя полоса */
.top-header {
    background: #f8f8f8;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.top-header .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-contact-info {
    display: flex;
    align-items: center;
}

.location-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    font-size: 14px;
}

/* Основное меню */
.top-header .main-navigation {
    flex: 1;
    margin: 0 30px;
}

.top-header .primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    gap: 25px;
}

.top-header .primary-menu a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s;
}

.top-header .primary-menu a:hover {
    color: #ff6b00;
}

/* Блок с телефоном */
.header-callback {
    display: flex;
    align-items: center;
}

.phone-main {
    text-align: right;
}

.phone-number {
    font-weight: 700;
    font-size: 16px;
    color: #333;
}

.phone-description {
    font-size: 12px;
    color: #777;
}

/* Нижняя полоса */
.main-header {
    padding: 15px 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Кнопка каталога */
.catalog-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ff6b00;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.catalog-toggle:hover {
    background: #e55d00;
}

.separator {
    width: 1px;
    height: 40px;
    background: #eee;
}

.site-logo img {
    max-height: 50px;
    width: auto;
}

/* Поиск и иконки */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-form {
    position: relative;
    width: 100%;
}

/* Стили для кнопки-триггера */
.search-trigger {
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.search-trigger input {
    padding: 8px 35px 8px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    width: 100%;
    pointer-events: none; /* Делаем инпут некликабельным */
}

.search-trigger .icon-fallback {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    margin: 0;
}

.header-icons {
    display: flex;
    gap: 15px;
}

.header-icon {
    color: #333;
    font-size: 18px;
    position: relative;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.header-icon:hover {
    color: #ff6b00;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b00;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Выпадающее меню каталога */
.catalog-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

.catalog-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 999;
    display: none;
    overflow-y: auto;
    height: auto;
    z-index: 9999;
}

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

.catalog-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 400px;
}

.catalog-categories {
    width: 25%;
    padding: 20px;
    background: #f9f9f9;
    border-right: 1px solid #eee;
}

.catalog-categories h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.catalog-categories ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.catalog-category {
    margin-bottom: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.catalog-category a {
    display: block;
    padding: 10px;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
    flex: 1;
}

.catalog-category a:hover,
.catalog-category.active a {
    background: #ff6b00;
    color: white;
}

.catalog-divider {
    width: 1px;
    background: #eee;
}

.catalog-subcategories {
    width: 75%;
    padding: 20px;
    position: relative; /* Для позиционирования загрузчика */
}

/* Мобильный хедер */
.mobile-header {
    display: none;
    background: #fff;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.mobile-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-logo img {
    max-height: 30px;
    width: auto;
}

.mobile-cart {
    position: relative;
}

.mobile-search {
    width: 100%;
}

.mobile-search form {
    display: flex;
    width: 100%;
}

.mobile-search input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px 0 0 5px;
    font-size: 14px;
}

.mobile-search button {
    background: #ff6b00;
    border: none;
    padding: 10px 15px;
    border-radius: 0 5px 5px 0;
    color: white;
    cursor: pointer;
}

/* Мобильное меню */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background: #fff;
    z-index: 1000;
    transition: left 0.3s;
    overflow-y: auto;
}

.mobile-menu.open {
    left: 0;
}

.mobile-menu-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-content {
    padding: 20px;
}

.mobile-primary-menu {
    list-style: none;
    margin: 0 0 30px 0;
    padding: 0;
}

.mobile-primary-menu li {
    margin-bottom: 15px;
}

.mobile-primary-menu a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-contacts {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.mobile-phone, .mobile-work-time {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #333;
}

.mobile-callback-button {
    width: 100%;
    background: #ff6b00;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .desktop-header {
        display: none;
    }
    
    .mobile-header {
        display: block;
    }
    
    .site-content {
        margin-top: 80px;
    }
    
    .catalog-container {
        flex-direction: column;
    }
    
    .catalog-categories {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .catalog-subcategories {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .mobile-header {
        padding: 10px;
    }
    
    .mobile-logo img {
        max-height: 25px;
    }
}

/* Стили для меню каталога */
.subcategory-section {
    margin-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}
.subcategory-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.subcategory-title-link a {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
    display: inline-block;
    margin-bottom: 15px;
}
.subcategory-title-link a:hover {
    color: #ff6b00;
}
.subcategory-attributes-wrapper {
    display: flex;
    flex-wrap: wrap; 
    gap: 30px;
    padding-left: 10px;
}
.attribute-column {
    min-width: 180px;
}
.attribute-column-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}
.attribute-column .attribute-item {
    margin-bottom: 8px;
}
.attribute-column .attribute-item a {
    font-size: 14px;
    color: #555;
    text-decoration: none;
    transition: color 0.3s;
}
.attribute-column .attribute-item a:hover {
    color: #ff6b00;
}

/* Десктопные стили */
@media (min-width: 1025px) {
    .mobile-header {
        display: none;
    }
    
    .desktop-header {
        display: block;
    }
}

/* Контент */
.site-content {
    padding-top: 20px;
}

/* Стили для полноэкранного поиска */
#fullscreen-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 9999;
    display: none;
    overflow-y: auto;
    padding: 20px;
}

.close-search {
    position: fixed;
    top: 30px;
    right: 50px;
    background: none;
    border: none;
    font-size: 40px;
    color: #333;
    cursor: pointer;
    line-height: 1;
}

.search-overlay-content {
    max-width: 800px;
    margin: 5% auto 0;
}

#fullscreen-search-form input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid #333;
    font-size: 40px;
    font-weight: 500;
    padding: 10px 0;
    outline: none;
    color: #333;
}
#fullscreen-search-form input::placeholder {
    color: #ccc;
}

#fullscreen-search-results {
    margin-top: 40px;
}

.search-result-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
}
.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-right: 20px;
}

.search-result-info h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.search-result-info .price {
    font-size: 16px;
    font-weight: 500;
    color: #ff6b00;
}