/* ========== CATALOG PAGE – MODERN DESIGN SYSTEM ========== */

/* Page layout */
.catalog-page {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 100px auto 4rem;
    padding: 0 2rem;
}

/* ---------- FILTERS SIDEBAR ---------- */
.filters-sidebar {
    background: #ffffff;
    border-radius: 32px;
    padding: 1.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #eef2f6;
    height: fit-content;
    position: sticky;
    top: 100px;
}

/* H1 Styles */
h1 {
    margin: auto;
    margin-top: 160px;
    margin-bottom: 2rem;
    width: fit-content;
    max-width: 90vw;
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 48px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.03);
    padding: 35px 45px;
    font-size: 2.5rem;
    font-weight: 600;
    color: #0e2a3a;
    letter-spacing: -0.01em;
    transition: all 0.3s ease;
}

h1:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 35px -8px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
}

.filters-sidebar h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #0e2a3a;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #eef2f6;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #2c6280;
    margin-bottom: 0.75rem;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #334155;
    transition: color 0.2s;
}

.filter-label:hover {
    color: #1e4a8f;
}

.filter-label input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #1e4a8f;
}

.clear-filters-btn {
    background: #eef2f6;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1e4a8f;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-top: 0.5rem;
}

.clear-filters-btn:hover {
    background: #1e4a8f;
    color: white;
    transform: translateY(-2px);
}

/* ---------- PRODUCT GRID ---------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

.product-card {
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #eef2f6;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px -12px rgba(44, 98, 128, 0.15);
    border-color: #2c6280;
}

.product-link {
    text-decoration: none;
    display: block;
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8fafc;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.03);
}

.product-info {
    padding: 1rem 1rem 1.2rem;
    text-align: center;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0e2a3a;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e4a8f;
    margin: 0;
}

.no-products {
    text-align: center;
    padding: 3rem;
    font-size: 1.1rem;
    color: #6c757d;
    grid-column: 1 / -1;
}

/* ========== FULL RESPONSIVE BREAKPOINTS ========== */

/* Large desktops -> small desktops (max 1200px) */
@media (max-width: 1200px) {
    .catalog-page {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
        padding: 0;
    }
}

/* Tablet landscape (max 1100px) – reduce sidebar width */
@media (max-width: 1100px) {
    .catalog-page {
        grid-template-columns: 250px 1fr;
        gap: 1.5rem;
    }
}

/* Tablets and small desktops (max 992px) – move filters above, center them with max-width */
@media (max-width: 992px) {
    .catalog-page {
        grid-template-columns: 1fr;
        margin-top: 80px;
        gap: 1.5rem;
    }

    h1 {
        margin-top: 120px;
        padding: 25px 35px;
        font-size: 2rem;
        border-radius: 40px;
    }

    .filters-sidebar {
        position: static;
        max-width: 50vw;
        margin: 0 auto 1.5rem auto;
        width: 100%;
    }

    .clear-filters-btn {
        width: 100%;
    }
}

/* Small tablets (max 768px) – allow sidebar wider for readability */
@media (max-width: 768px) {
    .filters-sidebar {
        max-width: 50vw;
    }

    h1 {
        margin-top: 100px;
        padding: 20px 30px;
        font-size: 1.6rem;
        border-radius: 36px;
    }

    .catalog-page {
        margin: 60px auto 3rem;
        padding: 0 1rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.2rem;
    }

    .filter-group {
        margin-bottom: 1.2rem;
    }
}

/* Mobile landscape (max 576px) – one column products, smaller fonts */
@media (max-width: 576px) {
    .filters-sidebar {
        max-width: 50vw;
        padding: 1rem;
    }

    h1 {
        margin-top: 90px;
        padding: 15px 24px;
        font-size: 1.4rem;
        border-radius: 32px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .product-info {
        padding: 0.75rem;
    }

    .product-title {
        font-size: 0.95rem;
    }

    .product-price {
        font-size: 1.1rem;
    }
}

/* Mobile portrait (max 480px) – extra compact */
@media (max-width: 480px) {
    h1 {
        margin-top: 80px;
        padding: 12px 18px;
        font-size: 1.2rem;
        border-radius: 28px;
        margin-bottom: 1.5rem;
    }

    .catalog-page {
        margin-top: 40px;
        padding: 0 0.75rem;
    }

    .filters-sidebar {
        padding: 0.9rem;
        border-radius: 24px;
    }

    .filters-sidebar h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .filter-group h4 {
        font-size: 0.9rem;
    }

    .filter-label {
        font-size: 0.8rem;
    }

    .product-title {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 1rem;
    }
}

/* Very small devices (max 360px) */
@media (max-width: 360px) {
    h1 {
        margin-top: 70px;
        padding: 10px 14px;
        font-size: 1rem;
        border-radius: 24px;
    }

    .product-title {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 0.9rem;
    }

    .filter-label {
        font-size: 0.75rem;
        gap: 0.3rem;
    }
}