/* ===== CATALOG.CSS - СВЕТЛАЯ ТЕМА С НАЛИЧНИКАМИ ===== */

/* Заголовок страницы */
.page-header {
    background: linear-gradient(135deg, #e8e1d9 0%, #f8f5f0 100%);
    background-image: var(--pattern), linear-gradient(135deg, #e8e1d9 0%, #f8f5f0 100%);
    background-blend-mode: overlay;
    padding: 60px 0;
    border-bottom: 3px solid var(--accent-color);
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.page-header .breadcrumbs {
    color: var(--text-secondary);
}

.page-header .breadcrumbs a {
    color: var(--accent-color);
    text-decoration: none;
}

.page-header .breadcrumbs a:hover {
    text-decoration: underline;
}

/* Основной контент каталога */
.catalog-section {
    padding: 60px 0;
    background-color: var(--bg-primary);
    background-image: var(--pattern);
    background-repeat: repeat;
    background-size: 300px 300px;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* ===== САЙДБАР С ФИЛЬТРАМИ ===== */
.catalog-sidebar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 25px;
    align-self: start;
    position: sticky;
    top: 100px;
    box-shadow: 0 5px 20px var(--shadow-color);
}

.filter-title {
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
    color: var(--text-primary);
}

.filter-block {
    margin-bottom: 25px;
}

.filter-block h4 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
    color: var(--text-primary);
}

/* Категории */
.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 10px;
}

.category-list a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    transition: 0.2s;
    border-bottom: 1px dashed var(--border-color);
}

.category-list a:hover,
.category-list a.active {
    color: var(--accent-color);
    padding-left: 5px;
}

.category-list .count {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Ценовой диапазон */
.price-range {
    margin: 15px 0;
}

.price-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.price-input {
    flex: 1;
}

.price-input label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.price-input input {
    width: 100%;
    padding: 8px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
}

.price-input input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.price-slider {
    height: 4px;
    background-color: var(--border-color);
    position: relative;
    margin: 10px 0;
}

.price-slider .range {
    position: absolute;
    height: 100%;
    background-color: var(--accent-color);
}

/* Чекбоксы */
.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
}

.filter-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

