/*
Theme Name: Twenty Twenty-Four Child
Template: twentytwentyfour
*/

/* ===== ОБНОВЛЕННАЯ ЦВЕТОВАЯ СХЕМА ===== */
:root {
    --color-black: #000000;
    --color-white: #ffffff;
    --color-gray-light: #f5f5f5;
    --color-gray: #888888;
    --color-gray-dark: #333333;
    --color-sold: #ff3b30;
    --color-success: #28a745;
    --color-telegram: #0088cc;
    --color-border: #e0e0e0;
}

/* ===== ОСНОВНЫЕ СТИЛИ КАТАЛОГА ===== */
.catalog-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    background: var(--color-white);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* ===== КАРТОЧКА ТОВАРА ===== */
.product-card {
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--color-white);
    border: 1px solid var(--color-gray-light);
    position: relative;
    cursor: pointer;
}

.product-card:hover {
    border-color: var(--color-gray);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transform: translateY(-3px);
}

.product-image-wrapper {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--color-gray-light);
}

.product-main-image,
.product-hover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease;
}

.product-hover-image {
    opacity: 0;
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-card:hover .product-main-image {
    opacity: 0;
}

.product-card:hover .product-hover-image {
    opacity: 1;
}

/* Бейдж SOLD OUT */
.sold-out-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--color-sold);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.quick-view-btn {
    background: var(--color-white);
    color: var(--color-black);
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
}

.quick-view-btn:hover {
    background: var(--color-black);
    color: var(--color-white);
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 18px;
    margin: 0 0 10px 0;
    color: var(--color-black);
    font-weight: 600;
    line-height: 1.3;
}

.product-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.product-category {
    font-size: 11px;
    color: var(--color-gray);
    padding: 3px 10px;
    border: 1px solid var(--color-gray-light);
    border-radius: 12px;
    background: var(--color-gray-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Цена и статус SOLD OUT */
.product-price-container {
    margin: 10px 0;
    min-height: 30px;
}

.product-price {
    color: var(--color-black);
    font-weight: 700;
    font-size: 20px;
    margin: 15px 0;
}

.product-sold-out {
    color: var(--color-sold);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--color-sold);
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-block;
    margin: 12px 0;
    background: rgba(255, 59, 48, 0.05);
}

/* ===== КНОПКИ НА КАРТОЧКАХ ===== */
.select-product-btn {
    background: var(--color-black) !important;
    color: var(--color-white) !important;
    border: none !important;
    padding: 12px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    width: 100% !important;
    margin-top: 15px !important;
    transition: all 0.3s ease !important;
    font-size: 16px !important;
}

.select-product-btn:hover {
    background: #333 !important;
}

.out-of-stock-btn {
    background: var(--color-gray-light) !important;
    color: var(--color-gray) !important;
    border: 1px solid var(--color-border) !important;
    padding: 12px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    width: 100% !important;
    margin-top: 15px !important;
    cursor: not-allowed !important;
    font-size: 16px !important;
}

/* Быстрое добавление (только для товаров БЕЗ размеров) */
.add-to-cart-btn.quick-add {
    background: var(--color-gray-light) !important;
    color: var(--color-gray-dark) !important;
    border: 1px solid var(--color-border) !important;
    padding: 8px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    width: 100% !important;
    margin-top: 10px !important;
    transition: all 0.3s ease !important;
}

.add-to-cart-btn.quick-add:hover {
    background: #e0e0e0 !important;
}

/* ===== ФИЛЬТРЫ ===== */
.catalog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--color-gray-light);
    max-width: 100%;
    overflow: visible !important;
}

.filter-btn {
    background: var(--color-white);
    border: 1px solid var(--color-gray-light);
    color: var(--color-black);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    flex-shrink: 0;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
}

/* ===== МОДАЛЬНОЕ ОКНО ТОВАРА ===== */
#product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--color-white);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    margin: 5vh auto;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
    z-index: 10000;
    animation: modalAppear 0.4s ease;
    overflow-y: auto;
}

@keyframes modalAppear {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--color-white);
    color: var(--color-black);
    border: 1px solid var(--color-gray-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    font-size: 24px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
}

.modal-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-gallery-main {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background: var(--color-gray-light);
}

.modal-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
}

.modal-gallery-thumbs img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.modal-gallery-thumbs img:hover,
.modal-gallery-thumbs img.active {
    opacity: 1;
    border: 2px solid var(--color-black);
}

.modal-info {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-right: 10px;
    max-height: calc(90vh - 80px);
}

/* Настраиваем скроллбар для правой части */
.modal-info::-webkit-scrollbar {
    width: 6px;
}

.modal-info::-webkit-scrollbar-track {
    background: var(--color-gray-light);
    border-radius: 3px;
}

.modal-info::-webkit-scrollbar-thumb {
    background: var(--color-gray);
    border-radius: 3px;
}

.modal-info::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-dark);
}

#modal-title {
    font-size: 28px;
    margin: 0 0 20px 0;
    color: var(--color-black);
    font-weight: 700;
    line-height: 1.2;
}

#modal-categories {
    margin-bottom: 20px;
    color: var(--color-gray);
    font-size: 14px;
}

#modal-price {
    color: var(--color-black);
    font-size: 24px;
    font-weight: 700;
    margin: 15px 0;
}

