/* ============================================================
   «Бизнес ПК» — ОБЩИЕ СТИЛИ КАРТОЧКИ КАТАЛОГА (card.css)
   Новый визуальный язык (TZ-VISUAL-DIRECTION): белая панель
   radius 14 на полотне, фото сверху, тёмный CTA #101114.
   Порядок: theme-mono -> ui/* -> site.css -> card.css
            -> <page>.css
   Подключают: computers.html, minicomputers.html, periphery.html
   ============================================================ */

/* ---------- Заголовок страницы (старый класс — для periphery) ---------- */
.page-title {
    max-width: min(100% - 48px, var(--container));
    margin: 64px auto 40px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    color: var(--nv-tx);
}

/* ---------- Сетка товаров ---------- */
.products-grid {
    width: min(100% - 48px, 1160px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));   /* desktop: 3 */
    gap: 22px;
    align-items: stretch;
}

/* ---------- Карточка товара ---------- */
.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: 100%;
    min-width: 0;
    padding: 0;
    background: var(--nv-panel);
    border: 1px solid var(--nv-line);
    border-radius: var(--radius-card);
    box-shadow: 0 2px 10px rgba(16, 17, 20, 0.04);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(16, 17, 20, 0.1);
    border-color: #d9d9df;
}

/* Порядок блоков: фото -> название -> конфигурация (DOM порядок
   задаёт product-card.js; здесь только визуальная раскладка). */
.product-card .card-media   { order: 1; }
.product-card .card-name    { order: 2; }
.product-card .card-content { order: 3; }

/* Название товара */
.card-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: 2.6em;
    margin: 0;
    padding: 14px 20px 0;
    font-size: 16.5px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: var(--nv-tx);
}

/* ---------- Изображение ---------- */
.card-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: 170px;
    margin: 0;
    background: var(--color-surface-soft);
    border-radius: 13px 13px 0 0;
    overflow: hidden;
}

.card-img {
    max-width: 100%;
    max-height: 142px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.product-card:hover .card-img { transform: scale(1.03); }

.card-ph {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.card-ph svg {
    width: 72px;
    height: auto;
    opacity: 0.5;
    color: var(--nv-tx-3);
}

/* ---------- Содержимое карточки ----------
   flex-column, занимает всё свободное место; футер
   (.card-foot) прижат к низу через margin-top:auto. */
.card-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0;
    padding: 14px 20px 20px;
}

/* ---------- Адаптивность ---------- */
@media (max-width: 1100px) {
    .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* tablet: 2 */
}

@media (max-width: 640px) {
    .page-title { margin-top: 44px; font-size: 24px; }
    .products-grid { width: min(100% - 32px, 1160px); grid-template-columns: 1fr; gap: 16px; }
    .card-media { height: 158px; }
}
