/* ============================================================
   MODELS - "Variants of launch on Platform Kb" (#models)
   3D card carousel inspired by the reference objections block.
   ============================================================ */

.models__viewport {
  position: relative;
  height: 640px;
  margin: 0 auto 76px;
  overflow: visible;
  perspective: 1600px;
  user-select: none;
}

.models__viewport::before {
  content: "";
  position: absolute;
  inset: 8% 2% 18%;
  background:
    radial-gradient(circle at 48% 35%, rgba(230, 55, 86, .12), transparent 56%);
  filter: blur(34px);
  pointer-events: none;
  opacity: .9;
}

.models__deck {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.model-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(440px, calc(100vw - 56px));
  min-height: 560px;
  margin-left: calc(min(440px, calc(100vw - 56px)) / -2);
  margin-top: -280px;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border-card);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition:
    transform .55s cubic-bezier(.22, 1, .36, 1),
    opacity .55s cubic-bezier(.22, 1, .36, 1),
    border-color .25s ease,
    box-shadow .25s ease;
  transform-origin: center;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.model-card[data-pos="center"] {
  transform: translateX(0) translateZ(0) scale(1);
  opacity: 1;
  z-index: 10;
  border-color: rgba(230, 55, 86, .35);
  box-shadow: 0 26px 72px rgba(18, 24, 38, .18), 0 0 0 1px rgba(230, 55, 86, .08);
  cursor: default;
}

.model-card[data-pos="left"] {
  transform: translateX(-58%) translateZ(-180px) rotateY(20deg) scale(.84);
  opacity: .35;
  z-index: 5;
}

.model-card[data-pos="right"] {
  transform: translateX(58%) translateZ(-180px) rotateY(-20deg) scale(.84);
  opacity: .35;
  z-index: 5;
}

.model-card[data-pos="hidden"] {
  transform: translateX(0) translateZ(-520px) scale(.36);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.model-card .badge {
  align-self: flex-start;
  margin: 0;
}

.model-card__title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: var(--text-md);
  line-height: 1.35;
  color: var(--color-text-dark);
}

.model-card__desc {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text-body);
  flex-grow: 1;
}

.model-card__value {
  margin-top: 4px;
}

.model-card__big {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-3xl);
  line-height: 1;
  color: var(--color-primary);
}

.model-card__sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 6px;
}

.model-card__chip {
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--color-text-body);
  background: var(--color-bg-light);
  border-left: 3px solid var(--color-border-card);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.model-card--dark {
  background: var(--color-text-dark);
  border-color: var(--color-text-dark);
}

.model-card--dark .model-card__title { color: #fff; }
.model-card--dark .model-card__desc { color: rgba(255, 255, 255, .72); }
.model-card--dark .model-card__big { color: #fff; }
.model-card--dark .model-card__sub { color: rgba(255, 255, 255, .55); }
.model-card--dark .badge--red {
  background: rgba(230, 55, 86, .22);
  color: #ff6b85;
}
.model-card--dark .model-card__chip {
  background: rgba(255, 255, 255, .07);
  border-left-color: var(--color-primary);
  color: rgba(255, 255, 255, .8);
}

.models__nav {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.models__dots {
  position: absolute;
  left: 50%;
  bottom: -42px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.models__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-border-card);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: width .2s ease, background .2s ease;
}

.models__dot--active {
  width: 24px;
  background: var(--color-primary);
}

.models__arrow {
  position: absolute;
  top: 50%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(230, 55, 86, .32);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 246, 246, .96));
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 18px 36px rgba(18, 24, 38, .18),
    0 8px 18px rgba(230, 55, 86, .18),
    0 0 0 8px rgba(230, 55, 86, .06);
  transform: translateY(-50%);
  pointer-events: auto;
  transition:
    transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;
}

.models__arrow--prev {
  left: max(18px, calc(50% - 360px));
}

.models__arrow--next {
  right: max(18px, calc(50% - 360px));
}

.models__arrow:hover {
  transform: translateY(-50%) scale(1.05);
  border-color: rgba(230, 55, 86, .55);
  background:
    linear-gradient(180deg, #fff, rgba(255, 240, 240, .98));
  box-shadow:
    0 22px 44px rgba(18, 24, 38, .22),
    0 12px 26px rgba(230, 55, 86, .24),
    0 0 0 10px rgba(230, 55, 86, .08);
}

.models__note {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
  padding: 0 60px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .models__viewport {
    height: 610px;
    margin-bottom: 74px;
  }

  .model-card {
    min-height: 540px;
    margin-top: -270px;
  }

  .model-card[data-pos="left"] {
    transform: translateX(-48%) translateZ(-170px) rotateY(18deg) scale(.8);
    opacity: .32;
  }

  .model-card[data-pos="right"] {
    transform: translateX(48%) translateZ(-170px) rotateY(-18deg) scale(.8);
    opacity: .32;
  }

  .models__note {
    padding: 0 20px;
  }

  .models__arrow {
    width: 48px;
    height: 48px;
    font-size: 27px;
  }

  .models__arrow--prev {
    left: 14px;
  }

  .models__arrow--next {
    right: 14px;
  }
}

@media (max-width: 640px) {
  .models__viewport {
    height: 580px;
    margin-bottom: 78px;
    overflow: hidden;
    perspective: 1200px;
  }

  .model-card {
    width: min(320px, calc(100vw - 44px));
    min-height: 540px;
    margin-left: calc(min(320px, calc(100vw - 44px)) / -2);
    margin-top: -270px;
    padding: 22px 20px;
  }

  .model-card[data-pos="left"] {
    transform: translateX(-62%) translateZ(-160px) rotateY(22deg) scale(.78);
    opacity: .18;
  }

  .model-card[data-pos="right"] {
    transform: translateX(62%) translateZ(-160px) rotateY(-22deg) scale(.78);
    opacity: .18;
  }

  .model-card__title {
    font-size: 20px;
  }

  .model-card__big {
    font-size: 34px;
  }

  .models__nav {
    inset: 0;
  }

  .models__dots {
    bottom: -44px;
  }

  .models__arrow {
    width: 44px;
    height: 44px;
    font-size: 25px;
    box-shadow:
      0 16px 30px rgba(18, 24, 38, .2),
      0 8px 18px rgba(230, 55, 86, .2),
      0 0 0 7px rgba(230, 55, 86, .07);
  }

  .models__arrow--prev {
    left: 8px;
  }

  .models__arrow--next {
    right: 8px;
  }

  .models__note {
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .model-card,
  .models__arrow,
  .models__dot {
    transition: none !important;
  }
}

/* ── Автолистание: пауза с увеличением центральной карточки ── */

.models__deck.is-hold .model-card[data-pos="center"] {
  transform: translateX(0) translateZ(0) scale(1.08);
  box-shadow: 0 32px 84px rgba(18, 24, 38, .24), 0 0 0 1px rgba(230, 55, 86, .12);
}