.modal-sold-out {
    color: var(--color-sold);
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 15px 0;
    padding: 8px 16px;
    border: 2px solid var(--color-sold);
    border-radius: 6px;
    display: inline-block;
    background: rgba(255, 59, 48, 0.05);
}

/* ===== СТИЛИ ДЛЯ ОПИСАНИЯ В МОДАЛЬНОМ ОКНЕ ===== */
.modal-description {
    max-height: 300px;
    overflow-y: auto;
    color: var(--color-gray-dark);
    line-height: 1.6;
    margin: 15px 0;
    font-size: 16px;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    font-family: inherit;
}

/* Стили для скроллбара в описании */
.modal-description::-webkit-scrollbar {
    width: 4px;
}

.modal-description::-webkit-scrollbar-track {
    background: var(--color-gray-light);
    border-radius: 2px;
}

.modal-description::-webkit-scrollbar-thumb {
    background: var(--color-gray);
    border-radius: 2px;
}

/* Убираем стандартные отступы у параграфов */
.modal-description p {
    margin: 0 0 12px 0 !important;
    line-height: 1.5;
}

/* Последний абзац без отступа */
.modal-description p:last-child {
    margin-bottom: 0 !important;
}

/* Сохраняем переносы строк в абзацах */
.modal-description p {
    white-space: pre-wrap !important;
}

/* Стили для списков в описании */
.modal-description ul,
.modal-description ol {
    margin: 10px 0 15px 20px;
    padding-left: 20px;
}

.modal-description li {
    margin-bottom: 5px;
    line-height: 1.5;
}

/* Стили для заголовков в описании */
.modal-description h1,
.modal-description h2,
.modal-description h3,
.modal-description h4,
.modal-description h5,
.modal-description h6 {
    margin: 15px 0 10px 0;
    font-weight: 600;
    color: var(--color-black);
}

/* ===== БЛОК ВЫБОРА РАЗМЕРОВ ===== */
.size-selection {
    max-height: 250px;
    overflow-y: auto;
    margin: 10px 0 15px 0;
    padding: 15px 0;
    border-top: 1px solid var(--color-gray-light);
    border-bottom: 1px solid var(--color-gray-light);
}

.size-selection-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-black);
}

/* Сетка размеров - МАКСИМУМ 2 КОЛОНКИ */
.sizes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.size-select-item {
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--color-white);
}

.size-select-item:hover:not(.unavailable) {
    border-color: var(--color-black);
    background: #f9f9f9;
}

.size-select-item.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9f9f9;
}

.size-name {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--color-black);
}

.size-select-item.unavailable .size-name {
    text-decoration: line-through;
    color: var(--color-gray);
}

.size-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.size-controls button {
    width: 22px;
    height: 22px;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.size-controls button:hover {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
}

.size-quantity {
    min-width: 20px;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-black);
}

/* Сводка выбранных размеров */
#size-summary {
    margin-top: 15px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    font-size: 13px;
}

#size-summary h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: var(--color-black);
    font-weight: 600;
}

.selected-size-item {
    padding: 6px 8px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 12px;
}

/* ===== КНОПКА В МОДАЛЬНОМ ОКНЕ (ДЛЯ ДЕСКТОПА) ===== */
.add-to-cart-from-modal {
    background: var(--color-black);
    color: var(--color-white);
    border: 2px solid var(--color-black);
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px;
    margin-bottom: 0;
}

.add-to-cart-from-modal:hover:not(:disabled) {
    background: var(--color-white);
    color: var(--color-black);
}

.add-to-cart-from-modal:disabled {
    background: var(--color-gray-light);
    color: var(--color-gray);
    border-color: var(--color-gray-light);
    cursor: not-allowed;
}

/* ===== КОРЗИНА ===== */
.cart-counter {
    background: var(--color-sold);
    color: var(--color-white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-left: 5px;
}

/* ===== МИНИ-КОРЗИНА (плавающая кнопка) ===== */
#mini-cart {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

#cart-toggle {
    background: var(--color-black);
    color: var(--color-white);
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#cart-toggle:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* ===== МОДАЛЬНОЕ ОКНО КОРЗИНЫ ===== */
#cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

#cart-modal .modal-content {
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    max-width: 500px;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 30px;
}

#cart-modal .modal-close {
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    font-size: 20px;
}

#cart-items {
    max-height: 50vh;
    overflow-y: auto;
    margin: 20px 0;
    padding-right: 10px;
}

#cart-items::-webkit-scrollbar {
    width: 6px;
}

#cart-items::-webkit-scrollbar-track {
    background: var(--color-gray-light);
    border-radius: 3px;
}

#cart-items::-webkit-scrollbar-thumb {
    background: var(--color-gray);
    border-radius: 3px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-gray-light);
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-black);
}

.cart-item-details {
    font-size: 14px;
    color: var(--color-gray);
}

.remove-from-cart {
    background: none;
    border: none;
    color: var(--color-sold);
    cursor: pointer;
    font-size: 20px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.remove-from-cart:hover {
    background: rgba(255, 59, 48, 0.1);
}

#clear-cart {
    width: 100%;
    padding: 12px;
    background: var(--color-gray-light);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    color: var(--color-gray-dark);
}

#clear-cart:hover {
    background: #e0e0e0;
}

.telegram-order-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--color-telegram);
    color: var(--color-white);
    text-align: center;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-bottom: 0;
    box-sizing: border-box;
}

