/* catalog.css - Стили для страницы каталога */

.catalog-main {
    padding: 40px 0;
    background: var(--background-light);
}

.page-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 2.2rem;
}

/* Поиск и сортировка */
.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.sort-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-box label {
    color: #666;
    font-weight: 500;
}

.sort-box select {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    background: white;
    min-width: 200px;
}

/* Основной контент */
.catalog-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* Фильтры */
.filters-sidebar {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.filters-header h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin: 0;
}

.btn-reset {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: #fff5f5;
}

.filter-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-section h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1rem;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.filter-option:hover {
    color: var(--primary-color);
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.filter-option .count {
    margin-left: auto;
    color: #999;
    font-size: 0.9rem;
}

/* Фильтр цены */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.price-inputs input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.price-slider {
    position: relative;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin: 20px 0;
}

.price-slider input[type="range"] {
    position: absolute;
    width: 100%;
    height: 4px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
}

.price-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Секция товаров */
.products-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.view-options {
    display: flex;
    gap: 5px;
}

.view-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.products-count {
    color: #666;
    font-size: 0.9rem;
}

/* Сетка каталога */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* ===== КАРТОЧКА ТОВАРА ===== */
.product-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(76, 175, 80, 0.25);
    border-color: rgba(76, 175, 80, 0.3);
}

/* Изображение товара */
.product-images {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: #f5f5f5;
}

.product-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-images img {
    transform: scale(1.05);
}

/* ===== ОВЕРЛЕЙ "НЕТ В НАЛИЧИИ" ===== */
.out-of-stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    pointer-events: none;
}

.out-of-stock-overlay span {
    background: #dc3545 !important;
    color: white !important;
    padding: 12px 35px !important;
    font-size: 1.2rem !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    letter-spacing: 3px !important;
    transform: rotate(-25deg) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.6) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    white-space: nowrap !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3) !important;
}

/* Бейдж */
.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    z-index: 5;
    transition: all 0.3s ease;
}

.product-card:hover .product-badge {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

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

.product-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--primary-color);
    transition: color 0.3s ease;
    line-height: 1.4;
}

.product-card:hover .product-title {
    color: var(--secondary-color);
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    transition: color 0.3s ease;
    line-height: 1.5;
    flex: 1;
}

.product-characteristics {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.product-card:hover .product-characteristics {
    background: #e8f5e8;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

.characteristic {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.characteristic:last-child {
    margin-bottom: 0;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.product-rating {
    color: #ffc107;
    font-size: 0.9rem;
}

.product-reviews {
    color: #666;
    font-size: 0.8rem;
}

.product-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.current-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.product-card:hover .current-price {
    color: var(--secondary-color);
}

.old-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
}

/* Статус наличия */
.product-stock {
    font-size: 0.85rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    background: #d4edda;
    color: #155724;
}

.product-stock.out-of-stock {
    background: #f8d7da !important;
    color: #721c24 !important;
}

/* Кнопки */
.product-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-cart {
    flex: 1;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-cart:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-cart:disabled {
    background: #adb5bd !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.7;
}

.btn-favorite {
    background: none;
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.btn-favorite:hover {
    color: #dc3545;
    border-color: #dc3545;
    background: #fff5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.1);
}

.btn-favorite:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Режим списка */
.catalog-grid.list-view {
    grid-template-columns: 1fr;
}

.catalog-grid.list-view .product-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
}

.catalog-grid.list-view .product-images {
    height: 100%;
    min-height: 280px;
}

.catalog-grid.list-view .product-info {
    padding: 25px;
}

.catalog-grid.list-view .out-of-stock-overlay span {
    transform: rotate(-15deg) !important;
    padding: 10px 30px !important;
    font-size: 1rem !important;
}

/* Сообщение о пустом результате */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.2rem;
    background: #f9f9f9;
    border-radius: 12px;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 40px;
}

.pagination-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-dots {
    padding: 0 5px;
    color: #666;
}

/* Подкатегории */
.filter-category-group {
    margin-bottom: 5px;
}

.filter-option-main {
    font-weight: 500;
    position: relative;
}

.expand-icon {
    margin-left: auto;
    font-size: 0.8rem;
    color: #999;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.filter-option-main.expanded .expand-icon {
    transform: rotate(180deg);
}

.subcategories {
    margin-left: 25px;
    margin-top: 8px;
    margin-bottom: 8px;
    display: none;
    border-left: 2px solid #e9ecef;
    padding-left: 12px;
}

.subcategories.show {
    display: block;
}

.subcategory {
    padding: 6px 0;
}

.subcategory span {
    font-size: 0.9rem;
    color: #555;
}

/* Адаптивность */
@media (min-width: 1200px) {
    .catalog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .catalog-content {
        grid-template-columns: 250px 1fr;
        gap: 20px;
    }

    .catalog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .catalog-content {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        position: static;
        margin-bottom: 20px;
    }

    .catalog-header {
        flex-direction: column;
        align-items: stretch;
    }

    .sort-box {
        justify-content: space-between;
    }

    .sort-box select {
        flex: 1;
    }

    .catalog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .product-images {
        height: 220px;
    }

    .catalog-grid.list-view .product-card {
        grid-template-columns: 1fr;
    }

    .catalog-grid.list-view .product-images {
        height: 250px;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .out-of-stock-overlay span {
        padding: 8px 20px !important;
        font-size: 0.9rem !important;
        transform: rotate(-20deg) !important;
    }
}

@media (max-width: 480px) {
    .catalog-main {
        padding: 20px 0;
    }

    .products-section {
        padding: 15px;
    }

    .catalog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-images {
        height: 250px;
    }

    .products-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .product-info {
        padding: 15px;
    }

    .product-title {
        font-size: 1rem;
    }

    .out-of-stock-overlay span {
        padding: 6px 15px !important;
        font-size: 0.8rem !important;
        transform: rotate(-15deg) !important;
    }
}