/* Бренды */
.brand-list {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

.brand-list::-webkit-scrollbar {
    width: 5px;
}

.brand-list::-webkit-scrollbar-track {
    background: var(--border-color);
}

.brand-list::-webkit-scrollbar-thumb {
    background: var(--accent-color);
}

/* Кнопки фильтра */
.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.filter-actions .btn {
    flex: 1;
    padding: 12px;
    font-size: 0.8rem;
}

.btn-filter {
    background-color: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
}

.btn-filter:hover {
    background-color: var(--accent-hover);
}

.btn-reset {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
}

.btn-reset:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* ===== ОСНОВНАЯ ЧАСТЬ КАТАЛОГА ===== */
.catalog-main {
    width: 100%;
}

/* Сортировка */
.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 20px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.catalog-count {
    color: var(--text-secondary);
}

.catalog-count span {
    color: var(--accent-color);
    font-weight: 700;
}

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

.catalog-sort label {
    color: var(--text-secondary);
}

.catalog-sort select {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 15px;
    font-family: inherit;
    cursor: pointer;
}

.catalog-sort select:focus {
    outline: none;
    border-color: var(--accent-color);
}

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

.view-btn {
    width: 40px;
    height: 40px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.view-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

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

/* ===== КАРТОЧКИ ТОВАРОВ В СТИЛЕ "НАЛИЧНИКИ" ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

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

.products-grid.list {
    grid-template-columns: 1fr;
}

.products-grid.list .product-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
}

.products-grid.list .product-image {
    height: 100%;
}

.products-grid.list .product-image img {
    height: 180px;
}

/* Основная карточка с наличником */
.product-card {
    background-color: var(--bg-card);
    border: 8px solid transparent;
    border-image: repeating-linear-gradient(45deg, 
        var(--accent-color) 0px, 
        var(--accent-color) 4px,
        #c49a6c 4px, 
        #c49a6c 8px) 30 stretch;
    position: relative;
    transition: 0.3s;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.2);
    padding: 5px;
    background-clip: padding-box;
}

/* Внутренняя рамка (имитация доски) */
.product-card::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid rgba(139, 69, 19, 0.3);
    pointer-events: none;
    z-index: 1;
}

/* Уголки-розетки (верхний левый) */
.product-card::after {
    content: '⚜️';
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 20px;
    color: var(--accent-color);
    opacity: 0.3;
    z-index: 2;
}

/* Изображение товара */
.product-card .product-image {
    position: relative;
    background-color: #f5efe6;
    background-image: linear-gradient(45deg, #e8d9cc 25%, transparent 25%),
                      linear-gradient(-45deg, #e8d9cc 25%, transparent 25%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px;
    padding: 20px;
    margin: 15px 15px 0 15px;
    border: 1px solid var(--accent-color);
    overflow: hidden;
}


.product-card .product-image img {
    max-height: 180px;
    object-fit: contain;
    transition: transform 0.5s;
    position: relative;
    z-index: 2;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

/* Информация о товаре */
.product-info {
    padding: 20px;
    position: relative;
    background: linear-gradient(to bottom, transparent, rgba(139, 69, 19, 0.05));
}

/* Резной низ карточки */
.product-info::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 3px;
    background: repeating-linear-gradient(90deg, 
        var(--accent-color) 0px, 
        var(--accent-color) 5px,
        transparent 5px,
        transparent 10px);
}

/* Заголовок товара с вязью */
.product-title {
    font-family: 'Cormorant Unicase', 'Times New Roman', serif;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px dashed var(--accent-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
    position: relative;
    color: var(--text-primary);
}

.product-title::before {
    content: '⌇⌇⌇';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent-color);
    font-size: 10px;
    background-color: var(--bg-card);
    padding: 0 10px;
}

/* Категория */
.product-category {
    font-family: 'Cormorant Unicase', serif;
    font-size: 0.8rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
    opacity: 0.8;
}

/* Описание */
.product-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Цена в старинном стиле */
.product-price {
    font-family: 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 2px 2px 0 rgba(139, 69, 19, 0.2);
    position: relative;
    display: inline-block;
}

.product-price::before,
.product-price::after {
    content: '❦';
    font-size: 0.8rem;
    margin: 0 5px;
    color: var(--accent-color);
    opacity: 0.5;
}

.product-price old {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: line-through;
    margin-left: 8px;
    font-weight: 400;
}

/* Подвал карточки */
.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--border-color);
    padding-top: 15px;
    margin-top: 10px;
}

/* Статус */
.product-status {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Кнопка в стиле кованой */
.btn-cart {
    background-color: #2c2c2c;
    color: #f0e6d2;
    border: 2px solid var(--accent-color);
    padding: 8px 15px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 350;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    box-shadow: 3px 3px 0 var(--accent-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-cart:hover {
    background-color: var(--accent-color);
    color: #2c2c2c;
    box-shadow: 1px 1px 0 var(--accent-color);
    transform: translate(2px, 2px);
}

/* Кнопка подробнее */
.btn-details {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 15px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
}

.btn-details:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Бейдж в стиле старой бирки */
.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--accent-color);
    color: #f0e6d2;
    padding: 5px 15px;
    font-family: 'Times New Roman', serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    z-index: 10;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
    border: 1px solid #f0e6d2;
    transform: rotate(-2deg);
}

.product-badge.sale {
    background-color: #f90;
}

.product-badge.new {
    background-color: #27ae60;
}

/* Кнопки действий (быстрый просмотр, избранное) */
.product-actions {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
    z-index: 10;
}

.product-card:hover .product-actions {
    bottom: 20px;
}

.product-action-btn {
    width: 40px;
    height: 40px;
    background-color: var(--accent-color);
    border: 2px solid #f0e6d2;
    color: #f0e6d2;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    opacity: 0.9;
    border-radius: 0;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.product-action-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background-color: #2c2c2c;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 50px;
}

.pagination-item {
    min-width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    transition: 0.2s;
}

.pagination-item:hover,
.pagination-item.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.pagination-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Активные фильтры */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-tag {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.filter-tag i {
    color: var(--accent-color);
    cursor: pointer;
}

.filter-tag i:hover {
    color: var(--text-primary);
}

/* Баннер каталога */
.catalog-banner {
    background: linear-gradient(135deg, #e8e1d9, #d6ccc2);
    background-image: var(--pattern), linear-gradient(135deg, #e8e1d9, #d6ccc2);
    background-blend-mode: overlay;
    border: 1px solid var(--border-color);
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.banner-content h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.banner-content p {
    color: var(--text-secondary);
}

.banner-content .accent-text {
    color: var(--accent-color);
}

/* Адаптация */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-grid.grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    
    .catalog-sidebar {
        position: static;
        margin-bottom: 30px;
    }
    
    .products-grid.list .product-card {
        grid-template-columns: 150px 1fr;
    }
}

@media (max-width: 768px) {
    .catalog-toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .products-grid.list .product-card {
        grid-template-columns: 1fr;
    }
    
    .products-grid.list .product-image img {
        max-height: 200px;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .catalog-banner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .catalog-sort {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .catalog-sort select {
        flex: 1;
    }
    
    .product-card::after {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .product-title {
        font-size: 1rem;
    }
    
    .product-price {
        font-size: 1.2rem;
    }
    
    .btn-cart {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}
.products-grid {
    align-items: stretch;
}

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 260px;
    overflow: hidden;
    flex-shrink: 0;
}

.product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

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

.product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.product-title {
    min-height: 48px;
    overflow: hidden;
}

.product-title a {
    color: inherit;
    text-decoration: none;
}

.product-title a:hover {
    text-decoration: none;
}

.product-desc {
    min-height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.product-footer {
    margin-top: auto;
}

.product-price,
.product-old-price,
.product-status,
.product-category,
.product-title,
.product-desc {
    word-break: break-word;
}
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: 0.2s ease;
    box-sizing: border-box;
}

.pagination-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.pagination-btn.active {
    font-weight: 700;
}

.pagination-nav {
    min-width: auto;
    padding: 0 16px;
}
#filter-categories {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 6px;
}

#filter-categories::-webkit-scrollbar {
    width: 6px;
}

#filter-categories::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}
#filter-categories {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 6px;
}

#filter-categories::-webkit-scrollbar {
    width: 6px;
}

#filter-categories::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}
.order-header {
    cursor: pointer;
    transition: background 0.2s ease;
}

.order-header:hover {
    background: #f8f8f8;
}

.order-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding-top 0.25s ease;
    padding-top: 0;
}

.order-item.open .order-details {
    max-height: 1200px;
    opacity: 1;
    padding-top: 20px;
}

.order-toggle-btn {
    pointer-events: none;
}
/* ===== MOBILE FIX CATALOG ===== */

@media (max-width: 768px) {

    /* заголовок */
    .page-header {
        padding: 40px 0;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    /* layout */
    .catalog-layout {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    /* сайдбар превращаем в блок */
    .catalog-sidebar {
        position: static;
        width: 100%;
        padding: 15px;
    }

    /* toolbar */
    .catalog-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }

    .catalog-sort {
        width: 100%;
        flex-wrap: wrap;
    }

    .catalog-sort select {
        width: 100%;
    }

    /* карточки */
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .product-card {
        border-width: 5px;
    }

    .product-image {
        height: 200px;
    }

    .product-info {
        padding: 15px;
    }

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

    .product-desc {
        font-size: 13px;
        min-height: auto;
    }

    .product-price {
        font-size: 1.2rem;
    }

    .product-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .btn-cart {
        width: 100%;
        justify-content: center;
    }

    /* фильтры */
    .filter-actions {
        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;
    }

    /* баннер */
    .catalog-banner {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }

    /* пагинация */
    .pagination {
        gap: 6px;
    }

    .pagination-btn {
        min-width: 40px;
        height: 40px;
        padding: 0 10px;
    }
}

/* маленькие телефоны */
@media (max-width: 480px) {

    .page-header h1 {
        font-size: 1.5rem;
    }

    .product-image {
        height: 180px;
    }

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

    .product-price {
        font-size: 1.1rem;
    }

    .btn-cart {
        font-size: 0.75rem;
        padding: 6px;
    }
}
/* ===== БУРГЕР НОРМ ВИД ===== */

.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: #fff;
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    cursor: pointer;
    padding: 8px;
    box-shadow: 2px 2px 0 var(--accent-color);
    transition: 0.2s;
}

.burger:hover {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 var(--accent-color);
}

.burger span {
    width: 100%;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
    transition: 0.3s;
}

/* ===== ПОЗИЦИЯ ===== */

@media (max-width: 768px) {

    .header-container {
        position: relative;
    }

    .burger {
        display: flex;
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
    }

    .logo {
        margin: 0 auto;
    }

    .cart-icon {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
    }

    /* чтобы меню не прыгало */
    .main-nav {
        top: 0;
    }
}