.telegram-order-btn:hover {
    background: #0077b3;
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--color-black);
    color: var(--color-white);
    padding: 15px 25px;
    border-radius: 8px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    font-weight: 500;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success {
    background: var(--color-success);
}

.notification.error {
    background: var(--color-sold);
}

/* ===== АНИМАЦИИ ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ========================================== */
/* УЛУЧШЕННАЯ МОБИЛЬНАЯ ОПТИМИЗАЦИЯ МОДАЛЬНОГО ОКНА */
/* ========================================== */
@media (max-width: 768px) {
    /* Модальное окно */
    #product-modal .modal-content {
        grid-template-columns: 1fr;
        width: 95%;
        max-width: 95%;
        height: 90vh;
        max-height: 90vh;
        margin: 5vh auto;
        padding: 0;
        gap: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        border-radius: 12px;
    }
    
    /* Галерея сверху */
    .modal-gallery-container {
        flex: 0 0 40%;
        min-height: 40%;
        order: 1;
        display: flex;
        flex-direction: column;
        position: relative;
        background: var(--color-gray-light);
        border-radius: 12px 12px 0 0;
        overflow: hidden;
    }
    
    .modal-gallery-main {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--color-gray-light);
        padding: 10px;
    }
    
    #modal-main-image {
        max-height: 100%;
        max-width: 100%;
        object-fit: contain;
        cursor: pointer;
    }
    
    .modal-gallery-thumbs {
        flex: 0 0 auto;
        padding: 8px;
        background: var(--color-white);
        border-top: 1px solid var(--color-border);
        display: flex;
        gap: 6px;
        overflow-x: auto;
    }
    
    .modal-gallery-thumbs img {
        width: 55px;
        height: 55px;
        object-fit: cover;
        border-radius: 6px;
        flex-shrink: 0;
    }
    
    /* Информация о товаре */
    .modal-info {
        flex: 1;
        order: 2;
        padding: 12px 15px;
        max-height: none; /* Убираем ограничение высоты */
        overflow-y: auto; /* Включаем скролл */
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    /* Заголовок товара */
    #modal-title {
        font-size: 18px;
        margin-bottom: 3px;
        line-height: 1.3;
    }
    
    /* Категории товара */
    #modal-categories {
        margin-bottom: 4px;
        font-size: 12px;
    }
    
    /* Цена товара */
    #modal-price {
        font-size: 20px;
        margin: 2px 0 4px 0;
        font-weight: 700;
    }
    
    /* ========================================== */
    /* ИЗМЕНЕНИЕ: ОПИСАНИЕ ТОВАРА БЕЗ СКРОЛЛА */
    /* ========================================== */
    .modal-description {
        max-height: none !important; /* Убираем ограничение высоты */
        overflow-y: visible !important; /* Убираем скролл */
        overflow: visible !important;
        margin: 4px 0 6px 0;
        font-size: 13px;
        line-height: 1.4;
        flex-shrink: 0;
        color: var(--color-gray-dark);
        -webkit-overflow-scrolling: auto !important; /* Отключаем инерционный скролл на iOS */
    }
    
    /* Убираем скроллбар для описания */
    .modal-description::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    /* ========================================== */
    /* ИЗМЕНЕНИЕ: УБИРАЕМ СКРОЛЛ У БЛОКА ВЫБОРА РАЗМЕРА */
    /* ========================================== */
    .size-selection {
        margin: 4px 0;
        padding: 8px 0;
        /* УБИРАЕМ ОГРАНИЧЕНИЕ ВЫСОТЫ И СКРОЛЛ */
        max-height: none !important;
        overflow-y: visible !important;
        overflow: visible !important;
        -webkit-overflow-scrolling: auto !important;
        flex-shrink: 0;
    }
    
    .size-selection-title {
        font-size: 13px !important;
        margin-bottom: 6px !important;
    }
    
    /* Сетка размеров - 2 колонки */
    .sizes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        /* Убираем ограничения для отображения всех размеров */
        max-height: none !important;
        overflow: visible !important;
    }
    
    .size-select-item {
        padding: 6px 3px !important;
    }
    
    .size-name {
        font-size: 11px !important;
        margin-bottom: 5px !important;
    }
    
    .size-controls button {
        width: 20px !important;
        height: 20px !important;
        font-size: 12px !important;
    }
    
    .size-quantity {
        font-size: 11px !important;
        min-width: 16px !important;
    }
    
    /* Сводка выбранных размеров */
    #size-summary {
        margin-top: 8px;
        padding: 8px;
        font-size: 12px;
        flex-shrink: 0;
    }
    
    .selected-size-item {
        padding: 5px;
        font-size: 11px;
        margin-bottom: 3px;
    }
    
    /* ========================================== */
    /* ИЗМЕНЕНИЕ: КНОПКА "ДОБАВИТЬ В КОРЗИНУ" ТЕПЕРЬ ВНУТРИ SCROLLABLE БЛОКА */
    /* ========================================== */
    #modal-add-to-cart {
        /* Убираем фиксированное позиционирование */
        position: static;
        transform: none;
        width: 100%;
        max-width: 100%;
        margin: 15px 0 20px 0;
        padding: 14px 16px;
        font-size: 16px;
        font-weight: 600;
        background: var(--color-black);
        color: var(--color-white);
        border: none;
        border-radius: 8px;
        cursor: pointer;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        letter-spacing: 0.3px;
        
        /* Убираем сложную обводку для фиксированной кнопки */
        box-shadow: none;
        border: 2px solid var(--color-black);
        transition: all 0.3s ease;
    }
    
    #modal-add-to-cart:hover:not(:disabled) {
        background: var(--color-white);
        color: var(--color-black);
        transform: none;
        box-shadow: none;
    }
    
    #modal-add-to-cart:active:not(:disabled) {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    #modal-add-to-cart:disabled {
        background: var(--color-gray-light);
        color: var(--color-gray);
        border-color: var(--color-gray-light);
        cursor: not-allowed;
        transform: none;
    }
    
    /* Стиль для кнопки "Добавлено" */
    #modal-add-to-cart[data-added="true"] {
        background: var(--color-success);
        border-color: var(--color-success);
        color: var(--color-white);
    }
    
    /* Кнопка закрытия */
    .modal-close {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        background: rgba(0, 0, 0, 0.8);
        color: white;
        z-index: 10001;
        border: 2px solid rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(5px);
        font-size: 22px;
    }
    
    /* ===== ОГРАНИЧИВАЕМ ОБЛАСТЬ КЛИКА ПО ИЗОБРАЖЕНИЮ ===== */
    /* Уменьшаем область клика до центрального квадрата */
    .modal-gallery-main {
        position: relative;
        overflow: hidden;
    }
    
    #modal-main-image {
        /* Уменьшаем область кликабельности через псевдоэлемент */
        position: relative;
        cursor: pointer;
    }
    
    #modal-main-image::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 40px;
        height: 40px;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 50%;
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 10;
    }
    
    #modal-main-image:hover::after {
        opacity: 1;
    }
    
    /* Показываем индикатор кликабельности только при наведении */
    #modal-main-image::before {
        content: '🔍';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.8);
        font-size: 16px;
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 11;
        pointer-events: none;
    }
    
    #modal-main-image:hover::before {
        opacity: 0.7;
    }
    
    /* Уменьшаем миниатюры */
    .modal-gallery-thumbs img {
        width: 50px !important;
        height: 50px !important;
    }
    
    /* ===== КНОПКА ЗАКРЫТИЯ - ДЕЛАЕМ БОЛЬШЕ И ВЫДЕЛЕННЕЕ ===== */
    .modal-close {
        top: 8px !important;
        right: 8px !important;
        width: 40px !important;
        height: 40px !important;
        background: rgba(0, 0, 0, 0.9) !important;
        color: white !important;
        border: 2px solid white !important;
        font-size: 26px !important;
        font-weight: 700 !important;
        z-index: 10002 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
    }
    
    /* Делаем область вокруг кнопки закрытия также кликабельной */
    .modal-close::after {
        content: '';
        position: absolute;
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
    }
}

