.stories-container {
  padding: 50px 0px 0px;
}

.wp-stories-swiper .swiper-slide {
  /* width: 220px !important; увеличиваем ширину карточек highlights */
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
}

/* Circles list */
.wp-stories-circles {
  overflow: auto;
  margin-right: calc((100% - 100vw) / 2);
  margin-left: -20px;
  padding-left: 20px;
  padding-right: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.wp-story-circle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.wp-story-circle img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.wp-story-ring {
  width: 100%;
  height: 100%;
  border: 2px solid var(--yellow);
  border-radius: 50%;
}
.wp-story-title {
  overflow: hidden;
  max-width: 80px;
  font-size: 14px;
  color: var(--white);
}

/* Viewer popup */
.wp-stories-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.wp-stories-viewer[hidden] {
  display: none;
}
.wp-stories-overlay {
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.wp-stories-stage {
  position: relative;
  width: 90%;
  max-width: 100%;
  height: 100%;
  max-height: 600px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.wp-stories-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
}
.wp-stories-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;

  gap: 4px;
  padding: 8px;
  z-index: 5;
}
.wp-stories-progress {
  display: none;
}
.swiper-slide-active .wp-stories-progress {
  display: flex;
}
.wp-stories-progress .bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
  border-radius: 2px;
}
.wp-stories-progress .bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
}

/* Swiper area */
.wp-stories-swiper img,
.wp-stories-swiper video,
.wp-stories-swiper iframe {
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: cover;
}

/* Tap zones */
.wp-stories-swiper .tap-left,
.wp-stories-swiper .tap-right {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: -1;
}
.wp-stories-swiper .tap-left {
  left: 0;
}
.wp-stories-swiper .tap-right {
  right: 0;
}

.wp-stories-swiper .wp-story-highlight-slide.swiper-slide-active .tap-left,
.wp-stories-swiper .wp-story-highlight-slide.swiper-slide-active .tap-right {
  width: 30% !important;
  display: block;
  z-index: 3;
}

.swiper-slide.wp-story-highlight-slide:after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: #000000b3;
}

.swiper-slide.wp-story-highlight-slide {
  cursor: pointer;
}

.swiper-slide.wp-story-highlight-slide:hover:after,
.swiper-slide.wp-story-highlight-slide.swiper-slide-active:after {
  visibility: hidden;
}

/* CTA link */
.wp-stories-cta {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 3;
}
.wp-stories-link {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: saturate(140%) blur(4px);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
}

/* Панель товаров */
.wp-stories-products-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  background: #ffffff;
  color: #111;
  z-index: 99999;
  padding: 12px 14px 14px;

  max-height: 45%;
  overflow-y: auto;

  transform: translateY(100%);
  transition: transform 0.3s ease;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
}
.wp-stories-products-panel.visible {
  transform: translateY(0);
}
.wp-stories-products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.wp-stories-products-title {
  font-weight: 600;
  font-size: 14px;
}
.wp-stories-products-toggle {
  border: none;
  background: #f4f4f4;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.wp-stories-products-toggle:hover {
  background: #eee;
}

.wp-stories-products-list {
  overflow-x: auto;
  margin-right: calc((100% - 100vw) / 2);
  margin-left: -20px;
  padding-left: 20px;
  padding-right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wp-stories-product {
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}
.wp-stories-product:hover {
  border-color: #ddd;
}
.wp-stories-product img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.wp-stories-product-title {
  font-size: 13px;
  line-height: 1.3;
}

/* Кнопка "Товар из сторис" внутри слайда */
.wp-stories-show-products {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 10;

  border: none;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(2px);
  color: #111;

  padding: 8px 12px;
  font-size: 13px;
  border-radius: 999px;
  cursor: pointer;
}
.wp-stories-show-products:hover {
  background: #fff;
}

/* CTA ссылка (если используешь) */
.wp-stories-cta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: none; /* по умолчанию скрыта; управляется JS */
  z-index: 9;
}
.wp-stories-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-size: 13px;
}

/* Caption поверх */
.wp-stories-caption {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Блокировка кликов на фоне */
.wp-stories-blocker {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 99999; /* чуть меньше, чем панель с товарами */
  pointer-events: auto;
  display: none;
}
.wp-stories-blocker.active {
  display: block;
}
