/* ═══════════════════════════════════════════
   VIDMA STORIES v5
═══════════════════════════════════════════ */

.vidma-stories-wrap {
    width: 100%;
    overflow: hidden;
    padding: 8px 0;
}

.vidma-stories-list {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 4px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
}
.vidma-stories-list::-webkit-scrollbar { display: none; }

.vidma-story-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
}

.vidma-story-circle {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    padding: 3px;
    background: rgb(174, 154, 229);
    transition: transform 0.18s;
}
.vidma-story-avatar:hover .vidma-story-circle {
    transform: scale(1.07);
}
.vidma-story-avatar.viewed .vidma-story-circle {
    background: #ccc;
}

.vidma-story-circle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    display: block;
}

.vidma-story-name {
    font-size: 11px;
    color: #333;
    text-align: center;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

/* ═══════════════════════════════════════════
   МОДАЛЬНЕ ВІКНО
═══════════════════════════════════════════ */
.vidma-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vidma-modal-inner {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 100dvh;
    max-height: 860px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (min-width: 480px) {
    .vidma-modal-inner {
        border-radius: 16px;
        height: 90dvh;
    }
}

/* Прогрес-бари */
.vidma-progress-bars {
    position: absolute;
    top: 10px;
    left: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 10;
}
.vidma-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.35);
    border-radius: 2px;
    overflow: hidden;
}
.vidma-progress-bar.done .vidma-progress-bar-fill { width: 100%; background: #fff; }
.vidma-progress-bar.active .vidma-progress-bar-fill { background: #fff; }
.vidma-progress-bar-fill { height: 100%; width: 0; background: #fff; }

/* Хедер */
.vidma-story-header {
    position: absolute;
    top: 22px;
    left: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}
.vidma-header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.8);
    flex-shrink: 0;
}
.vidma-header-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Кнопка mute */
.vidma-mute-btn {
    background: rgba(0,0,0,0.45);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

/* Кнопка закрити */
.vidma-close {
    background: rgba(0,0,0,0.45);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

/* Стрілки */
.vidma-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.vidma-nav:hover { background: rgba(255,255,255,0.3); }
.vidma-nav-prev { left: 8px; }
.vidma-nav-next { right: 8px; }

/* Медіа — заповнює весь екран */
.vidma-slide-media {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    z-index: 1;
}
.vidma-slide-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.vidma-slide-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.vidma-slide-media iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Футер з кнопками */
.vidma-slide-footer {
    position: absolute;
    bottom: 20px;
    left: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
    align-items: center;
}
.vidma-product-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: rgba(255,255,255,0.95);
    color: #222;
    text-align: center;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    transition: background 0.15s, transform 0.1s;
}
.vidma-product-btn:hover {
    background: #fff;
    transform: translateY(-1px);
    text-decoration: none;
    color: #111;
}

@media (max-width: 480px) {
    .vidma-story-circle { width: 58px; height: 58px; }
    .vidma-story-name { font-size: 10px; max-width: 60px; }
}
