/* ============================================================
   СЕКЦИЯ: Подарочные сертификаты GoLava
   Две колонки: слева россыпь карточек с параллаксом от курсора,
   справа номиналы, условия и одна кнопка покупки.
   ============================================================ */

.certificate {
  padding-block: 64px 72px;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.certificate--promo {
  overflow: visible;
  z-index: 1;
}

.certificate__inner {
  display: flex;
  align-items: center;
  gap: 56px;
}

/* ── Россыпь карточек ────────────────────────────────────────── */
.cert-stack {
  position: relative;
  flex: 1 1 52%;
  /* Высота коробки задана пропорцией: карточки внутри позиционированы
     в процентах, поэтому композиция масштабируется целиком. */
  aspect-ratio: 4 / 3;
  min-width: 0;
}

.cert-stack__card {
  position: absolute;
  width: 62%;
  height: auto;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  /* --px/--py подставляет site.js от положения курсора, множитель
     глубины уже учтён. Поворот идёт вторым, чтобы смещение считалось
     в осях секции, а не повёрнутой карточки. */
  transform: translate(var(--px, 0px), var(--py, 0px)) rotate(var(--tilt, 0deg));
  transition: transform 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.cert-stack__card--back {
  top: 2%;
  right: 0;
  --tilt: -5deg;
  z-index: 1;
}

.cert-stack__card--mid {
  top: 26%;
  left: 0;
  --tilt: 7deg;
  z-index: 2;
}

.cert-stack__card--front {
  top: 52%;
  left: 35%;
  --tilt: -7deg;
  z-index: 3;
}

/* Пока курсор ведёт карточки, гасим доводку, иначе движение отстаёт */
.cert-stack[data-parallax-active] .cert-stack__card {
  transition: none;
}

/* ── Правая колонка ──────────────────────────────────────────── */
.certificate__content {
  flex: 1 1 48%;
  min-width: 0;
}

.certificate__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--c-magenta, #e528e9);
  margin-bottom: 12px;
}

.certificate__heading {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: #000000;
}

.certificate__sub {
  font-size: 16px;
  line-height: 1.45;
  color: #555566;
  margin: 0 0 20px;
}

/* Номиналы чипами: заменили три одинаковые карточки-простыни */
.certificate__nominals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}

.certificate__nominal {
  padding: 8px 16px;
  border: 1.5px solid #000000;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #000000;
}

