/* =============================================
   VivaMais Stories — CSS
   ============================================= */

/* ── Wrapper & Track ── */
.vm-stories-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 6px 0 10px;
}

.vm-stories-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 16px 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
}
.vm-stories-track::-webkit-scrollbar { display: none; }

/* ── Story Item (circle + label) ── */
.vm-story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    width: 102px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.vm-story-ring {
    width: 96px;
    height: 96px;
    min-width: 96px;
    min-height: 96px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 2px 10px rgba(220, 39, 67, .4);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vm-story-item:hover .vm-story-ring,
.vm-story-item:focus .vm-story-ring {
    transform: scale(1.07);
    box-shadow: 0 4px 16px rgba(220, 39, 67, .6);
}

/* Clip circular interno — isola completamente do tema */
.vm-story-img-clip {
    width: 90px !important;
    height: 90px !important;
    min-width: 90px !important;
    min-height: 90px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    background: #f0f0f0;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
}

/* Imagem com zoom leve para cortar bordas pretas */
.vm-story-img-clip img {
    width: 108px !important;
    height: 108px !important;
    min-width: 108px !important;
    min-height: 108px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.vm-story-label {
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
    margin-top: 7px;
    color: #333;
    width: 96px;
    max-width: 96px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 500;
}

/* ── Modal Backdrop ── */
#vm-stories-modal {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .88);
    cursor: pointer;
}

/* ── Modal Stage ── */
.vm-modal-stage {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 100dvh;
    max-height: 100dvh;
    background: #111;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 500px) {
    .vm-modal-stage {
        height: 86vh;
        max-height: 780px;
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0,0,0,.7);
    }
}

/* ── Progress Track ── */
.vm-prog-track {
    display: flex;
    gap: 4px;
    position: absolute;
    top: 8px;
    left: 10px;
    right: 10px;
    z-index: 20;
}

.vm-prog-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,.30);
    border-radius: 2px;
    overflow: hidden;
}

.vm-prog-fill {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    transition: width .08s linear;
}

/* ── Story Header ── */
.vm-story-head {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 6px;
}

.vm-head-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.vm-head-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.8);
    flex-shrink: 0;
}

.vm-head-name {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0,0,0,.7);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vm-btn-close {
    background: rgba(0,0,0,.35);
    border: none;
    color: #fff;
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
    line-height: 1;
}
.vm-btn-close:hover { background: rgba(0,0,0,.6); }

/* ── Image Area ── */
.vm-img-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: #000;
}

.vm-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity .15s ease;
}
.vm-main-img.vm-fading { opacity: 0; }

/* Loader spinner */
.vm-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
}
.vm-loader.active { opacity: 1; }

.vm-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vmSpin .7s linear infinite;
}
@keyframes vmSpin { to { transform: rotate(360deg); } }

/* ── Tap Zones ── */
.vm-tap-prev,
.vm-tap-next {
    position: absolute;
    top: 60px;
    bottom: 80px;
    z-index: 15;
    cursor: pointer;
}
.vm-tap-prev { left: 0; width: 38%; }
.vm-tap-next { right: 0; width: 62%; }

/* ── Footer CTA ── */
.vm-story-foot {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 20px 24px;
    background: linear-gradient(transparent, rgba(0,0,0,.75));
    display: flex;
    justify-content: center;
    z-index: 20;
}

.vm-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #111 !important;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: .6px;
    padding: 13px 36px;
    border-radius: 50px;
    text-decoration: none !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-shadow: 0 4px 18px rgba(0,0,0,.45);
    transition: transform .15s ease, background .15s ease;
    white-space: nowrap;
}
.vm-cta-btn:hover {
    transform: scale(1.03);
    background: #f5f5f5;
    color: #111 !important;
    text-decoration: none !important;
}

/* ── Slide-in animation ── */
@keyframes vmSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.vm-modal-stage { animation: vmSlideUp .22s ease; }