/* ===== ПОДВАЛ ===== */
.site-footer {
    margin-top: 60px;
    padding: 40px 20px;
    background: var(--color-gray-light);
    border-top: 1px solid var(--color-border);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-info {
    color: var(--color-gray);
    font-size: 14px;
}

/* ===== УТИЛИТЫ ===== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== ЗАГРУЗКА ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--color-gray-light);
    border-radius: 50%;
    border-top-color: var(--color-black);
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА КОРЗИНЫ ===== */
#cart-modal .modal-content h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: var(--color-black);
}

#cart-modal-total {
    color: var(--color-black);
    font-weight: 700;
}

/* ===== СТИЛИ ДЛЯ КНОПОК ВЫБОРА РАЗМЕРОВ ===== */
.size-select-item .size-controls button {
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
}

.size-select-item .size-controls button:hover {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
}

.size-select-item .size-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.size-select-item .size-controls button:disabled:hover {
    background: var(--color-white);
    color: var(--color-gray);
    border-color: var(--color-border);
}

/* ===== СТИЛИ ДЛЯ ВЫБРАННЫХ РАЗМЕРОВ ===== */
.size-select-item.selected {
    border-color: var(--color-black);
    background: #f9f9f9;
}

.size-select-item.selected .size-name {
    color: var(--color-black);
}

/* ===== СТИЛИ ДЛЯ НЕДОСТУПНЫХ РАЗМЕРОВ ===== */
.size-select-item.unavailable .size-controls {
    display: none;
}

/* ===== СТИЛИ ДЛЯ ОКНА УВЕДОМЛЕНИЙ ===== */
.notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10010;
    pointer-events: none;
}

/* ===== СТИЛИ ДЛЯ СКРОЛЛБАРА ===== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: var(--color-gray-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--color-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-dark);
}

/* ===== СТИЛИ ДЛЯ ПУСТОЙ КОРЗИНЫ ===== */
.empty-cart-message {
    text-align: center;
    color: var(--color-gray);
    padding: 40px 0;
    font-size: 16px;
}