.certificate__nominal--hit {
  border-color: var(--c-magenta, #e528e9);
  background: var(--c-magenta, #e528e9);
  color: #ffffff;
}

.certificate__terms {
  margin: 0 0 26px;
}

.certificate__main-btn {
  min-height: 52px;
  padding: 14px 28px;
}

.certificate__rules-link {
  display: block;
  margin-top: 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--c-magenta, #e528e9);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--t-fast);
}

.certificate__rules-link:hover {
  color: var(--c-magenta-alt, #ec1ee8);
}

/* ── Адаптивность ────────────────────────────────────────────── */
@media (max-width: 1199px) {
  .certificate__inner {
    gap: 36px;
  }

  .certificate__heading {
    font-size: 28px;
  }
}

@media (max-width: 959px) {
  .certificate__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
  }

  .cert-stack {
    flex: none;
    width: 100%;
    max-width: 520px;
    margin-inline: auto;
  }
}

@media (max-width: 639px) {
  .certificate {
    padding-block: 44px 52px;
  }

  .certificate__heading {
    font-size: 22px;
  }

  .certificate__sub {
    font-size: 14px;
  }

  /* На узком экране карточки уже, а передняя сдвинута правее: иначе она
     накрывает номинал «1000» у средней. Пропорция коробки подобрана так,
     чтобы нижний край передней карточки не уходил под обрез. */
  .cert-stack {
    aspect-ratio: 5 / 4;
  }

  .cert-stack__card {
    width: 62%;
  }

  .cert-stack__card--back {
    top: 0;
    --tilt: -4deg;
  }

  .cert-stack__card--mid {
    top: 22%;
    --tilt: 5deg;
  }

  .cert-stack__card--front {
    top: 46%;
    left: 34%;
    --tilt: -5deg;
  }

  .certificate__main-btn {
    width: 100%;
  }
}

/* ── Подробная страница: прежняя витрина из трёх карточек ─────── */
.certificate--catalog {
  overflow: visible;
}

.certificate--catalog .certificate__head {
  margin-bottom: 36px;
  text-align: left;
}

.certificate--catalog .certificate__sub {
  max-width: 640px;
  margin: 0;
}

.certificate--catalog .certificate__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.cert-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1.5px solid #000000;
  border-radius: var(--card-radius, 10px);
  overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}

.cert-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.cert-card--featured {
  border: 2px solid var(--c-magenta, #e528e9);
  box-shadow: 0 8px 24px rgba(229, 40, 233, 0.15);
}

.cert-card__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 6px;
  background: linear-gradient(69.12deg, #bf4e9d 0%, #a127ed 50%, #35c6f0 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cert-card__media {
  width: 100%;
  overflow: hidden;
  background: #f7f7fa;
  border-bottom: 1px solid #ebebf0;
}

.cert-card__media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cert-card:hover .cert-card__media img {
  transform: scale(1.02);
}

.cert-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px 20px;
}

.cert-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.cert-card__title {
  margin: 0;
  color: #000000;
  font-size: 18px;
  line-height: 22px;
  font-weight: 700;
  text-transform: uppercase;
}

.cert-card__chip {
  padding: 3px 8px;
  border-radius: 4px;
  background: #f0f0f4;
  color: #555566;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.cert-card__chip--accent {
  background: rgba(229, 40, 233, 0.12);
  color: var(--c-magenta, #e528e9);
}

.cert-card__text {
  flex: 1;
  margin: 0 0 18px;
  color: #555566;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
}

.cert-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed #e5e5ea;
}

.cert-card__price {
  color: #000000;
  font-size: 22px;
  line-height: 26px;
  font-weight: 700;
}

.cert-card__btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
}

.certificate--catalog .certificate__banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  padding: 28px 32px;
  border: 1.5px solid #ebebf0;
  border-radius: var(--card-radius, 10px);
  background: #f7f7fa;
}

.certificate--catalog .certificate__perks {
  display: flex;
  flex: 1;
  gap: 32px;
}

.certificate--catalog .certificate__perk {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.certificate--catalog .certificate__perk-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.certificate--catalog .certificate__perk strong {
  display: block;
  margin-bottom: 2px;
  color: #111122;
  font-size: 14px;
  font-weight: 700;
}

.certificate--catalog .certificate__perk p {
  margin: 0;
  color: #666677;
  font-size: 12px;
  line-height: 1.35;
}

.certificate--catalog .certificate__actions {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}

.certificate--catalog .certificate__main-btn {
  width: 100%;
}

.certificate--catalog .certificate__rules-link {
  margin-top: 0;
  text-align: center;
}

@media (max-width: 1199px) {
  .certificate--catalog .certificate__perks {
    gap: 20px;
  }

  .certificate--catalog .certificate__actions {
    min-width: 240px;
  }
}

@media (max-width: 959px) {
  .certificate--catalog {
    padding-block: 48px 56px;
  }

  .certificate--catalog .certificate__cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .certificate--catalog .cert-card:nth-child(3) {
    grid-column: 1 / -1;
  }

  .certificate--catalog .certificate__banner {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding: 24px 20px;
  }

  .certificate--catalog .certificate__perks {
    flex-direction: column;
    gap: 16px;
  }

  .certificate--catalog .certificate__actions {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 639px) {
  .certificate--catalog {
    padding-block: 36px 44px;
  }

  .certificate--catalog .certificate__sub {
    font-size: 16px;
  }

  .certificate--catalog .certificate__cards {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .certificate--catalog .cert-card:nth-child(3) {
    grid-column: auto;
  }

  .certificate--catalog .certificate__banner {
    padding: 20px 16px;
  }

  .cert-card__foot {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
}

/* Пользователь просил не двигать — не двигаем */
@media (prefers-reduced-motion: reduce) {
  .cert-stack__card {
    transition: none;
    transform: rotate(var(--tilt, 0deg));
  }
}
