/* Рельса прокрутки справа и стрелка «листайте вниз» (assets/js/scroll-rail.js).
   Размеры, отступы и анимации — как у FlippingStroy (src/styles.css: .scroll-progress, .scroll-tick,
   .scroll-to-hero, .scroll-hint); цвета — фирменный тёмно-синий porscha.ru #1e3246, над тёмной
   фотографией первого экрана — белый. */

.sr-rail {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 16px 10px;
  z-index: 990;
}
.sr-rail.is-visible { display: flex; }

.sr-top {
  width: 32px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1e3246;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s ease, color 0.25s ease;
}
.sr-top.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.sr-top svg { display: block; }

.sr-tick {
  position: relative;
  display: block;
  width: 15px;
  height: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  background-color: rgba(30, 50, 70, 0.35);
  transition: width 0.25s ease, height 0.25s ease, background-color 0.25s ease;
}
/* Зона нажатия шире засечки — соседние зоны смыкаются, целиться не нужно (FlippingStroy: «forgiving hit target»). */
.sr-tick::before {
  content: "";
  position: absolute;
  inset: -7px -14px -7px -22px;
}
.sr-tick:hover { width: 20px; background-color: rgba(30, 50, 70, 0.62); }
.sr-tick.active { width: 26px; height: 4px; background-color: #1e3246; }
.sr-tick:focus { outline: none; }
.sr-tick:focus-visible { outline: 2px solid #1e3246; outline-offset: 5px; }
.sr-top:focus { outline: none; }
.sr-top:focus-visible { outline: 2px solid #1e3246; outline-offset: 2px; border-radius: 4px; }

/* над тёмной фотографией первого экрана */
.sr-rail.sr-dark .sr-tick { background-color: rgba(255, 255, 255, 0.5); }
.sr-rail.sr-dark .sr-tick:hover { background-color: rgba(255, 255, 255, 0.8); }
.sr-rail.sr-dark .sr-tick.active { background-color: #ffffff; }
.sr-rail.sr-dark .sr-top { color: #ffffff; }
.sr-rail.sr-dark .sr-tick:focus-visible,
.sr-rail.sr-dark .sr-top:focus-visible { outline-color: #ffffff; }

/* Стрелка «листайте вниз»: появляется через 5 с без прокрутки, мягко покачивается. */
.sr-hint {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translate(-50%, 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #1e3246;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  z-index: 950;
  filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.85));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s ease, color 0.25s ease;
}
.sr-hint.is-shown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: srHintFloat 2.6s ease-in-out infinite;
}
.sr-hint:hover { color: #2f4d6b; }
.sr-hint.sr-dark { color: #ffffff; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45)); }
.sr-hint.sr-dark:hover { color: rgba(255, 255, 255, 0.82); }
.sr-hint svg { display: block; }
@keyframes srHintFloat {
  0%, 100% { transform: translate(-50%, -4px); }
  50% { transform: translate(-50%, 9px); }
}

/* Как у FlippingStroy: рельса заменяет обычную полосу прокрутки на компьютере с мышью. */
@media (min-width: 1241px) and (hover: hover) and (pointer: fine) {
  html.sr-on { scrollbar-width: none; -ms-overflow-style: none; }
  html.sr-on::-webkit-scrollbar { width: 0; height: 0; display: none; }
}

/* Как у FlippingStroy: на узких окнах, телефонах и планшетах рельсы и стрелки нет — обычная прокрутка. */
@media (max-width: 1240px) {
  .sr-rail, .sr-hint { display: none !important; }
}
@media (hover: none), (pointer: coarse) {
  .sr-rail, .sr-hint { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .sr-hint.is-shown { animation: none; transform: translate(-50%, 0); }
  .sr-tick, .sr-top, .sr-hint { transition: none; }
}
@media print {
  .sr-rail, .sr-hint { display: none !important; }
}
