/* =========================================================
   Компонент: termostok:catalog.sections.podborki
   Стиль: под дизайн-систему termostok.ru (светлая тема,
   синий акцент, Bootstrap-подобная сетка, shadow-карточки)
   ========================================================= */

/* ─── Обёртка секции ──────────────────────────────────────────────── */
.tsk-podborki-section {
  padding: 0 0 40px;
}

.tsk-podborki-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ─── Шапка блока (тот же паттерн что top_block) ─────────────────── */
.tsk-podborki-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

/* Наследуем .title_block из темы, но на случай отсутствия */
.tsk-podborki-section .title_block {
  font-size: 22px;
  font-weight: 700;
  color: #222;
  line-height: 1.2;
}

.tsk-podborki-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #1565C0;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s ease, gap 0.2s ease;
}

.tsk-podborki-all-link:hover {
  color: #0D47A1;
  gap: 10px;
}

.tsk-podborki-arrow {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.tsk-podborki-all-link:hover .tsk-podborki-arrow {
  transform: translateX(3px);
}

/* ─── Сетка ───────────────────────────────────────────────────────── */
.tsk-podborki-grid {
  display: grid;
  gap: 16px;
  /* По умолчанию 3 колонки */
  grid-template-columns: repeat(3, 1fr);
}

/* 4 подборки → 2 + 2 */
.tsk-podborki-count-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* 5 подборок → Hero слева + 2×2 справа */
.tsk-podborki-count-5 {
  grid-template-columns: repeat(4, 1fr);
}

.tsk-podborki-count-5 .tsk-pcard--hero {
  grid-column: span 2;
  grid-row: span 2;
}

/* 6 подборок → 3 + 3 */
.tsk-podborki-count-6 {
  grid-template-columns: repeat(3, 1fr);
}

/* ─── Карточка ────────────────────────────────────────────────────── */
.tsk-pcard {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  position: relative;
}

.tsk-pcard:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  transform: translateY(-3px);
}

.tsk-pcard__link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

/* ─── Фото ────────────────────────────────────────────────────────── */
.tsk-pcard__image-wrap {
  position: relative;
  overflow: hidden;
  background: #fff;
  aspect-ratio: 4 / 3;
}

/* Hero-карточка — чуть выше соотношение */
.tsk-pcard--hero .tsk-pcard__image-wrap {
  aspect-ratio: 3 / 2;
}

.tsk-pcard__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.4s ease;
}

.tsk-pcard:hover .tsk-pcard__image {
  transform: scale(1.05);
}

/* Заглушка без фото */
.tsk-pcard__image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #EEF3FB;
}

/* Бейдж (Хит, Акция…) */
.tsk-pcard__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #E53935;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  line-height: 1.5;
  z-index: 2;
}

/* Счётчик товаров */
.tsk-pcard__count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(21, 101, 192, 0.9);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  line-height: 1.4;
  z-index: 2;
}

/* ─── Текстовый блок ──────────────────────────────────────────────── */
.tsk-pcard__body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.tsk-pcard__title {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  line-height: 1.3;
  margin: 0;
  transition: color 0.2s ease;
}

.tsk-pcard--hero .tsk-pcard__title {
  font-size: 20px;
}

.tsk-pcard:hover .tsk-pcard__title {
  color: #1565C0;
}

/* SEO-описание — видимое (не hover), индексируется */
.tsk-pcard__desc {
  font-size: 13px;
  color: #666;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.tsk-pcard--hero .tsk-pcard__desc {
  -webkit-line-clamp: 4;
}

/* CTA-ссылка */
.tsk-pcard__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #1565C0;
  margin-top: auto;
  padding-top: 4px;
  transition: gap 0.2s ease;
}

.tsk-pcard:hover .tsk-pcard__cta {
  gap: 10px;
}

/* ─── Описание блока (под заголовком) ───────────────────────────── */
.tsk-podborki-description {
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  margin: 10px 0 12px;
}

/* ─── Адаптив ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {

  .tsk-podborki-count-5,
  .tsk-podborki-count-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .tsk-podborki-count-5 .tsk-pcard--hero {
    grid-column: span 2;
    grid-row: span 1;
  }
}

@media (max-width: 768px) {

  .tsk-podborki-grid,
  .tsk-podborki-count-4,
  .tsk-podborki-count-5,
  .tsk-podborki-count-6 {
    grid-template-columns: repeat(2, 1fr);
  }

  .tsk-podborki-count-5 .tsk-pcard--hero {
    grid-column: span 2;
  }

  .tsk-pcard__title {
    font-size: 14px;
  }

  .tsk-pcard--hero .tsk-pcard__title {
    font-size: 16px;
  }

  .tsk-pcard__desc {
    display: none;
  }

  /* прячем на мобильных */
}

@media (max-width: 480px) {

  .tsk-podborki-grid,
  .tsk-podborki-count-4,
  .tsk-podborki-count-5,
  .tsk-podborki-count-6 {
    grid-template-columns: 1fr;
  }

  .tsk-podborki-count-5 .tsk-pcard--hero {
    grid-column: span 1;
  }

  .tsk-pcard__desc {
    display: block;
  }
}