/* =========================================================
   Страница «Рекомендации» — /rekomendacii/
   Макет 1371px, контент-зона 1111px (Figma node 4372-4375)
   ========================================================= */

.rekomendacii {
  padding: 43px 0 80px;
}

.rekomendacii__inner {
  max-width: calc(1111px + 256px);
  margin: 0 auto;
  padding: 0 128px;
  box-sizing: border-box;
}

.rekomendacii__inner > * {
  max-width: 1111px;
}

/* ── Хлебные крошки: фиксируем единый стиль ─────────────── */

.rekomendacii .breadcrumbs__link:hover {
  color: #1b1c1c;
}

.rec-title{
  margin-top: 40px;
}

/* ── Сетка карточек ──────────────────────────────────────── */

.rec-grid {
  display: grid;
  grid-template-columns: repeat(3, 346px);
  gap: 50px 36px;
  margin-bottom: 48px;
  list-style: none;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
}

.rec-grid__empty {
  grid-column: 1 / -1;
  margin: 0;
  font-family: "Inter", sans-serif;
  color: #666;
}

/* ── Карточка рекомендации (.rec-card) ───────────────────── */

.rec-card {
  width: 350px;
  min-height: 525px;
  border-radius: 4px;
  overflow: hidden;
  box-sizing: border-box;
}

.rec-card__img-wrap {
  width: 210px;
  height: 349px;
  margin: 0 auto 32px;
  border-radius: 4px;
  overflow: hidden;
  background-color: #f8f9fa;
}

.rec-card__img-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
}

.rec-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rec-card__img--placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background-color: #f8f9fa;
}

.rec-card__category {
  font-family: var(--font-primary);
  font-size: 21px;
  font-weight: 400;
  line-height: 100%;
  text-align: center;
  color: var(--color-text);
  margin: 0 0 25px;
}

.rec-card__caption {
  font-family: var(--font-secondary);
  font-size: 14px;
  font-weight: 400;
  line-height: 26px;
  color: rgba(35, 31, 32, 0.85);
  margin: 0;
  padding: 0 6px;

  text-align: center;
}

/* ── Пагинация ───────────────────────────────────────────── */

.rec-pagination {
  width: 313px;
  height: 59px;
  margin: 0 auto;
  background: #d9d9d9;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rec-pagination__list {
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}

.rec-pagination__item {
  margin: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rec-pagination__link {
  font-family: "Inter", sans-serif;
  font-size: 21px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.9);
  text-decoration: none;
  min-width: 48px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.rec-pagination__link:hover:not(.rec-pagination__link--active):not([aria-disabled="true"]) {
  color: #333;
}

.rec-pagination__link--active {
  background: #b39255;
  color: #fff;
  cursor: default;
}

.rec-pagination__link--arrow {
  font-size: 24px;
}

.rec-pagination__link[aria-disabled="true"] {
  color: rgba(0, 0, 0, 0.4);
  cursor: not-allowed;
}

/* ── Нижний блок: ссылки на независимые площадки (Figma 4372:4650, 4654, 4659, 4664) ── */

.rec-platforms {
  margin-top: 40px;
  max-width: 1111px;
}

.rec-platforms__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 106px;
  row-gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rec-platforms__item {
  margin: 0;
}

.rec-platforms__link {
  display: block;
  line-height: 0;
  transition: opacity 0.2s;
}

.rec-platforms__link:hover {
  opacity: 0.85;
}

.rec-platforms__img {
  display: block;
  object-fit: contain;
}

.rec-platforms__img--square {
  width: 174px;
  height: 174px;
}

.rec-platforms__img--wide {
  width: 401px;
  height: 84px;
}

/* ── Полноэкранный просмотр изображения ──────────────────── */

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.lightbox__content {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 900px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox__caption {
  margin: 16px 0 0;
  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  text-align: center;
}

.lightbox__close {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 640px) {
  .lightbox__close {
    top: 12px;
    right: 12px;
  }
}

/* ── Адаптив: 2 колонки на средних экранах ────────────────── */

@media (max-width: 1100px) {
  .rekomendacii__inner {
    padding: 0 24px;
  }

  .rec-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px 24px;
  }

  .rec-card {
    width: 100%;
    max-width: 346px;
    justify-self: center;
  }

  .rec-card__img-wrap {
    margin-left: auto;
    margin-right: auto;
  }

  .rec-platforms__list {
    column-gap: 48px;
  }
}

/* ── Адаптив: 1 колонка на узких экранах ──────────────────── */

@media (max-width: 640px) {
  .rekomendacii {
    padding: 24px 0 48px;
  }

  .rekomendacii__inner {
    padding: 0 16px;
  }

  .rec-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 32px;
  }

  .rec-card {
    max-width: 100%;
    min-height: auto;
  }

  .rec-pagination {
    width: 100%;
    max-width: 313px;
  }

  .rec-platforms {
    margin-top: 20px;
  }

  .rec-platforms__list {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .rec-platforms__img--square {
    width: 140px;
    height: 140px;
  }

  .rec-platforms__img--wide {
    width: 100%;
    max-width: 280px;
    height: auto;
    max-height: 84px;
  }
}
