/* ═══════════════════════════════════════════════════════════════
   Video Player — MC Виан B2B Portal
   Собственный плеер: постер-оверлей, таймлайн с буфером,
   громкость, качество, полный экран. Без внешних библиотек.
   ═══════════════════════════════════════════════════════════════ */

.vp {
  position: relative;
  width: 100%;
  aspect-ratio: 1920 / 1150;
  background: #0B1220;
  border-radius: var(--radius-xl, 16px);
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(11, 18, 32, 0.22);
  outline: none;
  user-select: none;
}
.vp:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 126, 255, 0.45), 0 18px 48px rgba(11, 18, 32, 0.22);
}
.vp--fullscreen {
  border-radius: 0;
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
}

.vp__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0B1220;
}

/* ── Постер-оверлей до первого запуска ── */
.vp__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: #0B1220;
  cursor: pointer;
  display: block;
  z-index: 3;
}
.vp--started .vp__overlay { display: none; }

.vp__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.4s ease;
}
.vp__overlay:hover .vp__poster {
  transform: scale(1.02);
  filter: brightness(0.85);
}

.vp__play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(0, 126, 255, 0.92);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 10px 34px rgba(0, 98, 204, 0.5);
  transition: transform 0.25s ease, background 0.25s ease;
}
.vp__play-badge i { margin-left: 4px; }
.vp__overlay:hover .vp__play-badge {
  transform: translate(-50%, -50%) scale(1.08);
  background: #007EFF;
}

.vp__duration-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(11, 18, 32, 0.75);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Контролы ── */
.vp__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 26px 14px 10px;
  background: linear-gradient(to top, rgba(11, 18, 32, 0.88), rgba(11, 18, 32, 0.45) 60%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.vp--started.vp--controls-visible .vp__controls,
.vp--started:not(.vp--playing) .vp__controls {
  opacity: 1;
  pointer-events: auto;
}
.vp--playing:not(.vp--controls-visible) { cursor: none; }

.vp__timeline {
  padding: 8px 0;
  cursor: pointer;
  touch-action: none;
  outline: none;
}
.vp__timeline-track {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  transition: height 0.15s ease;
}
.vp__timeline:hover .vp__timeline-track,
.vp__timeline:focus-visible .vp__timeline-track { height: 7px; }
.vp__timeline-buffer,
.vp__timeline-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  width: 0;
}
.vp__timeline-buffer { background: rgba(255, 255, 255, 0.35); }
.vp__timeline-progress { background: #007EFF; }
.vp__timeline-handle {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FFFFFF;
  transform: translate(-50%, -50%) scale(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease;
}
.vp__timeline:hover .vp__timeline-handle,
.vp__timeline:focus-visible .vp__timeline-handle {
  transform: translate(-50%, -50%) scale(1);
}

.vp__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.vp__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #FFFFFF;
  font-size: 22px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.vp__btn:hover { background: rgba(255, 255, 255, 0.14); }
.vp__btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(0, 126, 255, 0.9);
}
.vp__btn--quality {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
}
.vp__btn--quality:hover { border-color: #FFFFFF; }

.vp__volume { display: flex; align-items: center; gap: 2px; }
.vp__volume-range {
  width: 84px;
  accent-color: #007EFF;
  cursor: pointer;
}

.vp__time {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: 4px;
}
.vp__spacer { flex: 1; }

/* ── Спиннер буферизации ── */
.vp__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: none;
  pointer-events: none;
}
.vp--buffering .vp__spinner { display: block; }
.vp__spinner span {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #007EFF;
  animation: vp-spin 0.9s linear infinite;
}
@keyframes vp-spin { to { transform: rotate(360deg); } }

.vp__error {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  max-width: 84%;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(153, 27, 27, 0.92);
  color: #FFFFFF;
  font-size: 14px;
  text-align: center;
}

/* ── Секция на главной ── */
.video-section .section-title { text-align: center; }
.video-section__subtitle {
  max-width: 640px;
  margin: -6px auto 28px;
  text-align: center;
  color: var(--color-text-secondary, #5A6678);
  font-size: 1rem;
  line-height: 1.55;
}
.video-section__player-wrap {
  max-width: 960px;
  margin: 0 auto;
}
.video-section__note {
  max-width: 960px;
  margin: 14px auto 0;
  text-align: center;
  color: var(--color-text-muted, #647080);
  font-size: 0.8125rem;
}

/* ── Адаптив ── */
@media (max-width: 767px) {
  .vp { border-radius: 12px; }
  .vp__play-badge { width: 64px; height: 64px; font-size: 28px; }
  .vp__volume-range { display: none; }
  .vp__time { font-size: 12.5px; }
  .vp__btn { min-width: 38px; height: 38px; font-size: 20px; }
  .video-section__subtitle { font-size: 0.9375rem; margin-bottom: 20px; }
}

@media (max-width: 359px) {
  .vp__duration-badge { display: none; }
  .vp__time { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .vp__poster,
  .vp__play-badge,
  .vp__controls,
  .vp__timeline-track,
  .vp__timeline-handle { transition: none !important; }
  .vp__spinner span { animation-duration: 1.5s; }
}