/* ===== СТИЛИ ДЛЯ ОШИБОК ===== */
.error-message {
    color: var(--color-sold);
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

/* ===== СТИЛИ ДЛЯ УСПЕШНЫХ ОПЕРАЦИЙ ===== */
.success-message {
    color: var(--color-success);
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.success-message.show {
    display: block;
}

/* ===== СТИЛИ ДЛЯ ЗАГРУЗКИ ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10020;
    display: none;
}

.loading-overlay.show {
    display: flex;
}

/* ===== СТИЛИ ДЛЯ МОБИЛЬНОЙ КОРЗИНЫ ===== */
@media (max-width: 768px) {
    #cart-modal .modal-content {
        width: 80%;
        margin: 10px auto;
        padding: 15px;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .remove-from-cart {
        align-self: flex-end;
    }
}

/* ===== СТИЛИ ДЛЯ КНОПКИ ВЫБОРА РАЗМЕРА ===== */
.select-product-btn:disabled {
    background: var(--color-gray-light) !important;
    color: var(--color-gray) !important;
    cursor: not-allowed !important;
    border-color: var(--color-gray-light) !important;
}

.select-product-btn.added {
    background: var(--color-success) !important;
    color: var(--color-white) !important;
}

/* ===== СТИЛИ ДЛЯ ИНПУТОВ КОЛИЧЕСТВА ===== */
.quantity-input {
    width: 60px;
    text-align: center;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 5px;
    font-size: 14px;
}

/* ===== СТИЛИ ДЛЯ ЗАГОЛОВКОВ ===== */
.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--color-black);
    text-align: center;
}

/* ===== СТИЛИ ДЛЯ РАЗДЕЛИТЕЛЕЙ ===== */
.divider {
    height: 1px;
    background: var(--color-gray-light);
    margin: 30px 0;
    border: none;
}

/* ===== СТИЛИ ДЛЯ ИКОНОК ===== */
.icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}

.icon-small {
    width: 16px;
    height: 16px;
}

.icon-medium {
    width: 20px;
    height: 20px;
}

.icon-large {
    width: 24px;
    height: 24px;
}

/* ===== СТИЛИ ДЛЯ ТЕНЕЙ ===== */
.shadow-sm {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.shadow-md {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.shadow-lg {
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

/* ===== СТИЛИ ДЛЯ ОКРУГЛЕНИЙ ===== */
.rounded-sm {
    border-radius: 4px;
}

.rounded-md {
    border-radius: 8px;
}

.rounded-lg {
    border-radius: 12px;
}

.rounded-full {
    border-radius: 9999px;
}

/* ===== СТИЛИ ДЛЯ ОТСТУПОВ ===== */
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }

.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.m-5 { margin: 20px; }

/* ===== СТИЛИ ДЛЯ ВЫРАВНИВАНИЯ ТЕКСТА ===== */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* ===== СТИЛИ ДЛЯ ВЕСА ШРИФТА ===== */
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* ===== СТИЛИ ДЛЯ ЦВЕТОВ ТЕКСТА ===== */
.text-black { color: var(--color-black); }
.text-white { color: var(--color-white); }
.text-gray { color: var(--color-gray); }
.text-gray-dark { color: var(--color-gray-dark); }
.text-sold { color: var(--color-sold); }
.text-success { color: var(--color-success); }

/* ===== СТИЛИ ДЛЯ ФОНОВ ===== */
.bg-black { background: var(--color-black); }
.bg-white { background: var(--color-white); }
.bg-gray-light { background: var(--color-gray-light); }
.bg-sold { background: var(--color-sold); }
.bg-success { background: var(--color-success); }
.bg-telegram { background: var(--color-telegram); }

/* ===== СТИЛИ ДЛЯ ГРАНИЦ ===== */
.border { border: 1px solid var(--color-border); }
.border-t { border-top: 1px solid var(--color-border); }
.border-b { border-bottom: 1px solid var(--color-border); }
.border-l { border-left: 1px solid var(--color-border); }
.border-r { border-right: 1px solid var(--color-border); }

/* ===== СТИЛИ ДЛЯ ДИСПЛЕЯ ===== */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }

/* ===== СТИЛИ ДЛЯ ПОЗИЦИОНИРОВАНИЯ ===== */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* ===== ФИНАЛЬНЫЕ СТИЛИ ДЛЯ ОТЛАДКИ ===== */
.debug {
    border: 1px solid red;
}

.debug-2 {
    border: 1px solid blue;
}

.debug-3 {
    border: 1px solid green;
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ ИСПРАВЛЕНИЯ ===== */
#total-price-container {
    margin-left: 10px;
    display: inline-block;
}

#selected-sizes-list {
    margin-bottom: 10px;
}

.size-select-item {
    position: relative;
}

.size-select-item .size-controls {
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

/* Улучшение отображения выбранных размеров */
#size-summary {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.selected-size-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

/* Анимация при выборе размера */
.size-select-item:not(.unavailable) {
    transition: all 0.2s ease;
}

.size-select-item:not(.unavailable):active {
    transform: scale(0.98);
}

/* Цена в модальном окне */
#modal-price {
    font-size: 26px;
    margin: 20px 0;
}

