/**
 * Секция «Нам доверяют» (рекомендации).
 * По макету: x: 86px, блок 1197×443px; логотипы 167–168×238px, border-radius 4px.
 */

.trusted-by {
  background: #3C4E58;
  padding-top: 48px;
  padding-right: 24px;
  padding-left: 24px;
  max-width: 100%;
}

.trusted-by .divider--gold {
  margin-top: 7px;
}

.trusted-by__inner {
  display: flex;
  flex-direction: column;
  gap: 62px;

  max-width: 1111px;
  margin: 0 auto;
}

.trusted-by__title {
  align-self: center;
  color: #F8F9FA;
}

/* Сетка: 6 карточек в ряд, затем перенос на следующую строку */
.trusted-by__grid {
  display: grid;
  grid-template-columns: repeat(6, 168px);
  justify-content: space-between;
  gap: 20px;
  list-style: none;
  padding: 0;
}

.trusted-by__item {
  /* карточка в ячейке сетки; своя область наложения для увеличенного логотипа */
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  .trusted-by__item:hover {
    z-index: 3;
  }
}

.trusted-by__logo-btn {
  display: block;
  width: 168px;
  padding: 0;
  border: none;
  background: none;
}

.trusted-by__logo {
  display: block;
  width: 168px;
  height: 238px;
  object-fit: contain;
  border-radius: 4px;
  background-color: #d8d8d8;
  position: relative;
  z-index: 1;
  transform-origin: center center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Увеличение по наведению — только на устройствах с реальным ховером (не тач) */
@media (hover: hover) and (pointer: fine) {
  .trusted-by__logo {
    cursor: zoom-in;
  }

  .trusted-by__logo:hover {
    transform: scale(1.2);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    z-index: 2;
  }
}

.trusted-by__actions {
  text-align: center;
  margin: 0;
}

.trusted-by__actions .section-btn {
  padding: 11px 16px;
  border-radius: var(--radius-btn);
  transition: var(--transition-bg);
  font-family: var(--font-raleway);
}

.trusted-by__actions .section-btn:hover {
  opacity: 1;
  background-color: var(--color-gold-hover);
}


@media (min-width: 1024px) {
  .trusted-by {
    padding-left: 86px;
    padding-right: 86px;
    padding-top: 80px;
    padding-bottom: 64px;
  }
}

@media (max-width: 1100px) {
  /* Меньше 5 в ряд: 3 колонки (проверка по макету) */
  .trusted-by__grid {
    grid-template-columns: repeat(3, 168px);
    gap: 32px;
  }
}

/* Ниже ~680px три колонки по 168px не помещаются — переходим на 2 колонки */
@media (max-width: 680px) {
  .trusted-by__grid {
    grid-template-columns: repeat(2, 168px);
    gap: 24px;
  }
}

@media (max-width: 767px) {
  .trusted-by {
    padding-top: 48px;
    padding-bottom: 48px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .trusted-by__title {
    margin-bottom: 32px;
  }

  .trusted-by__grid {
    grid-template-columns: repeat(2, 140px);
    gap: 24px;
    margin-bottom: 32px;
  }

  .trusted-by__logo-btn,
  .trusted-by__logo {
    width: 140px;
    height: 199px;
  }
}

@media (max-width: 400px) {
  .trusted-by__grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .trusted-by__logo-btn,
  .trusted-by__logo {
    width: 140px;
    height: 199px;
  }
}

/* ── Полноэкранный просмотр логотипа ──────────────────────── */

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;
  }
}
