/* Каталог товаров */
#catalog {
    padding: 3rem 0;
}

#catalog h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1E3F1B;
    margin-bottom: 2rem;
    text-align: center;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background: var(--surface);
}

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

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

/* Стили для фильтра категорий */
#categories-filter {
    margin-bottom: 2rem;
    text-align: center;
}

.category-btn {
    background-color: #f0f0f0;
    border: none;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #000;
    position: relative;
}

.category-btn:hover {
    background-color: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.category-btn.active,
.category-btn.all-categories {
    background-color: var(--brand);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 63, 27, 0.3);
}

.category-btn:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    box-shadow: inset 0 0 0 2px var(--brand);
}

/* Стили для кнопки "Еще" */
.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    background-color: var(--brand);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(30, 63, 27, 0.2);
}

.load-more-btn:hover {
    background-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 63, 27, 0.3);
}

.load-more-btn:active {
    transform: translateY(0);
}

.load-more-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.load-more-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 63, 27, 0.2);
}

.product-info {
    padding: 1rem;
}

.product-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-price {
    font-weight: bold;
    color: var(--brand);
    margin-bottom: 0.5rem;
}

.product-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.product-link {
    display: inline-block;
    background-color: var(--brand);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.product-link:hover {
    background-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.product-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 63, 27, 0.2);
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

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

/* Планшеты средние: 768px-1024px */
@media (min-width: 768px) and (max-width: 1024px) {
    #catalog {
        padding: 2.5rem 0;
    }
    
    #catalog h2 {
        font-size: 2rem;
        margin-bottom: 1.8rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.2rem;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-info {
        padding: 0.85rem;
    }
    
    .product-title {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }
    
    .product-price {
        margin-bottom: 0.4rem;
    }
    
    .product-description {
        font-size: 0.85rem;
        margin-bottom: 0.8rem;
    }
    
    .product-link {
        padding: 0.45rem 0.9rem;
        font-size: 0.9rem;
    }
}

/* Планшеты малые: 621px-767px */
@media (min-width: 621px) and (max-width: 767px) {
    #catalog {
        padding: 2rem 0;
    }
    
    #catalog h2 {
        font-size: 1.7rem;
        margin-bottom: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    #categories-filter {
        margin-bottom: 1.5rem;
    }
    
    .category-btn {
        padding: 0.45rem 0.9rem;
        font-size: 0.85rem;
    }
    
    .product-image {
        height: 160px;
    }
    
    .product-info {
        padding: 0.8rem;
    }
    
    .product-title {
        font-size: 0.95rem;
        margin-bottom: 0.3rem;
    }
    
    .product-price {
        font-size: 0.9rem;
    }
    
    .product-description {
        font-size: 0.8rem;
        margin-bottom: 0.7rem;
    }
    
    .product-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .load-more-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Большие телефоны: 481px-620px */
@media (min-width: 481px) and (max-width: 620px) {
    #catalog {
        padding: 1.5rem 0;
    }
    
    #catalog h2 {
        font-size: 1.5rem;
        margin-bottom: 1.2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    #categories-filter {
        margin-bottom: 1rem;
    }
    
    .category-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        margin: 0.15rem;
    }
    
    .product-card {
        border-radius: 6px;
    }
    
    .product-image {
        height: 140px;
    }
    
    .product-info {
        padding: 0.7rem;
    }
    
    .product-title {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }
    
    .product-price {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    .product-description {
        font-size: 0.75rem;
        margin-bottom: 0.6rem;
    }
    
    .product-link {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
        min-height: 30px;
    }
    
    .load-more-container {
        margin-top: 1.2rem;
    }
    
    .load-more-btn {
        padding: 0.5rem 1.2rem;
        font-size: 0.85rem;
        min-height: 34px;
    }
}

/* Мобильные устройства: 320px-480px */
@media (max-width: 480px) {
    #catalog {
        padding: 1.2rem 0;
    }
    
    #catalog h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    #categories-filter {
        margin-bottom: 0.8rem;
    }
    
    .category-btn {
        padding: 0.35rem 0.65rem;
        font-size: 0.7rem;
        margin: 0.1rem;
        min-height: 30px;
    }
    
    .category-btn:hover {
        transform: translateY(-1px);
    }
    
    .product-card {
        border-radius: 6px;
        display: flex;
        flex-direction: column;
    }
    
    .product-image {
        height: 160px;
        object-fit: cover;
    }
    
    .product-info {
        padding: 0.6rem;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }
    
    .product-title {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
        font-weight: 600;
    }
    
    .product-price {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }
    
    .product-description {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
        flex-grow: 1;
    }
    
    .product-link {
        padding: 0.35rem 0.6rem;
        font-size: 0.7rem;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: auto;
    }
    
    .product-link:active,
    .product-link:hover {
        transform: translateY(0);
    }
    
    .load-more-container {
        margin-top: 1rem;
    }
    
    .load-more-btn {
        width: 90%;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-height: 36px;
        box-shadow: 0 3px 8px rgba(30, 63, 27, 0.2);
    }
}