/* ========================================== */
/* МАЛЕНЬКИЕ ЭКРАНЫ (до 480px) */
/* ========================================== */
@media (max-width: 480px) {
    /* Еще больше уменьшаем отступы для маленьких экранов */
    .modal-info {
        padding: 10px 12px;
        gap: 1px;
    }
    
    #modal-title {
        font-size: 17px;
        margin-bottom: 2px;
    }
    
    /* Категории еще ближе к заголовку */
    #modal-categories {
        margin-bottom: 2px;
        font-size: 11px;
    }
    
    /* Цена еще ближе к категориям */
    #modal-price {
        font-size: 19px;
        margin: 1px 0 3px 0;
    }
    
    /* Описание очень близко к цене */
    .modal-description {
        margin: 3px 0 5px 0;
        font-size: 12px;
        line-height: 1.35;
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* Галерея - уменьшаем высоту чтобы было больше места для контента */
    .modal-gallery-container {
        flex: 0 0 35%;
        min-height: 35%;
    }
    
    .modal-info {
        max-height: 65vh;
    }
    
    /* Размеры товаров */
    .sizes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
    
    .size-select-item {
        padding: 6px 3px;
    }
    
    .size-name {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .size-controls button {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
    
    .size-quantity {
        font-size: 11px;
        min-width: 18px;
    }
    
    .size-selection-title {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    /* Кнопка добавления в корзину для маленьких экранов */
    #modal-add-to-cart {
        padding: 12px 14px;
        font-size: 15px;
        min-height: 44px;
    }
}

/* Исправление для мобильных устройств */
@media (max-width: 768px) {
    .modal-content {
        max-height: 85vh;
        margin: 7.5vh auto;
    }
    
    #modal-title {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    #modal-price {
        font-size: 22px;
    }
    
    .size-selection-title {
        font-size: 16px;
    }
    
    .size-name {
        font-size: 15px;
    }
}

/* Исправление для очень маленьких экранов */
@media (max-width: 360px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .product-title {
        font-size: 14px;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .sizes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .size-select-item {
        padding: 10px 6px;
    }
    
    .size-name {
        font-size: 13px;
    }
}

/* ===== ИСПРАВЛЕНИЕ ВЫРАВНИВАНИЯ КАРТОЧЕК ===== */
.products-grid {
    align-items: stretch;
}

.product-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--color-white);
    border: 1px solid var(--color-gray-light);
    position: relative;
}

/* Для кнопок внутри карточек - оставляем свой курсор */
.product-card .select-product-btn,
.product-card .out-of-stock-btn,
.product-card .add-to-cart-btn,
.product-card .quick-view-btn {
    cursor: pointer;
}

.product-image-wrapper {
    flex-shrink: 0;
    height: 320px;
    position: relative;
    overflow: hidden;
}

.product-main-image,
.product-hover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease;
}

.product-hover-image {
    opacity: 0;
}

.product-card:hover .product-main-image {
    opacity: 0;
}

