/* Стили для страницы категории "Одежда" */

/* Секция категории */
.category-section {
    position: relative;
}

/* Заголовок категории */
.category-header {
    animation: fadeIn 0.6s ease-out;
}

.category-header h1 {
    background: linear-gradient(135deg, #000000, #374151);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Кнопка фильтров */
.filter-btn {
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.filter-btn:hover::before {
    width: 200px;
    height: 200px;
}

.filter-btn:active {
    transform: scale(0.95);
}

/* Сетка товаров */
.products-grid {
    position: relative;
}

/* Карточка товара */
.product-card {
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 0, 0, 0.3);
}

.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    padding: 2px;
    background: linear-gradient(135deg, transparent, rgba(0, 0, 0, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover::before {
    opacity: 1;
}

/* Изображение товара */
.product-image {
    position: relative;
    height: 16rem;
}

.product-image img {
    object-fit: cover;
}

/* Бейдж товара */
.product-badge {
    animation: fadeIn 0.6s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Информация о товаре */
.product-info {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 3.5rem;
    min-height: 3.5rem;
    max-height: 3.5rem;
}

/* Размеры товара */
.product-sizes {
    height: 2.5rem;
    min-height: 2.5rem;
    max-height: 2.5rem;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: flex-start;
}

.product-sizes::-webkit-scrollbar {
    display: none;
}

.size-badge {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Цена товара */
.product-price {
    position: relative;
    animation: fadeIn 0.6s ease-out;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    height: 3rem;
    min-height: 3rem;
}

.product-price > span:first-child {
    line-height: 1;
}

.product-price .line-through {
    line-height: 1;
}

/* На мобильных устройствах перечёркнутая цена под основной */
@media (max-width: 768px) {
    .product-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        height: 3.5rem;
        min-height: 3.5rem;
    }
    
    .product-price .line-through {
        order: 2;
        margin-left: 0 !important;
    }
}

/* Кнопка "В корзину" */
.add-to-cart-btn {
    position: relative;
    overflow: hidden;
    margin-top: auto;
}

.add-to-cart-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.add-to-cart-btn:hover::before {
    width: 300px;
    height: 300px;
}

.add-to-cart-btn:active {
    transform: scale(0.95);
}

/* Модальное окно фильтров */
.filter-modal {
    transition: opacity 0.3s ease-out;
    opacity: 0;
}

.filter-modal.show {
    opacity: 1;
}

.filter-modal-content {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    transform: translateY(100%);
}

.filter-modal.show .filter-modal-content {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .filter-modal-content {
        transform: translate(-50%, -40%);
        opacity: 0;
    }
    
    .filter-modal.show .filter-modal-content {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

/* Заголовок модального окна */
.modal-header {
    background: white;
}

.close-modal-btn {
    transition: all 0.3s ease;
}

.close-modal-btn:hover {
    transform: rotate(90deg);
}

.close-modal-btn:active {
    transform: rotate(90deg) scale(0.9);
}

/* Группы фильтров */
.filter-group {
    position: relative;
}

.filter-group h3 {
    position: relative;
    padding-bottom: 0.5rem;
}

.filter-group h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #000000, #4b5563);
    border-radius: 2px;
}

/* Кнопки размеров в фильтре */
.size-filter-btn {
    transition: all 0.3s ease;
}

.size-filter-btn.active {
    background: linear-gradient(135deg, #000000, #374151);
    color: white;
    transform: scale(1.05);
}

.size-filter-btn:active {
    transform: scale(0.95);
}

/* Чекбоксы брендов */
.brand-checkbox {
    transition: all 0.3s ease;
}

.brand-checkbox input[type="checkbox"] {
    cursor: pointer;
    transition: all 0.3s ease;
}

.brand-checkbox input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #000000, #374151);
    border-color: #000000;
}

/* Чекбокс "Только в наличии" */
.availability-checkbox {
    transition: all 0.3s ease;
}

.availability-checkbox input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #000000, #374151);
    border-color: #000000;
}

/* Кнопки в футере модального окна */
.modal-footer {
    background: white;
}

.reset-btn {
    transition: all 0.3s ease;
}

.reset-btn:active {
    transform: scale(0.95);
}

.apply-btn {
    position: relative;
    overflow: hidden;
}

.apply-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.apply-btn:hover::before {
    width: 300px;
    height: 300px;
}

.apply-btn:active {
    transform: scale(0.95);
}

/* Анимация появления товаров */
.product-card {
    animation: fadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.15s; }
.product-card:nth-child(3) { animation-delay: 0.2s; }
.product-card:nth-child(4) { animation-delay: 0.25s; }
.product-card:nth-child(5) { animation-delay: 0.3s; }
.product-card:nth-child(6) { animation-delay: 0.35s; }
.product-card:nth-child(7) { animation-delay: 0.4s; }
.product-card:nth-child(8) { animation-delay: 0.45s; }

/* Адаптивность */
@media (max-width: 768px) {
    .product-image {
        height: 12rem;
    }

    .product-title {
        font-size: 0.95rem;
        height: 3rem;
        min-height: 3rem;
        max-height: 3rem;
    }

    .product-sizes {
        overflow-x: auto;
        padding-bottom: 0.25rem;
        height: 2.25rem;
        min-height: 2.25rem;
        max-height: 2.25rem;
    }

    .size-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.625rem;
    }

    .add-to-cart-btn {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }

    .filter-modal-content {
        border-radius: 1.5rem 1.5rem 0 0;
    }

    .modal-header {
        border-radius: 1.5rem 1.5rem 0 0;
    }
}

/* Состояния загрузки */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-state-text {
    font-size: 1.25rem;
    color: #6b7280;
    font-weight: 600;
}

/* Плавное появление/исчезновение модального окна */
.filter-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-modal.closing {
    opacity: 0;
}

.filter-modal.closing .filter-modal-content {
    transform: translateY(100%);
}

@media (min-width: 768px) {
    .filter-modal.closing .filter-modal-content {
        transform: translate(-50%, -40%);
        opacity: 0;
    }
}

/* Скрытие скроллбара модального окна на мобильных */
@media (max-width: 768px) {
    .filter-modal-content {
        -ms-overflow-style: none;
        scrollbar-width: thin;
    }

    .filter-modal-content::-webkit-scrollbar {
        width: 4px;
    }

    .filter-modal-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .filter-modal-content::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 2px;
    }
}

/* Модальное окно выбора размера */
.size-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none; /* элемент не кликабельный когда скрыт */
    transition: opacity 0.3s ease-out;
}

.size-modal.show {
    opacity: 1;
    pointer-events: all; /* кликабельный */
}

.size-modal.closing {
    opacity: 0;
    pointer-events: none;
}

.size-modal-content {
    position: relative;
    background: white;
    border-radius: 1.5rem;
    padding: 1rem;
    transform: translate(-50%, -45%);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    top: 50%;
    left: 50%;
}

.size-modal.show .size-modal-content {
    transform: translate(-50%, -50%);
    opacity: 1;
}

.size-modal.closing .size-modal-content {
    transform: translate(-50%, -45%);
    opacity: 0;
}

/* Информация о выбранном товаре */
.selected-product-info {
    animation: fadeIn 0.5s ease-out;
}

/* Размеры в модальном окне */
.size-option-modal {
    transition: all 0.3s ease;
    position: relative;
}

.size-option-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.size-option-modal.selected {
    background: linear-gradient(135deg, #000000, #374151);
    color: white !important;
    transform: scale(1.05);
}

.size-option-modal:active {
    transform: scale(0.95);
}

/* Кнопка подтверждения */
.confirm-btn {
    position: relative;
    overflow: hidden;
}

.confirm-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.confirm-btn:hover::before {
    width: 400px;
    height: 400px;
}

.confirm-btn:active {
    transform: scale(0.98);
}

/* Адаптивность модального окна размера */
@media (max-width: 768px) {
    .size-modal-content {
        width: 90vw;
        max-width: 400px;
    }

    .size-options-modal {
        grid-template-columns: repeat(4, 1fr);
    }
}

