.v-stories-product {
  padding-top: 40px;
  padding-bottom: 40px;
}

/* Inner pages keep 80px under the product (40px on a narrow window, 40px in the mobile template). Pull the block back over that empty padding so the heading sits as close as "Вы смотрели". */
body#main .v-stories-product {
  margin-top: -80px;
}

body:not(#main) .v-stories-product {
  margin-top: -40px;
  padding-top: 24px;
  padding-bottom: 24px;
}

.drag-block.STORIES {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
}

.v-stories {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  font-family: inherit;
}

.v-stories .index-block__subtitle {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 18px;
  color: var(--basic_text_black, #555);
}

.v-stories .v-stories__feed:not(.swiper-initialized) {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.v-stories__feed-wrap {
  position: relative;
}

.v-stories__feed::-webkit-scrollbar {
  display: none;
}

.v-stories__feed-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 18px rgba(28, 28, 28, 0.16);
  cursor: pointer;
}

.v-stories__feed-nav--prev {
  left: 0;
}

.v-stories__feed-nav--next {
  right: 0;
}

.v-stories__feed-nav::before {
  content: "";
  position: absolute;
  top: 14px;
  width: 9px;
  height: 9px;
  border-top: 2px solid #1c1c1c;
  border-right: 2px solid #1c1c1c;
}

.v-stories__feed-nav--prev::before {
  left: 16px;
  transform: rotate(-135deg);
}

.v-stories__feed-nav--next::before {
  left: 13px;
  transform: rotate(45deg);
}

.v-stories__feed-nav.swiper-button-disabled {
  opacity: 0;
  pointer-events: none;
}

.v-stories__play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.v-stories__play-badge::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 18px;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #1c1c1c;
}

.v-stories__feed.swiper-initialized {
  display: block;
  gap: 0;
  overflow: hidden;
}

.v-stories .swiper-slide {
  width: 192px;
  flex: 0 0 192px;
  height: auto;
  box-sizing: border-box;
}

.v-stories__card {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  overflow: hidden;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.v-stories__photo {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.v-stories__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v-stories__name {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  z-index: 1;
  margin: 0;
  color: #fff;
  font-family: inherit;
  font-weight: 500;
  font-size: 15px;
  line-height: 19px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.v-stories__viewer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  overflow: hidden;
  background: rgba(8, 10, 10, 0.78);
}

.v-stories__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  max-height: 100%;
}

.v-stories__center {
  position: relative;
  flex: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
}

.v-stories__peek {
  position: relative;
  flex: 0 0 auto;
  height: min(700px, calc(100dvh - 120px));
  aspect-ratio: 9 / 16;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #161616;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.v-stories__peek[hidden] {
  display: none !important;
}

.v-stories__peek img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v-stories__peek-shade {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 10, 0.38);
}

.v-stories__peek-name {
  position: absolute;
  top: 16px;
  right: 16px;
  left: 16px;
  z-index: 1;
  font-weight: 500;
  font-size: 16px;
  line-height: 20px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.v-stories__peek-bottom {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.v-stories__peek-text {
  font-size: 14px;
  line-height: 18px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.v-stories__peek-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff;
  color: #1c1c1c;
  font-weight: 700;
  font-size: 14px;
  line-height: 18px;
}

.v-stories__viewer[hidden] {
  display: none !important;
}

.v-stories__stage {
  position: relative;
  flex: 0 0 auto;
  height: min(820px, calc(100dvh - 48px));
  aspect-ratio: 9 / 16;
  width: auto;
  overflow: hidden;
  border-radius: 18px;
  background: #111;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  touch-action: none;
  user-select: none;
}

.v-stories__frame,
.v-stories__frame img,
.v-stories__frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}

.v-stories__dim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.v-stories__dim.is-light {
  background: rgba(12, 17, 17, 0.25);
}

.v-stories__dim.is-medium {
  background: rgba(12, 17, 17, 0.45);
}

.v-stories__dim.is-dark {
  background: rgba(12, 17, 17, 0.65);
}

.v-stories__bars {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  gap: 4px;
}

.v-stories__bar {
  flex: 1 1 0;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}

.v-stories__bar > span {
  display: block;
  width: 0;
  height: 100%;
  background: #fff;
}

.v-stories__close,
.v-stories__sound,
.v-stories__play {
  z-index: 4;
  border: 0;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.v-stories__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.v-stories__close::before,
.v-stories__close::after {
  content: "";
  position: absolute;
  top: 19px;
  left: 10px;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: #fff;
}

.v-stories__close::before {
  transform: rotate(45deg);
}

.v-stories__close::after {
  transform: rotate(-45deg);
}

.v-stories__sound {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.v-stories__sound svg {
  width: 20px;
  height: 20px;
}

.v-stories__sound.is-muted .v-stories__sound-on,
.v-stories__sound:not(.is-muted) .v-stories__sound-off {
  display: none;
}

.v-stories__play {
  position: absolute;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 15px;
  line-height: 20px;
}

.v-stories__bottom {
  position: absolute;
  right: 16px;
  bottom: 20px;
  left: 16px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.v-stories__bottom-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.v-stories__bottom::before {
  content: "";
  position: absolute;
  right: -16px;
  bottom: -20px;
  left: -16px;
  z-index: -1;
  height: 220px;
  background: linear-gradient(180deg, rgba(8, 10, 10, 0) 0%, rgba(8, 10, 10, 0.72) 70%);
  pointer-events: none;
}

.v-stories__title,
.v-stories__caption {
  margin: 0;
  color: #fff;
  font-family: inherit;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.v-stories__title {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 500;
  font-size: 16px;
  line-height: 22px;
}

.v-stories__caption {
  font-size: 15px;
  line-height: 21px;
  white-space: pre-wrap;
}

.v-stories__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #fff;
  color: #1c1c1c;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  line-height: 20px;
  text-align: center;
  text-decoration: none;
}

.v-stories__cta:hover {
  color: #1c1c1c;
}

.v-stories__nav {
  display: none !important;
}

.v-stories__nav::before {
  content: "";
  position: absolute;
  top: 16px;
  width: 10px;
  height: 10px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
}

.v-stories__nav--prev::before {
  left: 18px;
  transform: rotate(-135deg);
}

.v-stories__nav--next::before {
  left: 14px;
  transform: rotate(45deg);
}

.v-stories__nav[hidden] {
  display: none !important;
}

html.v-stories-lock,
html.v-stories-lock body {
  overflow: hidden;
}

html.v-stories-lock .swiper-button-next,
html.v-stories-lock .swiper-button-prev,
html.v-stories-lock .slider-nav {
  visibility: hidden !important;
}

@media (max-width: 600px) {
  body#main .v-stories-product {
    margin-top: -40px;
  }
}

@media (max-width: 767px) {
  .v-stories-product {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .v-stories__viewer {
    padding: 52px 0 0;
    background: #000;
  }

  .v-stories__row {
    display: block;
    width: 100%;
    height: 100%;
  }

  .v-stories__peek {
    display: none !important;
  }

  .v-stories__center {
    width: 100%;
    height: 100%;
  }

  .v-stories__stage {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
  }

  .v-stories__nav {
    display: none;
  }

  .v-stories .v-stories__feed:not(.swiper-initialized) {
    gap: 12px;
  }

  .v-stories .swiper-slide {
    width: 160px;
    flex-basis: 160px;
  }

  .v-stories__name {
    top: 10px;
    right: 10px;
    left: 10px;
    font-size: 14px;
    line-height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .v-stories__bar > span,
  .v-stories__name {
    transition: none;
  }

}
