/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.2;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Шапка */
.header {
    background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
#burger-menu.burger-menu.header-burger {
    display:none;
}

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

.logo-img {
    height: 60px;
    width: auto;
}

.logo-text h1 {
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 5px;
}

.logo-text p {
    font-size: 14px;
    opacity: 0.9;
}

.contact-info {
    display: flex;
    gap: 30px;
    font-size: 16px;
}

.contact-info div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-info i {
    font-size: 20px;
}

/* Навигация */
.navigation {
    background: white;
    border-bottom: 2px solid #4caf50;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    justify-content: space-between;
}

/* Бургер-меню (скрыт по умолчанию) */
#nav-burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.burger-line {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Анимация бургер-меню */
#nav-burger.active .burger-line:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

#nav-burger.active .burger-line:nth-child(2) {
    opacity: 0;
}

#nav-burger.active .burger-line:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* Мобильная корзина (скрыта по умолчанию) */
.mobile-cart {
    display: none;
    align-items: center;
}

.mobile-cart a {
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
    font-size: 20px;
    position: relative;
}

/* Десктопная версия меню */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: stretch;
    transition: transform 0.3s ease;
}

.nav-menu li {
    margin-top: 15px;
    padding: 0;
    flex: 1;
    min-width: 0;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s;
    height: 60px;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
    background: white;
    border-bottom: 3px solid transparent;
}

.nav-menu li a i {
    margin-right: 10px;
    font-size: 17px;
    min-width: 20px;
    text-align: center;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: #f8f9fa;
    color: #2e7d32;
    border-bottom-color: #4caf50;
}

/* Корзина в десктопном меню */
.desktop-cart {
    position: relative;
    flex: 0 0 auto;
    min-width: 90px;
}

.desktop-cart.cart-icon {
    margin-top:8px;
}
.cart-count{
    position: absolute;
    top: -10px;
    right: 1px;
    background: #ff5722;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 1;
}

/* Оверлей для меню */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Герой секция */


.hero-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-content p {
    font-size: 24px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: #4caf50;
    color: white;
}

.btn-primary:hover {
    background: #43a047;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.btn-cart {
    background: #ff9800;
    color: white;
    padding: 10px 20px;
    font-size: 14px;
}

.btn-cart:hover {
    background: #f57c00;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Каталог */
.section-title {
    display: block;
    width: 100%;
    text-align: center !important; /* Принудительно центрируем текст */
    font-size: 36px;
    margin: 50px 0 30px;
    color: #2e7d32;
    position: relative;
    line-height: 1.3;
}

.section-title:after {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background: #4caf50;
    margin: 15px auto 0; /* Центрируем саму полоску */
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 25px;
    background: #f0f0f0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #4caf50;
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #e0e0e0;
}

/* Карточки товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
}

.badge {
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin-right: 5px;
}

.badge.new {
    background: #2196f3;
}

.badge.sale {
    background: #ff5722;
}
.product-image {
    height: 250px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}
.product-card.out-of-stock {
    opacity: 0.7;
}

.product-card.out-of-stock:hover {
    opacity: 1;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #2e7d32;
    line-height: 1.3;
    
    /* Фиксируем высоту ровно под 3 строки */
    height: 70px; /* 18px * 1.3 * 3 строки ≈ 70px */
    
    /* Обрезаем текст, если он длиннее 3 строк */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Максимум 3 строки */
    -webkit-box-orient: vertical;
    overflow: hidden;
    
    /* Выравниваем по верхнему краю, чтобы текст был ровно */
    vertical-align: top;
}

.product-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    
    /* Фиксируем высоту — ровно 3 строки текста */
    height: 63px; /* 14px * 1.5 * 3 строки = 63px */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Максимум 3 строки */
    -webkit-box-orient: vertical;
}

.product-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    font-size: 13px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #555;
}

.detail-item i {
    color: #4caf50;
}

.product-price {
    margin-bottom: 15px;
}

.old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
    margin-right: 10px;
}

.current-price {
    font-size: 24px;
    font-weight: bold;
    color: #e53935;
}

.pack {
    font-size: 14px;
    color: #666;
}

.product-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 18px;
}

.qty-input {
    width: 40px;
    height: 30px;
    border: none;
    text-align: center;
    font-size: 16px;
}

/* Стили для ссылки на страницу товара */
.product-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(76, 175, 80, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 10px;
}

.product-overlay i {
    font-size: 30px;
    margin-bottom: 10px;
}

.product-overlay span {
    font-weight: 600;
    font-size: 16px;
}

.product-image:hover .product-overlay {
    opacity: 1;
}

    /* Стили для боковой панели фильтров */
.filters-sidebar {
    width: 260px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-right: 30px;
    align-self: start;
    position: sticky;
    top: 20px;
}

