:root {
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333;
    --primary-color: #2c3e50;
    --accent-color: #27ae60;
    --danger-color: #c0392b;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 10px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 { color: var(--primary-color); margin-bottom: 5px; font-size: 1.8rem; }

.stats {
    font-size: 1rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

select, input, button {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

button:hover { opacity: 0.9; }

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin: 0 auto 10px auto;
    border-radius: 50%;
}

.card h3 { margin: 5px 0; font-size: 1.1rem; }
.card .meta { color: #7f8c8d; font-size: 0.9rem; margin-bottom: 10px; }

.tracker {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
    border-top: 1px solid #eee;
}

.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.quantity-container {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.quantity-container input {
    width: 60px;
    text-align: center;
    padding: 5px;
}

/* === Адаптивный дизайн (Медиа-запросы) === */

/* Планшеты */
@media (min-width: 480px) {
    body { padding: 20px; }
    h1 { font-size: 2.2rem; }
    .controls { flex-direction: row; max-width: 100%; }
    .controls input { flex: 2; }
    .controls select { flex: 1; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* Десктопы */
@media (min-width: 768px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
    .card img { width: 140px; height: 140px; }
}
