/* Фон задан явно: иначе в браузере с тёмной темой фон станет тёмным, а текст останется чёрным */
html {
    color-scheme: light;
    background: #fff;
}

body {
    margin: 0;
    color: #111;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.content {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 10px 20px;
}

h1 {
    margin: 20px 10px 0;
}

.meta {
    margin: 4px 10px 10px;
    color: #777;
}

.card-list {
    display: grid;
    /* minmax(0, 1fr), а не просто 1fr: иначе широкая картинка распирает колонку и появляется горизонтальный скролл */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.item {
    display: block;
    padding: 10px;
    color: inherit;
    text-decoration: none;
}

.item:hover .item-name {
    text-decoration: underline;
}

/* Квадратная рамка под картинку: деки разной формы, а сетка ровная */
.image-container {
    position: relative;
    aspect-ratio: 1;
}

.image-container img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-discount {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e53935;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.item-info {
    margin-top: 8px;
    overflow-wrap: anywhere;
}

.item-brand {
    color: #777;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.item-name {
    font-weight: bold;
}

.item-price {
    margin-top: 4px;
    font-weight: bold;
}

.item-old-price {
    margin-left: 6px;
    color: #999;
    font-weight: normal;
    text-decoration: line-through;
}

.item-sizes,
.item-shop {
    margin-top: 2px;
    color: #777;
    font-size: 13px;
}

.error {
    color: #e53935;
}

@media (max-width: 1200px) {
    .card-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .card-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