.filter-group {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-group h4 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #2c3e50;
    font-weight: 600;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 15px;
    color: #555;
}

.filter-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    margin-left: 10px;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Модальные окна */
.cart-modal,
.order-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.cart-content,
.order-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cart-header,
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.cart-header h3,
.order-header h3 {
    color: #2e7d32;
}

.close-cart,
.close-order {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.cart-items {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    gap: 15px;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #e53935;
    font-weight: bold;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.remove-item {
    background: none;
    border: none;
    color: #f44336;
    cursor: pointer;
    font-size: 14px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: bold;
}

/* Форма заказа */
#order-form {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4caf50;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-methods label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
    cursor: pointer;
}

.order-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #ddd;
    font-size: 18px;
}

/* Футер */
.footer {
    background: #2e7d32;
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #fff;
    border-bottom: 2px solid #4caf50;
    padding-bottom: 10px;
}

.footer-section p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: white;
}

.subscribe-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.subscribe-form input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
}

.subscribe-form button {
    background: #ff9800;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: white;
    font-size: 20px;
    transition: transform 0.3s;
}

.social-links a:hover {
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
    color: #e0e0e0;
}

/* Уведомления */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cart-notification.success {
    background: #4caf50;
}

.cart-notification.error {
    background: #f44336;
}

.cart-notification i {
    margin-right: 10px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Анимации */
@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-added {
    animation: bounce 0.5s;
}

.btn-add-to-cart-detail.btn-added {
    animation: pulse 0.5s ease;
}

.add-to-cart.added {
    animation: pulse 0.5s ease;
}

/* Блокировка скролла при открытом меню */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Плавная анимация для всех переходов */
.nav-menu,
#nav-burger,
.menu-overlay {
    will-change: transform, opacity;
}

/* Для поддержки touch-устройств */
@media (hover: none) and (pointer: coarse) {
    .nav-menu li a:active {
        background: rgba(0, 0, 0, 0.05);
    }
}

/* ================== АДАПТИВНОСТЬ ================== */

/* Для планшетов и мобильных (992px и меньше) */
@media (max-width: 992px) {
    /* Шапка */
    .header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .contact-info {
        display: none;
    }
    
    .logo-text h1 {
        font-size: 18px;
    }
    
    .logo-text p {
        font-size: 12px;
    }
    
    /* Навигация */
    #nav-burger {
        display: flex;
    }
    
    .mobile-cart {
        display: flex;
    }
    
    .desktop-cart {
        display: none;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -300px;
        width: 250px;
        background: #2e7d32;
        padding: 40px 20px 20px;
        margin: 0;
        flex-direction: column;
        z-index: 999;
        overflow-y: auto;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-menu li a {
        display: flex;
        align-items: center;
        padding: 15px;
        color: white;
        text-decoration: none;
        font-size: 16px;
        border: none;
        background: transparent;
        text-align: left;
        height: auto;
        justify-content: flex-start;
        border-bottom: none;
    }
    
    .nav-menu li a:hover,
    .nav-menu li a.active {
        background: rgba(255, 255, 255, 0.1);
        color: white;
        border-bottom-color: transparent;
    }
    
    .nav-menu li a i {
        color: white;
    }
    
    .burger-line {
        background-color: #333;
    }
    
    #nav-burger.active .burger-line {
        background-color: white;
    }
    
    /* Герой секция */
    .hero-content h2 {
        font-size: 32px;
    }
    
    .hero-content p {
        font-size: 18px;
    }
    
    /* Корзина в модальном окне */
    .cart-content {
        width: 95% !important;
        max-height: 80vh !important;
        margin: 10vh auto;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
    }
    
    .cart-item-image {
        width: 100%;
        height: 120px;
        margin-bottom: 10px;
    }
    
    .cart-item-controls {
        width: 100%;
        display: flex;
        justify-content: space-between;
        margin-top: 10px;
    }
    
    /* Карточки товаров */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .quantity-selector {
        width: 100%;
    }
    
    /* Страница товара */
    .product-title {
        font-size: 24px;
    }
    
    .current-price-large {
        font-size: 28px;
    }
}