.product-card:hover .product-hover-image {
    opacity: 1;
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.product-title {
    flex-shrink: 0;
    min-height: 2.5em;
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #000000;
    font-weight: 600;
    line-height: 1.3;
}

.product-categories {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    min-height: 1.5em;
}

.product-category {
    font-size: 11px;
    color: #888888;
    padding: 3px 10px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    background: #f5f5f5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-price-container {
    flex-shrink: 0;
    margin: 10px 0;
    min-height: 30px;
    display: flex;
    align-items: center;
}

.product-price {
    color: #000000;
    font-weight: 700;
    font-size: 20px;
}

.product-sold-out {
    color: #ff3b30;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid #ff3b30;
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-block;
    background: rgba(255, 59, 48, 0.05);
}

/* Контейнер для кнопок */
.product-buttons-container {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

/* Адаптивность */
@media (max-width: 992px) {
    .product-image-wrapper {
        height: 280px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
    
    .product-image-wrapper {
        height: 250px;
    }
    
    .product-title {
        font-size: 16px;
        min-height: 2em;
    }
    
    .product-price {
        font-size: 18px;
    }
    
    .product-info {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .product-image-wrapper {
        height: 200px;
    }
    
    .product-title {
        font-size: 15px;
        min-height: 1.8em;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .select-product-btn,
    .out-of-stock-btn {
        padding: 10px !important;
        font-size: 14px !important;
    }
    
    .add-to-cart-btn.quick-add {
        padding: 8px !important;
        font-size: 13px !important;
    }
}

/* ===== ШАПКА САЙТА ===== */
.site-header {
    background: var(--color-white);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
    border-bottom: 1px solid var(--color-gray-light);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

/* Логотип */
.logo-container {
    flex: 0 0 auto;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--color-black);
    gap: 15px;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-image {
    height: 50px;
    width: auto;
    border-radius: 8px;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.site-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--color-black);
    line-height: 1.2;
}

.site-tagline {
    margin: 3px 0 0 0;
    font-size: 13px;
    color: var(--color-gray);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Основная навигация */
.main-navigation {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--color-black);
    font-weight: 600;
    font-size: 15px;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--color-gray-dark);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-black);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-menu .current-menu-item a {
    color: var(--color-black);
}

.nav-menu .current-menu-item a::after {
    width: 100%;
}

/* Правый блок (соцсети + корзина) */
.header-right-section {
    display: flex;
    align-items: center;
    gap: 40px;
    flex: 0 0 auto;
}

/* Иконки социальных сетей */
.social-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
    background: var(--color-gray-light);
}

.social-icon:hover {
    transform: translateY(-2px);
    background: var(--color-black);
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--color-black);
    transition: fill 0.3s ease;
}

.social-icon:hover svg {
    fill: var(--color-white);
}

/* Корзина в шапке */
.header-cart {
    flex: 0 0 auto;
}

.cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 50px;
    height: 50px;
    background: var(--color-gray-light);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cart-icon:hover {
    background: var(--color-black);
    transform: translateY(-2px);
}

.cart-icon:hover .cart-icon-symbol {
    color: var(--color-white);
}

.cart-icon-symbol {
    font-size: 20px;
    color: var(--color-black);
    transition: color 0.3s ease;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--color-sold);
    color: var(--color-white);
    font-size: 12px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Кнопка мобильного меню */
.mobile-menu-toggle {
    display: none !important;
}

/* Мобильное меню - скрываем */
.mobile-navigation {
    display: none !important;
}

/* Мобильное меню */
.mobile-navigation {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-white);
    z-index: 999;
    padding: 100px 20px 40px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-navigation.active {
    transform: translateX(0);
}

.mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu li {
    margin: 0;
    border-bottom: 1px solid var(--color-gray-light);
}

.mobile-menu a {
    display: block;
    padding: 20px 0;
    text-decoration: none;
    color: var(--color-black);
    font-size: 18px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.mobile-menu a:hover {
    color: var(--color-gray-dark);
}

.mobile-menu .current-menu-item a {
    color: var(--color-black);
    position: relative;
}

.mobile-menu .current-menu-item a::after {
    content: '';
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 30px;
    height: 3px;
    background: var(--color-black);
}

.mobile-menu-close {
    position: absolute;
    top: 25px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    color: var(--color-black);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background: var(--color-gray-light);
}

/* Адаптивность шапки */
@media (max-width: 992px) {
    .header-container {
        height: 70px;
        padding: 0 15px;
    }
    
    .site-title {
        font-size: 20px;
    }
    
    .site-tagline {
        font-size: 12px;
    }
    
    .logo-image {
        height: 45px;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    .nav-menu a {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .main-navigation {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .header-container {
        height: 65px;
    }
    
    .site-title {
        font-size: 18px;
    }
    
    .logo-link {
        gap: 12px;
    }
    
    .logo-image {
        height: 40px;
    }
    
    .cart-icon {
        width: 45px;
        height: 45px;
    }
    
    .mobile-navigation {
        display: block;
    }
}

@media (max-width: 480px) {
    .header-container {
        height: 60px;
        padding: 0 10px;
    }
    
    .site-title {
        font-size: 16px;
    }
    
    .site-tagline {
        display: none;
    }
    
    .logo-image {
        height: 35px;
    }
    
    .cart-icon {
        width: 40px;
        height: 40px;
    }
    
    .cart-icon-symbol {
        font-size: 18px;
    }
    
    .cart-count {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
}

/* Анимация для кнопки меню */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ===== УЛУЧШЕННАЯ ПОЛНОЭКРАННАЯ ГАЛЕРЕЯ ===== */
.fullscreen-gallery {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.98);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.gallery-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gallery-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 26px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.gallery-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

/* Кнопки навигации - размещаем поверх изображения */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    z-index: 90;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.gallery-nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

.gallery-main-slide {
    position: relative;
    width: 100%;
    height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#gallery-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

#gallery-main-image.zoomed {
    cursor: move;
}

/* Счетчик слайдов - поверх изображения */
.gallery-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 80;
    backdrop-filter: blur(5px);
}

/* Панель управления зумом - поверх изображения внизу справа */
.gallery-zoom-panel {
    position: absolute;
    bottom: 15px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 80;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px;
    border-radius: 25px;
    backdrop-filter: blur(5px);
}

.gallery-zoom-panel button {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.gallery-zoom-panel button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

/* Миниатюры внизу */
.gallery-thumbs-container {
    width: 100%;
    max-width: 800px;
    margin-top: 15px;
    overflow-x: auto;
    padding: 8px 0;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    padding: 0 10px;
}

.gallery-thumbs img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.gallery-thumbs img:hover,
.gallery-thumbs img.active {
    opacity: 1;
    border: 2px solid white;
    transform: scale(1.05);
}

/* Адаптивность галереи */
@media (max-width: 768px) {
    .gallery-content {
        padding: 10px;
    }
    
    .gallery-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    
    .gallery-nav-btn {
        width: 42px;
        height: 42px;
        font-size: 24px;
    }
    
    .gallery-prev {
        left: 10px;
    }
    
    .gallery-next {
        right: 10px;
    }
    
    .gallery-main-slide {
        height: 65vh;
    }
    
    .gallery-zoom-panel {
        bottom: 10px;
        right: 10px;
        padding: 5px;
    }
    
    .gallery-zoom-panel button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .gallery-counter {
        bottom: 10px;
        padding: 4px 12px;
        font-size: 13px;
    }
    
    .gallery-thumbs img {
        width: 55px;
        height: 55px;
    }
}

@media (max-width: 480px) {
    .gallery-main-slide {
        height: 55vh;
    }
    
    .gallery-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .gallery-zoom-panel {
        bottom: 8px;
        right: 8px;
    }
    
    .gallery-zoom-panel button {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    
    .gallery-thumbs img {
        width: 45px;
        height: 45px;
    }
    
    .gallery-thumbs-container {
        margin-top: 10px;
    }
}

/* Анимация для перехода слайдов */
@keyframes slideFade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#gallery-main-image {
    animation: slideFade 0.3s ease;
}

/* ========================================== */
/* ИСПРАВЛЕНИЕ ДЛЯ iOS SAFARI */
/* ========================================== */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        #product-modal .modal-content {
            max-height: -webkit-fill-available;
            margin: 0;
            height: 100vh;
            border-radius: 0;
        }
        
        .modal-gallery-container {
            flex: 0 0 35%;
            max-height: 35vh;
        }
        
        .modal-info {
            flex: 1;
        }
        
        #modal-add-to-cart {
            background: rgba(0, 0, 0, 0.95);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }
    }
}

.products-grid .product-card {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Убедимся, что фильтры корректно работают со всеми товарами */
.product-card {
    will-change: transform, opacity;
}

/* Улучшение производительности при загрузке многих товаров */
.products-grid {
    content-visibility: auto;
    contain-intrinsic-size: 1px 400px;
}

/* Принудительная загрузка всех карточек */
body.loaded .product-card {
    animation-delay: calc(var(--card-index, 0) * 0.05s);
}

/* Улучшение для мобильных */
@media (max-width: 768px) {
    .products-grid {
        content-visibility: auto;
        contain-intrinsic-size: 1px 300px;
    }
}

/* ===== ИСПРАВЛЕНИЕ СЪЕЗЖАЮЩИХ ИЗОБРАЖЕНИЙ ===== */
.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 133.33%; /* 3:4 aspect ratio */
    overflow: hidden;
    background: var(--color-gray-light);
}

.product-main-image,
.product-hover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease;
}

/* Убедимся, что все карточки одинакового размера */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Исправление для мобильных */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .product-image-wrapper {
        padding-bottom: 133.33%;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
}

/* ===== ГАРАНТИЯ ОТОБРАЖЕНИЯ ВСЕХ КАРТОЧЕК ===== */
.product-card {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    animation: none !important;
}

/* Убираем возможные стили от AOS которые могут влиять */
[data-aos] {
    pointer-events: auto !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Исправление для сетки товаров */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 30px !important;
    align-items: stretch !important;
}

/* ===== ИСПРАВЛЕНИЕ ДЛЯ КНОПОК ФИЛЬТРОВ НА МОБИЛЬНЫХ ===== */
@media (max-width: 768px) {
    .catalog-filters {
        justify-content: flex-start;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        flex-wrap: nowrap;
        padding: 15px 10px;
        margin: 0 -10px 20px -10px;
        scrollbar-width: none;
    }
    
    .catalog-filters::-webkit-scrollbar {
        display: none;
    }
    
    .filter-btn {
        padding: 10px 16px;
        font-size: 14px;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .filter-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* ===== ВАЖНОЕ ИСПРАВЛЕНИЕ: УБЕДИТЕСЬ ЧТО КАРТОЧКИ ОТОБРАЖАЮТСЯ ===== */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 30px !important;
    align-items: stretch !important;
}

.product-card {
    display: flex !important;
    flex-direction: column !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: all 0.3s ease !important;
}

/* ВАЖНО: Убираем все возможные стили которые могут скрывать карточки */
.product-card[style*="display: none"] {
    display: none !important;
}

.product-card[style*="display: block"] {
    display: flex !important;
}

/* Адаптивная сетка */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
        gap: 25px !important;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 20px !important;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 15px !important;
    }
}

/* ===== ФИКС ДЛЯ МОБИЛЬНОЙ ФИЛЬТРАЦИИ ===== */
@media (max-width: 768px) {
    #products-grid {
        display: grid !important;
        min-height: 200px;
    }
}

