:root {
    --primary-color: #372e7f;
    --accent-color: #ff6b00;
    --light-bg: #ffffff;
    --light-gray: #f8f9fa;
    --card-bg: #ffffff;
    --text-dark: #212529;
    --text-gray: #6c757d;
    --border-radius: 12px;
    --border: 1px solid #e9ecef;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --error-color: #dc3545;
    --success-color: #28a745;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Хлебные крошки */
.breadcrumbs {
    padding: 20px 0;
    background: var(--light-gray);
    margin-bottom: 30px;
}

.breadcrumbs a {
    color: var(--text-gray);
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs span {
    color: var(--primary-color);
    font-weight: 500;
}

/* Основной контент */
.page-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 40px;
    max-width: 600px;
}

.content-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

/* Фильтры */
.filters-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-group {
    margin-bottom: 30px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-title i {
    color: var(--primary-color);
}

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

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

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

.filter-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.price-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.price-input {
    width: 100%;
    padding: 10px;
    border: var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background: #2a2361;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

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

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
    height: 200px;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-color);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.product-description {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 15px;
    flex-grow: 1;
    line-height: 1.5;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.feature-tag {
    background: var(--light-gray);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-gray);
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.product-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-buy {
    background: var(--accent-color);
    color: white;
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-buy:hover {
    background: #e55a00;
    transform: translateY(-2px);
}

.btn-delivery {
    background: var(--primary-color);
    color: white;
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-delivery:hover {
    background: #2a2361;
    transform: translateY(-2px);
}

.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.no-products i {
    font-size: 3rem;
    color: var(--text-gray);
    margin-bottom: 15px;
}

.no-products h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.no-products p {
    color: var(--text-gray);
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.active-filter-tag {
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.active-filter-tag .remove {
    cursor: pointer;
    font-weight: bold;
}

.clear-all-filters {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-gray);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: var(--border);
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-control.error {
    border-color: var(--error-color);
}

.form-control.success {
    border-color: var(--success-color);
}

.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

textarea.form-control {
    resize: vertical;
    min-height: 60px;
}

.form-submit {
    margin-top: 20px;
}

.total-price {
    background: var(--light-gray);
    padding: 15px;
    border-radius: var(--border-radius);
    margin: 15px 0;
    text-align: center;
}

.total-price-label {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 5px;
}

.total-price-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.success-modal {
    text-align: center;
    padding: 30px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 2rem;
}

.success-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.success-message {
    color: var(--text-gray);
    margin-bottom: 25px;
    line-height: 1.5;
}

.success-details {
    background: var(--light-gray);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: left;
}

.success-details h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.success-details p {
    margin-bottom: 5px;
}

.mobile-filters-toggle {
    display: none;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.mobile-filters-toggle:hover {
    background: #2a2361;
}

.mobile-filters-toggle i {
    transition: transform 0.3s ease;
}

.mobile-filters-toggle.active i {
    transform: rotate(180deg);
}

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

    .filters-section {
        position: static;
        display: none;
    }

    .mobile-filters-toggle {
        display: flex;
    }

    .filters-section.mobile-active {
        display: block;
    }
}

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

    .product-actions {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .price-inputs {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 95%;
        padding: 20px;
    }

    .active-filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .active-filters span {
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .filter-buttons {
        flex-direction: column;
    }

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

.category-section {
    width: 100%;
    grid-column: 1 / -1;
    margin-top: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.category-section:first-child {
    margin-top: 0;
}

.category-title {
    font-size: 1.8rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-title i {
    color: var(--accent-color);
}

.products-grid {
    justify-content: center;
}

.small-text {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: 5px;
    font-style: italic;
}

.filter-highlight {
    animation: highlightFilter 1.5s ease;
    background-color: rgba(255, 107, 0, 0.1);
    border: 2px solid var(--accent-color);
}

@keyframes highlightFilter {
    0% { background-color: rgba(255, 107, 0, 0.3); }
    70% { background-color: rgba(255, 107, 0, 0.1); }
    100% { background-color: transparent; }
}

.delivery-notice {
    background-color: #fff8e6;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px 15px;
    margin: 15px 0;
    font-size: 0.9rem;
    color: #8a6d3b;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.delivery-notice i {
    color: #f39c12;
    font-size: 1rem;
    margin-top: 2px;
}

.delivery-notice strong {
    color: #e67e22;
}

.error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.form-control.error {
    border-color: #dc3545;
}

.form-control.success {
    border-color: #28a745;
}

/* ===== ОПТИМИЗАЦИЯ ПРОИЗВОДИТЕЛЬНОСТИ ===== */
.product-card,
.btn-buy,
.btn-delivery,
.active-filter-tag,
.modal-content {
    will-change: transform, box-shadow, opacity;
    transform: translateZ(0);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
