:root {
    --text-primary: #1e293b; /* Темно-серый для заголовков */
    --text-secondary: #475569; /* Серый для текста */
    --bg-main: #f8fafc; /* Светлый фон страницы */
    --card-bg: #ffffff; /* Белый фон карточек */
    --accent-color: #00b36e; /* Акцентный зеленый Bambu Lab (или выбранный бренд-цвет) */
    --hover-accent: #00935a;
    --shadow-base: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05); /* Мягкая тень */
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05); /* Тень при наведении */
    --radius-md: 12px;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
}

.catalog-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.catalog-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3rem;
    letter-spacing: -0.025em;
}

/* CSS Grid для адаптивной сетки */
#products-container {
    display: grid;
    /* Минимум 280px на карточку, заполнение доступного пространства */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: #ffffff;
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f3f4f6;
    position: relative;
}

.product-card:hover {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: #10B981;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.product-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e5e7eb;
    border-radius: 0.75rem 0.75rem 0.5rem 0.5rem;
    overflow: hidden;
    cursor: pointer;
}

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

/* Стили для заглушки отсутствующего изображения */
.product-image.error-placeholder {
    width: 40%;
    height: 40%;
    object-fit: contain;
    opacity: 0.3;
}

.product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    color: #111827;
    margin: 0 0 1.25rem 0; /* Отступ вместо описания/цены */
    transition: color 0.15s ease-in-out;
}

.product-card:hover .product-title {
    color: #059669;
}

.product-button {
    background-color: #10B981;
    color: #ffffff;
    border: none;
    width: 100%;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 0.75rem;
    min-height: 44px;
    margin-top: auto;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    touch-action: manipulation;
}

.product-button:hover {
    background-color: #059669;
}

.product-button:active {
    background-color: #047857;
}

/* Стили для кнопок соцсетей */
.links-container {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    margin-top: auto;
    width: 100%;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    border-radius: 0.75rem;
    min-height: 44px;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: opacity 0.15s ease-in-out;
    text-decoration: none;
    touch-action: manipulation;
}

.social-btn:hover {
    opacity: 0.9;
}

/* Медиазапросы для мобильных устройств */
@media (max-width: 768px) {
    #products-container {
        /* 2 колонки на средних экранах и 1 колонка на маленьких обеспечивается auto-fill minmax 280px */
        /* Но для маленьких мобильных (<320px) сделаем еще меньше */
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.5rem;
    }
    
    .catalog-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .links-container {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .catalog-main {
        padding: 1.5rem 1rem;
    }
    
    .product-image-container {
        height: 200px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
