.shop-stories-bar {
  margin-top: 120px;
  padding: 12px 0 8px;
  background: #fff;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.shop-stories-slider-wrap {
  position: relative;
  padding: 0 16px;
}
.shop-stories-swiper {
  overflow: hidden;
  width: 100%;
  cursor: grab;
  touch-action: pan-x;
}
.shop-stories-swiper:active {
  cursor: grabbing;
}
.shop-stories-swiper .swiper-slide {
  width: 84px;
}
.shop-stories-item {
  width: 84px;
  text-align: center;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.shop-stories-ring {
  width: 76px;
  height: 76px;
  margin: 0 auto 8px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  transition: background 0.2s ease, transform 0.2s ease;
}
.shop-stories-item:hover .shop-stories-ring,
.shop-stories-item:focus .shop-stories-ring {
  transform: scale(1.04);
}
.shop-stories-item.is-seen .shop-stories-ring {
  background: #c7c7c7;
}
.shop-stories-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  padding: 2px;
}
.shop-stories-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.shop-stories-label {
  font-size: 12px;
  font-weight: 500;
  color: #202122;
  line-height: 1.35;
  max-height: 32px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.shop-story-viewer {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(10, 10, 12, 0.96);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 18px;
  direction: rtl;
}
.shop-story-viewer.is-open {
  display: flex;
}
.shop-story-viewer-inner {
  position: relative;
  width: min(420px, calc(100% - 120px));
  height: min(780px, 100%);
  max-height: 100vh;
  background: #000;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  border-radius: 12px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.shop-story-switch {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.shop-story-switch .fi {
  font-size: 26px;
  line-height: 1;
}
.shop-story-switch:hover {
  background: rgba(255, 255, 255, 0.28);
}
.shop-story-switch.is-disabled {
  opacity: 0.25;
  pointer-events: none;
}
.shop-story-progress {
  position: absolute;
  top: 10px;
  right: 10px;
  left: 10px;
  z-index: 5;
  display: flex;
  gap: 4px;
}
.shop-story-progress span {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 99px;
  overflow: hidden;
}
.shop-story-progress span i {
  display: block;
  width: 0;
  height: 100%;
  background: #fff;
  border-radius: 99px;
}
.shop-story-header {
  position: absolute;
  top: 22px;
  right: 12px;
  left: 12px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  pointer-events: auto;
}
.shop-story-header img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.shop-story-header .meta {
  flex: 1;
  min-width: 0;
}
.shop-story-header .meta strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-story-header .meta small {
  font-size: 11px;
  opacity: 0.8;
}
.shop-story-header button {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.shop-story-media {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  pointer-events: none;
}
.shop-story-media img,
.shop-story-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
.shop-story-overlay-text {
  position: absolute;
  right: 16px;
  left: 16px;
  bottom: 118px;
  z-index: 4;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.shop-story-overlay-text h3 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 6px;
  color: #fff;
}
.shop-story-overlay-text p {
  font-size: 13px;
  margin: 0;
  line-height: 1.6;
  color: #fff;
}
.shop-story-product {
  position: absolute;
  right: 12px;
  left: 12px;
  bottom: 62px;
  z-index: 8;
  display: none;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 8px 10px;
  text-decoration: none;
  color: #202122;
  pointer-events: auto;
}
.shop-story-product.is-visible {
  display: flex;
}
.shop-story-product img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
}
.shop-story-product .info {
  flex: 1;
  min-width: 0;
}
.shop-story-product .info strong {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-story-product .info span {
  font-size: 12px;
  color: #d73700;
  font-weight: 700;
}
.shop-story-cta {
  position: absolute;
  right: 12px;
  left: 12px;
  bottom: 16px;
  z-index: 8;
  display: none;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 50px;
  background: #d73700;
  color: #fff !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  pointer-events: auto;
}
.shop-story-cta.is-visible {
  display: flex;
}
.shop-story-mute {
  width: 38px;
  height: 38px;
  border: 0;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  font-size: 16px;
}
.shop-story-mute.is-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.has-shop-stories .home-swiper-section,
body.has-shop-stories .home-swiper-section.type-2 {
  margin-top: 8px !important;
}
body.has-shop-stories #products-section {
  margin-top: 12px !important;
}
body.has-shop-stories #product-details {
  padding-top: 12px !important;
}
body.has-shop-stories .user-dashboard-section,
body.has-shop-stories .master-page {
  margin-top: 12px;
}

@media (min-width: 992px) {
  /* promo در flow است؛ navbar ثابت است — استوری باید زیر navbar دیده شود */
  body.has-top-promo .shop-stories-bar {
    margin-top: 120px;
  }
}

@media (max-width: 992px) {
  .shop-stories-bar {
    margin-top: 68px;
    padding: 10px 0 2px;
  }
  .shop-stories-slider-wrap {
    padding: 0 12px;
  }
  .shop-stories-swiper .swiper-slide,
  .shop-stories-item { width: 74px; }
  .shop-stories-ring { width: 66px; height: 66px; }
}
@media (max-width: 768px) {
  .shop-stories-bar {
    margin-top: 54px;
  }
  .shop-story-viewer {
    gap: 0;
  }
  .shop-story-viewer-inner {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  .shop-story-switch {
    display: none;
  }
}
body.shop-story-locked {
  overflow: hidden;
}
