@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

@font-face {
    font-family: 'Ambidexter';
    src: url('../fonts/Ambidexter.woff2') format('woff2'),
         url('../fonts/Ambidexter.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ШАПКА КАТАЛОГА */
.header-catalog {
    position: sticky;
    top: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.95), rgba(39, 12, 16, 0.95)) !important;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
}

/* ЗАГОЛОВОК КАТАЛОГА */
.catalog-hero {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.catalog-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.02);
    opacity: 0.05;
}

.catalog-title {
    font-family: 'Ambidexter', serif;
    font-size: 4.5rem;
    color: #fff;
    margin: 0;
    position: relative;
    z-index: 1;
    text-shadow: 3px 3px 10px rgba(0,0,0,0.5);
}

.catalog-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    color: rgba(255,255,255,0.8);
    margin-top: 15px;
    font-weight: 300;
}

/* ОБЕРТКА КАТАЛОГА */
.catalog-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    gap: 30px;
    background-color: #f4f1ea;
    min-height: 80vh;
}

/* ФИЛЬТРЫ */
.filters-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    padding: 30px 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 120px;
}

.filter-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e8e4dc;
    width: 100%;
    box-sizing: border-box;
}

.filter-section:last-of-type {
    border-bottom: none;
}

.filter-title {
    font-family: 'Ambidexter', serif;
    font-size: 1.5rem;
    color: #2c2c2c;
    margin-bottom: 20px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
    transition: color 0.3s;
}

.filter-label:hover {
    color: #7a2e3a;
}

.filter-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #7a2e3a;
    cursor: pointer;
}

.price-range {
    display: flex;
    gap: 12px;
    width: 100%;
}

.price-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d4d0c8;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.price-input:focus {
    border-color: #7a2e3a;
    outline: none;
}

.sort-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d4d0c8;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    background: #fff;
    cursor: pointer;
}

.reset-filters {
    width: 100%;
    padding: 12px;
    background: #f4f1ea;
    border: 2px solid #7a2e3a;
    color: #7a2e3a;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.reset-filters:hover {
    background: #7a2e3a;
    color: #fff;
}

/* ОСНОВНАЯ ЧАСТЬ */
.catalog-main {
    flex: 1;
}

.catalog-info {
    margin-bottom: 25px;
    font-size: 1rem;
    color: #666;
}

/* СЕТКА ТОВАРОВ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.product-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-image {
    height: 280px;
    background-color: #e8e4dc;
    background-size: cover;
    background-position: center;
    position: relative;
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #7a2e3a;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-category {
    font-size: 0.8rem;
    color: #7a2e3a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.product-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c2c2c;
    margin-bottom: 10px;
    line-height: 1.3;
}

.product-description {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f0ede6;
}

.product-price {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #7a2e3a;
}

.product-period {
    font-size: 0.8rem;
    color: #999;
}

.product-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-add-cart {
    flex: 1;
    padding: 10px;
    background: #7a2e3a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-add-cart:hover {
    background: #b13449;
}

.btn-details {
    padding: 10px 15px;
    background: #f4f1ea;
    color: #2c2c2c;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-details:hover {
    background: #e8e4dc;
}

/* ПАГИНАЦИЯ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.page-btn {
    width: 45px;
    height: 45px;
    border: 2px solid #d4d0c8;
    background: #fff;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover {
    border-color: #7a2e3a;
    color: #7a2e3a;
}

.page-btn.active {
    background: #7a2e3a;
    color: #fff;
    border-color: #7a2e3a;
}

/* МОДАЛЬНОЕ ОКНО ТОВАРА */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background: #fff;
    max-width: 900px;
    margin: 50px auto;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #7a2e3a;
    color: #fff;
}

.modal-body {
    display: flex;
    flex-direction: column;
}

.modal-image {
    height: 400px;
    background-size: cover;
    background-position: center;
}

.modal-info {
    padding: 40px;
}

.modal-title {
    font-family: 'Ambidexter', serif;
    font-size: 2.5rem;
    color: #2c2c2c;
    margin-bottom: 15px;
}

.modal-category {
    color: #7a2e3a;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.modal-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 25px;
}

.modal-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f7f4;
    border-radius: 10px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 5px;
}

.detail-value {
    font-weight: 600;
    color: #333;
}

.modal-price {
    font-size: 2rem;
    font-weight: 700;
    color: #7a2e3a;
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    gap: 15px;
}

.btn-buy-now {
    flex: 1;
    padding: 15px;
    background: #7a2e3a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-buy-now:hover {
    background: #b13449;
}

.btn-request {
    flex: 1;
    padding: 15px;
    background: #f4f1ea;
    color: #2c2c2c;
    border: 2px solid #7a2e3a;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-request:hover {
    background: #7a2e3a;
    color: #fff;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e8e4dc;
    border-top-color: #7a2e3a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-result {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-result h3 {
    font-family: 'Ambidexter', serif;
    font-size: 1.8rem;
    color: #7a2e3a;
    margin-bottom: 15px;
}

@media (max-width: 1024px) {
    .catalog-wrapper { flex-direction: column; }
    .filters-sidebar { width: 100%; position: static; }
    .catalog-title { font-size: 3rem; }
}

@media (max-width: 768px) {
    .catalog-title { font-size: 2.5rem; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .modal-body { flex-direction: column; }
    .modal-image { height: 300px; }
    .modal-details { grid-template-columns: 1fr; }
    .modal-actions { flex-direction: column; }
}

@media (max-width: 640px) {
    .products-grid { grid-template-columns: 1fr; }
}

.fav-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e8e4dc;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.fav-btn:hover {
    transform: scale(1.15);
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.fav-btn.active {
    background: #fff0f0;
    border-color: #e74c3c;
    color: #e74c3c;
}