/* Stories widget styles */
.stories-widget {
    padding: 15px 0;
}
.stories-list {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.story-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}
.story-item:hover {
    transform: scale(1.05);
}
.story-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    padding: 4px;
    background: #888 !important;
    background-size: 300% 300%;
    animation: gradientShift 3s infinite;
}
.story-circle.viewed {
    background: #888 !important;
    animation: none !important;
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.story-circle-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    background: #fff;
}
.story-circle-inner video,
.story-circle-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.story-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    color: white;
    text-shadow: 0 0 4px rgba(0,0,0,0.6);
}
.story-label {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #555;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Модальное окно с отступом от хедера */
.story-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.95);
    overflow-y: auto;
    flex-direction: column;
    align-items: center;
    padding-top: 100px;
    box-sizing: border-box;
}
.story-modal.active {
    display: flex;
}
.story-modal-close {
    position: absolute;
    top: 150px;
    right: 30px;
    color: white;
    font-size: 36px;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1000002;
}
.story-modal-video-wrap {
    flex-shrink: 0;
    padding: 20px;
    width: 100%;
    text-align: center;
}
#story-video-player {
    max-width: 90vw;
    max-height: 50vh;
    border-radius: 8px;
    background: #000;
}
@media (max-width: 768px) {
    .story-modal {
        padding-top: 70px;
    }
    .story-modal-close {
        top: 150px;
        right: 20px;
    }
    #story-video-player {
        max-width: 95vw;
        max-height: 40vh;
    }
}
.story-modal-meta {
    padding: 10px 20px;
    color: white;
    text-align: center;
}
.story-modal-title {
    font-size: 18px;
}
.story-modal-views {
    font-size: 14px;
    color: #ccc;
}
.story-modal-bottom {
    flex: 1;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}
@media (min-width: 769px) {
    .story-modal-bottom {
        padding: 0 25%;
    }
}
.story-section-title {
    color: white;
    font-size: 16px;
    margin-bottom: 10px;
}
.story-hscroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 20px;
}
.story-hscroll::-webkit-scrollbar {
    display: none;
}
.story-vgrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}
@media (min-width: 769px) {
    .story-vgrid {
        grid-template-columns: repeat(6, 1fr);
    }
}
.story-nav-item {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
}
.story-nav-item.active {
    border-color: white;
}
.story-nav-item video,
.story-nav-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.story-nav-label {
    display: block;
    color: white;
    font-size: 11px;
    text-align: center;
    margin-top: 5px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.story-view-count {
    color: #ccc;
    font-size: 11px;
}
/* ========== STORIES WIDGET ========== */
@media (min-width: 768px) {
.storis {
    width: 100%;
    display: flex;
    padding-right: 20px;
}}
@media (max-width: 768px) {
.storis {
    width: 100%;
    display: flex;
}}
@media (min-width: 768px) and (max-width: 1200px)  {
.storis {
padding-left: 1%;
}}
@media (min-width: 768px) {
.stories-widget {
}}
.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 999;
}
@media (min-width: 1600px) {
.story-item {
    width: 20%;
}}
@media (min-width: 1200px) and (max-width: 1600px) {
.story-item {
    width: 20%;
}}
@media (min-width: 768px) and (max-width: 1200px) {
.story-item {
    width: 20%;
}}
@media (max-width: 768px) {
.story-item {
    width: 50%;
}}
.stories-list {
    justify-content: flex-start !important;
}
@media (max-width: 768px) {
.story-item {
    height: auto;
}}
.story-label {
    color: #ffffff !important;
    font-size: 1.2rem !important;
    max-width: 100% !important;
}
.story-circle {
    width: 90% !important;
    height: 80% !important;
    border-radius: 50% !important;
}
@media (min-width: 768px) {
.stories-list {
    display: flex;
    flex-wrap: nowrap !important;
    flex-direction: row;
    width: 100%;
    gap: 0px !important;
}}
@media (max-width: 768px) {
.stories-list {
    display: -webkit-box !important;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    margin-bottom: 0px;
    margin-right: -20px;
    margin-left: -20px;
    padding-left: 2%;
    padding-right: 2%;
}}
@media (max-width: 768px) {
.stories-widget {
    padding: 15px 20px !important;
}}
.story-circle-inner {
    height: 100% !important;
    width: auto !important;
    background: #000000 !important;
}
.story-circle-inner video {
    width: 100% !important;
    height: 100% !important;
    border-radius: 40% !important;
}
.story-modal {
}
@media (max-width: 768px) {
.story-modal video {
    max-width: 100% !important;
}}
@media (min-width: 768px) {
.story-modal video {
    max-width: 100% !important;
}}
.story-modal {
    align-items:center; 
    padding-top: 150px;
}
.story-item:hover { transform:scale(1.05); }