/* Для мобильных (768px и меньше) */
@media (max-width: 768px) {
    .nav-menu {
        height: 70vh;
}        
    .nav-menu li {
        flex: 0 0 calc(50% - 1px);
        max-height: 50px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Для очень маленьких экранов (576px и меньше) */
@media (max-width: 576px) {
    .nav-menu li {
        flex: 0 0 100%;
    }
    
    .product-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .thumbnails {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .similar-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-detail {
        grid-template-columns: 1fr;
    }
    
    .quantity-selector-detail {
        justify-self: center;
        width: 150px;
    }
    
    .tabs-header {
        flex-wrap: wrap;
    }
    
    .tab-header-item {
        flex: 1 0 auto;
        padding: 10px 15px;
        font-size: 16px;
    }
}

/* ================== ИСПРАВЛЕНИЯ ДЛЯ МОБИЛЬНЫХ ================== */

/* Для мобильных (992px и меньше) - исправление шапки */
@media (max-width: 992px) {
    /* Исправление бургер-меню в шапке для мобильных */
    .header-burger {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 24px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        margin-right: 15px;
    }
    
    .header-burger .burger-line {
        display: block;
        width: 100%;
        height: 3px;
        background-color: white;
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    .header-burger.active .burger-line:nth-child(1) {
        transform: translateY(10.5px) rotate(45deg);
        background-color: white;
    }
    
    .header-burger.active .burger-line:nth-child(2) {
        opacity: 0;
    }
    
    .header-burger.active .burger-line:nth-child(3) {
        transform: translateY(-10.5px) rotate(-45deg);
        background-color: white;
    }
     #nav-burger.burger-menu li {
         height: auto;
         padding: 5 0 5 0;
         margin: 0;
     }
    
    /* Скрываем второй бургер в навигации на мобильных */
    #nav-burger {
        display: none !important;
    }
    
    /* Контактная информация в мобильной версии */
    .contact-info {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid rgba(255,255,255,0.2);
        font-size: 14px;
    }
    
    .contact-info div {
        margin-bottom: 8px;
        justify-content: center;
    }
    
    .header-content {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }
    
    .logo {
        flex: 1;
        min-width: 0;
    }
    
    .logo-text h1 {
        font-size: 20px;
    }
    
    .logo-text p {
        font-size: 12px;
    }
    
   /* Исправление мобильной корзины */
@media (max-width: 992px) {
    /* Мобильная корзина - всегда видна в шапке */
    .mobile-cart {
        display: flex !important;
        align-items: center;
        margin-left: auto;
        z-index: 1001;
    }
    
    .mobile-cart a {
        display: flex;
        align-items: center;
        font-size: 20px;
        position: relative;
        padding: 8px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        justify-content: center;
    }
    
    .mobile-cart a:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .mobile-cart .cart-count {
        position: absolute;
        top: -5px;
        right: -5px;
        background: #ff5722;
        color: white;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        font-size: 11px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        z-index: 1;
    }
    
    /* Скрываем десктопную корзину в меню на мобильных */
    .desktop-cart {
        display: none !important;
    }
}

/* Для мобильных (768px и меньше) - полное исправление структуры шапки */
@media (max-width: 768px) {
    .header-content {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
    }
    
    /* Первая строка: бургер + лого + корзина */
    .header-burger {
        order: 1;
        margin-right: 10px;
    }
    
    .logo {
        order: 2;
        flex: 1;
        display: flex;
        align-items: center;
    }
    
    .mobile-cart {
        order: 3;
        margin-left: 10px;
    }
    
    /* Вторая строка: поиск */
    .header-search {
        order: 4;
        margin: 15px 0 0 0;
        width: 100%;
    }
    
    /* Третья строка: контакты */
    .contact-info {
        order: 5;
        width: 100%;
        margin-top: 15px;
        padding-top: 15px;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        border-top: 1px solid rgba(255,255,255,0.2);
    }
    
    .contact-info div {
        margin-bottom: 8px;
    }
}
}
/* Мобильная версия шапки */
@media (max-width: 992px) {
    .header-content {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: 10px 0;
        gap: 10px;
    }
    
    /* Первая строка: бургер + лого + авторизация */
    .header-left {
        order: 1;
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
    }
    
    .header-right {
        order: 2;
        display: flex;
        align-items: center;
        gap: 5px;
    }
    
    /* Блок авторизации */
    .auth-block {
        display: flex;
        align-items: center;
    }
    
    .auth-links {
        display: flex;
        align-items: center;
        gap: 2px;
    }
    
    /* Стили для иконок в мобильной версии */
    .auth-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(255,255,255,0.1);
        border-radius: 50%;
        color: white;
        text-decoration: none;
        transition: background 0.3s;
    }
    
    .auth-link i {
        font-size: 20px;
    }
    
    .auth-link span {
        display: none; /* Скрываем текст на мобильных */
    }
    
    .auth-separator {
        display: none; /* Скрываем разделитель */
    }
    
    /* Специально для ссылки "Выйти" */
    .auth-link.logout-link {
        background: rgba(244, 67, 54, 0.2); /* Легкий красный фон */
    }
    
    .auth-link.logout-link:hover {
        background: rgba(244, 67, 54, 0.3);
    }
    
    /* Вторая строка: поиск + корзина */
    .header-search {
        order: 3;
        display: flex;
        align-items: center;
        width: 100%;
        gap: 10px;
    }
    
    .search-form {
        flex: 1;
        display: flex;
        align-items: center;
        height: 40px;
    }
    
    .search-input {
        flex: 1;
        height: 40px;
        padding: 0 15px;
        border: 1px solid #ddd;
        border-radius: 20px 0 0 20px;
        font-size: 14px;
    }
    
    .search-button {
        width: 40px;
        height: 40px;
        background: #4caf50;
        color: white;
        border: none;
        border-radius: 0 20px 20px 0;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Мобильная корзина - справа от поиска */
    .mobile-cart {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(255,255,255,0.1);
        border-radius: 50%;
        flex-shrink: 0;
    }
    
    .mobile-cart a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        color: white;
        text-decoration: none;
        font-size: 20px;
        position: relative;
    }
    
    .mobile-cart .cart-count {
        position: absolute;
        top: -5px;
        right: -5px;
        background: #ff5722;
        color: white;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        font-size: 11px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Скрываем десктопную корзину */
    .desktop-cart {
        display: none !important;
    }
    
    /* Скрываем второй бургер */
    #nav-burger {
        display: none !important;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .header-left .logo-text p {
        display: none;
    }
    
    .logo-text h1 {
        font-size: 16px;
    }
    
    .logo-img {
        height: 35px;
    }
    
    .auth-link {
        width: 35px;
        height: 35px;
    }
    
    .auth-link i {
        font-size: 16px;
    }
    
    .mobile-cart {
        width: 35px;
        height: 35px;
    }
    
    .mobile-cart a {
        font-size: 16px;
    }
}
/* Стили для сообщений подписки */
#subscribe-message {
    min-height: 20px;
    font-size: 13px;
}

#subscribe-message i {
    margin-right: 5px;
}

