/* Story rail + viewer — bfrontshop storefront */
.story-rail {
    --story-brand: var(--brand-primary, #0071e3);
    padding: 8px 0 4px;
}
.story-rail__title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    padding: 0 16px 10px;
}
.story-rail__track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 16px 10px;
    scrollbar-width: none;
}
.story-rail__track::-webkit-scrollbar { display: none; }
.story-item {
    flex: 0 0 auto;
    width: 72px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}
.story-item__ring {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    padding: 2.5px;
    /* گرادیان برند اینستاگرام */
    background: conic-gradient(from 180deg, #feda75 0%, #fa7e1e 15%, #d62976 40%, #962fbf 65%, #4f5bd5 85%, #feda75 100%);
    transition: transform .15s ease;
}
.story-item:hover .story-item__ring { transform: scale(1.06); }
.story-item__cover {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2.5px solid #fff;
    object-fit: cover;
    display: block;
}
.story-item__cover--ph {
    background: linear-gradient(135deg, #e5e7eb, #cbd5e1);
}
.story-item__name {
    font-size: 12px;
    color: #1f2937;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* viewer overlay */
.story-viewer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(2, 6, 23, .92);
    display: flex;
    align-items: center;
    justify-content: center;
}
.story-viewer[hidden] { display: none; }
.story-viewer__stage {
    position: relative;
    width: min(420px, 100vw);
    height: min(90vh, 760px);
    background: #0b1220;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
    display: flex;
    flex-direction: column;
}
.story-viewer__stage::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 96px;
    background: linear-gradient(180deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0));
    z-index: 2;
    pointer-events: none;
}
.story-viewer__stage::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 150px;
    background: linear-gradient(0deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0));
    z-index: 1;
    pointer-events: none;
}
.story-viewer__progress {
    position: absolute;
    top: 10px;
    right: 12px;
    left: 12px;
    display: flex;
    gap: 4px;
    z-index: 3;
}
.story-viewer__progress i {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .5);
    overflow: hidden;
}
.story-viewer__progress i b {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
}
.story-viewer__top {
    position: absolute;
    top: 22px;
    right: 14px;
    left: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 3;
    color: #fff;
}
.story-viewer__meta { display: flex; align-items: center; gap: 8px; }
.story-viewer__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(255, 255, 255, .8);
}
.story-viewer__title { font-size: 13px; font-weight: 700; }
.story-viewer__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.story-viewer__mute,
.story-viewer__close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.story-viewer__mute[hidden] { display: none; }
.story-viewer__mute:hover,
.story-viewer__close:hover { background: rgba(0, 0, 0, .6); }
.story-viewer__close { font-size: 18px; }
.story-viewer__media {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.story-viewer__media img,
.story-viewer__media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.story-viewer__caption {
    position: absolute;
    bottom: 88px;
    right: 16px;
    left: 16px;
    margin: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
    z-index: 2;
}
.story-viewer__tap {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 34%;
    background: none;
    border: 0;
    z-index: 2;
    cursor: pointer;
}
/* RTL: قبلی سمت راست، بعدی سمت چپ */
.story-viewer__tap--prev { right: 0; }
.story-viewer__tap--next { left: 0; }
.story-viewer__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .38);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}
.story-viewer__nav:hover { background: rgba(0, 0, 0, .62); }
.story-viewer__nav--prev { right: 12px; }
.story-viewer__nav--next { left: 12px; }
@media (max-width: 575.98px) {
    .story-viewer__nav { display: none; }
}
.story-viewer__link {
    position: absolute;
    bottom: 16px;
    right: 14px;
    left: 14px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
}
.story-viewer__link[hidden] { display: none; }
.story-viewer__link-icon {
    width: 30px; height: 30px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--story-brand); color: #fff;
}
.story-viewer__link-text { flex: 1; }
.story-viewer__link-arrow { color: var(--story-brand); }

@media (max-width: 575.98px) {
    .story-viewer__stage { width: 100vw; height: 100vh; border-radius: 0; }
}
