.benefits {
  margin-top: 67px;
}

.benefits_grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

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

@media (max-width: 560px) {
  .benefits_grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.benefit {
  position: relative;
  overflow: hidden;
  aspect-ratio: 534 / 393;
  border: 1px solid #8c8c8c;
  border-radius: 20px;
  background: #16181a;
}

/* Обычная и «подсвеченная» картинки собраны в один и тот же кадр,
   поэтому при наведении ничего не сдвигается, меняется только подсветка. */
.benefit_photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.45s ease;
}

.benefit_photo_hover {
  opacity: 0;
}

.benefit:hover .benefit_photo_hover,
.benefit.is_hover .benefit_photo_hover {
  opacity: 1;
}

/* затемнение сверху под заголовком (в макете у части карточек оно двойное) */
.benefit::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.45) 30%, rgba(0, 0, 0, 0.5) 60%, rgba(0, 0, 0, 0.5) 100%);
}

.benefit_shade_2::before {
  background:
    linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.45) 30%, rgba(0, 0, 0, 0.5) 60%, rgba(0, 0, 0, 0.5) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.45) 30%, rgba(0, 0, 0, 0.5) 60%, rgba(0, 0, 0, 0.5) 100%);
}

/* тёмная плашка под подписями: появляется при наведении */
.benefit::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  height: 129px;
  background: linear-gradient(180deg, rgba(18, 19, 20, 0) 0, rgba(18, 19, 20, 0.55) 22px, rgba(18, 19, 20, 0.9) 40px, #121314 70px);
  opacity: 0;
  transition: opacity 0.45s ease;
}

.benefit:hover::after,
.benefit.is_hover::after {
  opacity: 1;
}

.benefit_label {
  position: absolute;
  z-index: 2;
  top: 29px;
  left: 0;
  right: 0;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.05;
  text-align: center;
  color: #ffffff;
  text-shadow: 0 12px 51px rgba(15, 89, 3, 0.1);
  transition: color 0.3s ease;
}

.benefit:hover .benefit_label,
.benefit.is_hover .benefit_label {
  color: #e2fc04;
}

/* подписи при наведении: слева, по центру и справа */
.benefit_notes {
  position: absolute;
  z-index: 2;
  left: 30px;
  right: 30px;
  bottom: 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  opacity: 0;
  translate: 0 8px;
  transition: opacity 0.45s ease, translate 0.45s ease;
}

.benefit:hover .benefit_notes,
.benefit.is_hover .benefit_notes {
  opacity: 1;
  translate: 0 0;
}

.benefit_note {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.benefit_note b {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-transform: uppercase;
  color: #e2fc04;
}

.benefit_note span {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: #ffffff;
}

.benefit_note b.is_big {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-transform: none;
}

.benefit_note_left {
  grid-column: 1;
  justify-self: start;
  align-items: flex-start;
  text-align: left;
}

.benefit_note_center {
  grid-column: 2;
  justify-self: center;
  align-items: center;
  text-align: center;
}

.benefit_note_right {
  grid-column: 3;
  justify-self: end;
  align-items: flex-end;
  text-align: right;
}

/* одиночная подпись стоит посередине между строками соседних */
.benefit_note_single {
  margin-bottom: 12px;
}

@media (max-width: 1199px) {
  .benefit_label {
    font-size: 22px;
  }
}

.benefit_note small {
  font-size: inherit;
  font-weight: inherit;
}

/* мобильная версия: карточки в ленте со свайпом, подписи и подсветка видны сразу (наведения на телефоне нет) */
@media (max-width: 767px) {
  .benefits {
    margin-top: 40.4px;
  }

  .benefits .title {
    margin-bottom: 19.6px;
  }

  .benefits_grid {
    display: flex;
    gap: 10px;
    margin-inline: -20px;
    padding-inline: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 10px;
    scrollbar-width: none;
  }

  .benefits_grid::-webkit-scrollbar {
    display: none;
  }

  .benefit {
    flex: 0 0 100%;
    scroll-snap-align: start;
    border-color: transparent;
    border-radius: 15px;
  }

  .benefit_photo_hover,
  .benefit::after {
    opacity: 1;
  }

  .benefit::before {
    height: 60px;
  }

  .benefit::after {
    height: 100px;
  }

  .benefit_label {
    top: 17px;
    font-size: 16px;
    line-height: 22px;
    color: #e2fc04;
  }

  .benefit_notes {
    left: 14px;
    right: 14px;
    bottom: 17.8px;
    opacity: 1;
    translate: 0 0;
  }

  .benefit_note {
    gap: 2px;
  }

  .benefit_note b {
    font-size: 12px;
    line-height: 17px;
  }

  .benefit_note b.is_big {
    font-size: 12px;
    font-weight: 700;
    line-height: 17px;
  }

  .benefit_note b small.is_caps {
    text-transform: uppercase;
  }

  .benefit_note span {
    font-size: 10px;
    line-height: 14px;
  }
}
