/**
 * PP Videocommerce - Stories (Front-end)
 * Version: 1.0.9
 */

/* ---------- Trilha / cards ---------- */
.pxv-stories {
    --pxv-accent: #111;
    --pxv-gap: 14px;
    --pxv-visible: var(--pxv-visible-d, 4);
    width: 100%;
    max-width: 100%;
    margin: 16px 0;
}
.pxv-stories-track {
    display: flex;
    gap: var(--pxv-gap);
    overflow-x: auto;
    overflow-y: hidden;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 4px 2px 12px;
    scroll-snap-type: none; /* free scroll no desktop */
    cursor: grab;
}
.pxv-stories-track.pxv-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
}
.pxv-stories-track.pxv-dragging .pxv-story-item { pointer-events: none; }
.pxv-stories-track::-webkit-scrollbar { height: 6px; }
.pxv-stories-track::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 6px; }

.pxv-story-item {
    flex: 0 0 calc((100% - (var(--pxv-visible) - 1) * var(--pxv-gap)) / var(--pxv-visible));
    box-sizing: border-box;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font: inherit;
}

.pxv-story-thumb {
    position: relative;
    display: block;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-color: #e9e9ee;
    overflow: hidden;
}
.pxv-story-thumb-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pxv-story-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,.28);
    border: 2px solid rgba(255,255,255,.85);
    backdrop-filter: blur(2px);
}
.pxv-story-play::after {
    content: "";
    position: absolute;
    left: 54%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 8px 0 8px 13px;
    border-color: transparent transparent transparent #fff;
}

/* Formato STORIES: cards verticais 9:16 (altura proporcional à largura) */
.pxv-stories--stories .pxv-story-thumb {
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

/* Formato CIRCULAR: destaques redondos (tamanho limitado, centralizado no item) */
.pxv-stories--circular .pxv-story-thumb {
    width: min(100%, 92px);
    aspect-ratio: 1;
    border-radius: 50%;
    margin: 0 auto;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pxv-accent);
}
.pxv-stories--circular .pxv-story-play { width: 34px; height: 34px; }
.pxv-stories--circular .pxv-story-play::after { border-width: 6px 0 6px 10px; }
.pxv-story-label {
    font-size: 12px;
    line-height: 1.2;
    max-width: 100%;
    text-align: center;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile: usa a contagem de mobile e ganha um leve "snap" charmoso */
@media (max-width: 782px) {
    .pxv-stories { --pxv-visible: var(--pxv-visible-m, 2.2); }
    .pxv-stories-track {
        scroll-snap-type: x proximity;
        scroll-padding-left: 2px;
    }
    .pxv-story-item { scroll-snap-align: start; }
    .pxv-stories--stories .pxv-story-thumb { border-radius: 14px; }
}

/* ---------- Player fullscreen ---------- */
.pxv-viewer {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s ease;
}
.pxv-viewer.is-open { opacity: 1; }
.pxv-viewer * { box-sizing: border-box; }

.pxv-viewer-stage {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 100%;
    max-height: 92vh;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 600px) {
    .pxv-viewer-stage { max-width: 100%; max-height: 100%; border-radius: 0; }
}

.pxv-viewer-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.pxv-viewer-progress {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 5;
}
.pxv-viewer-bar {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    background: rgba(255,255,255,.35);
    overflow: hidden;
}
.pxv-viewer-bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
}
.pxv-viewer-bar.is-done > span { width: 100%; }

.pxv-viewer-close {
    position: absolute;
    top: 16px;
    right: 12px;
    z-index: 6;
    width: 38px; height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.35);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.pxv-viewer-mute {
    position: absolute;
    top: 16px;
    right: 58px;
    z-index: 6;
    width: 38px; height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.35);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.pxv-viewer-nav {
    position: absolute;
    top: 0; bottom: 0;
    width: 35%;
    z-index: 4;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.pxv-viewer-prev { left: 0; }
.pxv-viewer-next { right: 0; width: 65%; }

.pxv-viewer-link {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    background: #fff;
    color: #111;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.pxv-viewer-title {
    position: absolute;
    top: 26px;
    left: 14px;
    z-index: 5;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
    max-width: 60%;
}
.pxv-no-scroll { overflow: hidden !important; }

/* ---------- Título do slider ---------- */
.pxv-stories-title {
    margin: 0 0 14px;
    line-height: 1.2;
}