#subscribe-message span {
    display: flex;
    align-items: center;
}
/* Лейаут каталога: фильтры слева, товары справа */
.catalog-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Левая колонка — фильтры */
.filters-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 20px;
}

/* Правая колонка — товары */
.products-main {
    flex: 1;
    min-width: 0;
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Адаптация для планшетов */
@media (max-width: 992px) {
    .catalog-layout {
        flex-direction: column;
    }
    
    .filters-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 30px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Адаптация для телефонов */
@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}
/* ================== ТОВАРЫ БЕЗ НАЛИЧИЯ ================== */

/* Приглушаем карточки без наличия */
.product-card.out-of-stock {
    opacity: 0.55 !important;
    filter: grayscale(60%) !important;
    background: #f9f9f9 !important;
    position: relative;
    transition: all 0.3s !important;
}

.product-card.out-of-stock:hover {
    opacity: 0.85 !important;
    filter: grayscale(20%) !important;
    transform: translateY(-5px) !important;
}

/* Бейдж "Нет в наличии" по диагонали */
.product-card.out-of-stock::before {
    content: 'Нет в наличии';
    position: absolute;
    top: 25px;
    right: -35px;
    background: rgba(244, 67, 54, 0.95);
    color: white;
    padding: 6px 45px;
    font-weight: bold;
    font-size: 12px;
    z-index: 10;
    pointer-events: none;
    transform: rotate(45deg);
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Затемняем фото отсутствующего товара */
.product-card.out-of-stock .product-image img {
    opacity: 0.7;
}

.product-card.out-of-stock:hover .product-image img {
    opacity: 0.9;
}

/* Кнопка "В корзину" у отсутствующего товара */
.product-card.out-of-stock .add-to-cart {
    background: #ccc !important;
    cursor: not-allowed !important;
}

.product-card.out-of-stock .add-to-cart:hover {
    background: #ccc !important;
    transform: none !important;
    box-shadow: none !important;
}
/* Выпадающее меню в навигации */
.has-dropdown {
    position: relative;
}

.has-dropdown > a {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 250px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-radius: 0 0 10px 10px;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    z-index: 1000;
}

.has-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    margin: 0;
    padding: 0;
    flex: none;
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    height: auto;
    text-align: left;
    justify-content: flex-start;
    border-bottom: none;
    background: transparent;
    transition: background 0.2s;
}

.dropdown-menu li a:hover {
    background: #f0f8f0;
    color: #2e7d32;
    border-bottom-color: transparent;
}

/* На мобильных — выпадающее меню раскрывается вниз */
@media (max-width: 992px) {
    .dropdown-menu {
        position: static;
        display: block;
        box-shadow: none;
        background: rgba(255,255,255,0.05);
        min-width: 100%;
        padding: 0;
        border-radius: 0;
    }
    
    .dropdown-menu li a {
        color: white;
        padding-left: 40px;
        font-size: 14px;
    }
    
    .dropdown-menu li a:hover {
        background: rgba(255,255,255,0.1);
        color: white;
    }
    
    .has-dropdown > a .fa-chevron-down {
        display: none;
    }
}