/* ========================================== */
/* КРИТИЧЕСКОЕ ИСПРАВЛЕНИЕ: ИЗОБРАЖЕНИЯ НЕ СЪЕЗЖАЮТ */
/* ========================================== */

.product-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 133.33%; /* 3:4 aspect ratio */
    overflow: hidden;
    background: var(--color-gray-light);
    height: 0 !important; /* ВАЖНО: фиксируем высоту */
}

.product-main-image,
.product-hover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: opacity 0.5s ease;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* Фиксируем сетку товаров */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 30px !important;
    align-items: stretch !important;
    justify-items: center !important;
}

.product-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: all 0.3s ease !important;
}

/* Убираем любые трансформации при фильтрации */
.product-card[style*="transform"] {
    transform: none !important;
}

/* Исправляем адаптивность */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
        gap: 25px !important;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 20px !important;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 15px !important;
    }
    
    .product-image-wrapper {
        padding-bottom: 133.33%;
    }
}

/* ВАЖНО: Убираем все возможные стили которые могут скрывать карточки */
.product-card[style*="display: none"] {
    display: none !important;
}

.product-card[style*="display: block"] {
    display: flex !important;
}

/* Убираем возможные стили от AOS которые могут влиять */
[data-aos] {
    pointer-events: auto !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Фикс для фильтров на мобильных */
@media (max-width: 768px) {
    .catalog-filters {
        justify-content: flex-start;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        flex-wrap: nowrap;
        padding: 15px 10px;
        margin: 0 -10px 20px -10px;
        scrollbar-width: none;
    }
    
    .catalog-filters::-webkit-scrollbar {
        display: none;
    }
    
    .filter-btn {
        padding: 10px 16px;
        font-size: 14px;
        margin: 0;
        flex-shrink: 0;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Предотвращаем выделение при долгом нажатии на мобильных */
    .filter-btn {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* Анимация переключения фильтров */
.filter-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Индикатор активности */
.filter-btn.active {
    position: relative;
}

.filter-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--color-black);
    border-radius: 2px;
}