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

/* ---------- 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;
}

/* ===== v1.2.0/1.3.0/1.4.0: Área shoppable no player ===== */
.pxv-viewer-shop {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 18px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    /* Painel escuro com leve gradiente, como no mockup */
    background: linear-gradient(180deg, rgba(18,20,26,0.82) 0%, rgba(12,14,18,0.92) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    color: #fff;
    transition: opacity .2s ease, transform .2s ease;
}
.pxv-viewer-shop.is-hidden {
    opacity: 0;
    transform: translateY(130%);
    pointer-events: none;
}

/* Tira "MONTE O LOOK" */
.pxv-viewer-strip-wrap { display: block; }
.pxv-viewer-strip-label {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}
.pxv-viewer-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.pxv-viewer-strip::-webkit-scrollbar { display: none; }
.pxv-strip-thumb {
    flex: 0 0 auto;
    width: 62px;
    height: 62px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.10) center/cover no-repeat;
    cursor: pointer;
    padding: 0;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.pxv-strip-thumb.is-active {
    border-color: var(--pxv-accent, #F2B233);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

/* Card do produto ativo */
.pxv-viewer-product {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pxv-vp-thumb {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    display: block;
}
.pxv-vp-thumb span {
    display: block;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.12);
}
.pxv-vp-info { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.pxv-vp-name {
    display: block;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pxv-vp-name:hover { text-decoration: underline; }
.pxv-vp-price,
.pxv-vp-price * {
    color: rgba(255, 255, 255, 0.92) !important;
    font-size: 14px;
    line-height: 1.3;
}
.pxv-vp-price { margin-top: 2px; font-weight: 700; }
.pxv-vp-price del,
.pxv-vp-price del * { opacity: 0.55; margin-right: 6px; font-weight: 400; text-decoration: line-through; }
.pxv-vp-price ins,
.pxv-vp-price ins * { text-decoration: none; font-weight: 700; }

/* CTA cheio, largura total, com a cor de destaque */
.pxv-vp-btn {
    width: 100%;
    margin-top: 6px; /* respiro extra entre o card do produto e o botão */
    border: 0;
    border-radius: 12px;
    padding: 15px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    background: var(--pxv-accent, #F2B233);
    color: var(--pxv-accent-text, #1a1a1a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: filter .15s ease, opacity .15s ease;
}
.pxv-vp-btn:hover { filter: brightness(0.95); }
.pxv-vp-btn:disabled { opacity: 0.55; cursor: default; }
.pxv-vp-btn.is-view { background: rgba(255, 255, 255, 0.16); color: #fff; }
.pxv-vp-btn.is-flash { background: #fff4e5; color: #8a5a00; }

/* Texto de apoio */
.pxv-viewer-subtext {
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}
.pxv-viewer-subtext:empty { display: none; }

/* ===== Barra de variação no TOPO (swatches nativos do Flatsome) ===== */
.pxv-viewer-variations {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 56px;
    z-index: 6;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(18, 20, 26, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
    transition: opacity .2s ease, transform .2s ease;
}
.pxv-viewer-variations.is-hidden {
    opacity: 0;
    transform: translateY(-130%);
    pointer-events: none;
}
/* Neutraliza o layout de tabela/preço/botão do form do Woo — no topo
   queremos só os seletores de atributo (swatches). */
.pxv-viewer-variations .variations_form { margin: 0; }
.pxv-viewer-variations .variations,
.pxv-viewer-variations .variations tbody,
.pxv-viewer-variations .variations tr,
.pxv-viewer-variations .variations td,
.pxv-viewer-variations .variations th {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    background: none;
}
.pxv-viewer-variations .variations tr + tr { margin-top: 8px; }
.pxv-viewer-variations .variations .label,
.pxv-viewer-variations .variations th.label {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}
.pxv-viewer-variations .variations .label label { color: inherit; margin: 0; }
/* Esconde preço/estoque/limpar e o botão dentro da barra do topo:
   a compra acontece pelo CTA de baixo. */
.pxv-viewer-variations .single_variation_wrap .woocommerce-variation,
.pxv-viewer-variations .single_variation_wrap .woocommerce-variation-add-to-cart,
.pxv-viewer-variations .reset_variations { display: none !important; }

/* Swatches do Flatsome, estilizados como chips claros (P / M / G) */
.pxv-viewer-variations .flatsome-variations-buttons,
.pxv-viewer-variations ul.tawcvs-swatches,
.pxv-viewer-variations .variations .value {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pxv-viewer-variations .flatsome-variations-buttons .ux-swatch,
.pxv-viewer-variations ul.tawcvs-swatches li.swatch,
.pxv-viewer-variations .ux-swatch {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all .15s ease;
}
.pxv-viewer-variations .flatsome-variations-buttons .ux-swatch.selected,
.pxv-viewer-variations ul.tawcvs-swatches li.swatch.selected,
.pxv-viewer-variations .ux-swatch.selected {
    background: var(--pxv-accent, #F2B233);
    border-color: var(--pxv-accent, #F2B233);
    color: var(--pxv-accent-text, #1a1a1a);
}
/* Fallback: se o Flatsome não converter em swatches, o select nativo
   continua funcional e visível (nunca some). */
.pxv-viewer-variations select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    font-size: 14px;
}
.pxv-viewer-variations select option { color: #1a1a1a; }

/* A barra de progresso usa a cor de destaque */
.pxv-viewer-bar > span { background: var(--pxv-accent, #F2B233); }