.story-circle.viewed { 
    background:#888 !important; 
    animation:none !important; }
@keyframes gradientShift {
    0%{
        background-position:0% 50%} 
    50%{
        background-position:100% 50%} 
    100%{
        background-position:0% 50%}
    }
.story-circle-inner video {
    object-fit:cover; 
    }
.story-play-icon {
    position:absolute; 
    top:50%; 
    left:50%; 
    transform:translate(-50%,-50%);
    font-size:22px; 
    color:white; 
    text-shadow:0 0 4px rgba(0,0,0,0.6);
    }
.story-label { 
    display:block; 
    margin-top:5px; 
    font-size:12px; 
    color:#555; 
    max-width:90px; 
    overflow:hidden; 
    text-overflow:ellipsis; 
    white-space:nowrap; }

        /* Модальное окно */
        
.story-modal.active { 
    display:flex; 
}
.story-modal video {
    max-width:100%; 
    max-height:80vh; 
    border-radius:8px;
}
@media (max-width:768px) {
    .story-modal video { 
        max-height:65vh; 
        
    }
    }
.story-modal-title {
    color:white; 
    font-size:18px; 
    margin-top:15px; 
    text-align:center; 
    padding:0 20px;
    }
.story-modal {
    height: 100vh !important;
    padding-bottom: 140px;
}
@media (min-width:768px) {
.story-modal-bottom {
    padding: 0% 25% !important;
}}
.story-modal.active {
    overflow-x: visible !important;
}
.story-modal-bottom {
    overflow-y: visible !important;
}
.story-modal-nav {
    display:flex; 
    gap:20px; 
    margin-top:20px; 
    flex-wrap:wrap; 
    justify-content:flex-start;
    padding: 20px;
}
@media (min-width:768px) {
.story-modal-nav-item {
    width:150px; 
    height:150px; 
    border-radius:50%; 
    overflow:hidden; 
    cursor:pointer;
    border:2px solid transparent; 
    transition:0.2s;
  }  }
@media (max-width:768px) {
.story-modal-nav-item {
    width: 100%;
    height: 180px;
    border-radius:50%; 
    overflow:hidden; 
    cursor:pointer;
    border:2px solid transparent; 
    transition:0.2s;
   } }
.story-modal-nav-item.active { 
    border-color:#fff; 
}
.story-modal-nav-item video {
    width:100%; 
    height:100%; 
    object-fit:cover; 
    border-radius:50%;
    }
/* Навигация в модальном окне Stories */
.story-modal-nav {
    display: flex !important;
    gap: 20px !important;
    margin-top: 20px !important;
    justify-content: center !important;
    z-index: 1000001 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important;  /* IE/Edge */
    max-width: 90vw !important;
    padding-bottom: 10px !important;
    flex-wrap: nowrap !important; /* ← важно: не переносить на новую строку */
}

.story-modal-nav::-webkit-scrollbar {
    display: none !important; /* Chrome/Safari */
}

/* Обёртка для каждого элемента навигации */
.story-modal-nav > div {
    flex-shrink: 0 !important;
    min-width: 80px !important;
    max-width: 45vw !important;
}

.story-modal-nav-item {
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    min-height: 80px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    cursor: pointer !important;
    border: 2px solid transparent !important;
    transition: 0.2s !important;
}
#story-video-player {
    max-width: 90vw;
    max-height: 50vh;
    border-radius: 8px;
}
.story-modal-meta {
    padding: 10px 20px;
    color: white;
    text-align: center;
    flex-shrink: 0;
}
.story-modal-title {
    font-size: 18px;
}
.story-modal-views {
    font-size: 14px;
    color: #ccc;
}
.story-modal-bottom {
    -webkit-overflow-scrolling: touch;
}

.story-modal { 
    flex-direction: column;
    overflow-x: hidden;         /* ← запрещаем горизонтальную */
    -webkit-overflow-scrolling: touch;
}
@media (max-width:768px) {
.story-hscroll {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 40px;
    padding-right: 40px;
}}

.stories-widget .stories-list .story-circle {
    background: linear-gradient(45deg, #009dff, #00ff4e, #ff4000, #0dff00, #ff0707) !important;
    background-size: 300% 300% !important;
    animation: gradientShift 3s infinite !important;
    padding: 0px !important;
    z-index: 999;
}
.stories-widget .stories-list .story-circle.viewed {
    background: #888 !important;
    animation: none !important;
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.hero-stories {
    margin-left: -45px;
    margin-right: -44px;
}