/* ═══════════════════════════════════════════════════════════
   SMFS Vídeo do Produto — bolha flutuante + player tela cheia
   ═══════════════════════════════════════════════════════════ */

:root {
    --smfs-vp-size: 112px;
    --smfs-vp-side: 24px;
    --smfs-vp-bottom: 24px;
    --smfs-vp-size-mobile: 92px;
    --smfs-vp-side-mobile: 16px;
    --smfs-vp-bottom-mobile: 96px;
}

/* ── Bolha flutuante ─────────────────────────────────────── */

.smfs-vp-bubble {
    position: fixed;
    z-index: 99990;
    bottom: var(--smfs-vp-bottom);
    width: var(--smfs-vp-size);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(12px) scale(0.9);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.smfs-vp-bubble[hidden] {
    display: none;
}

.smfs-vp-bubble.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.smfs-vp-pos-right { right: var(--smfs-vp-side); }
.smfs-vp-pos-left  { left: var(--smfs-vp-side); }

.smfs-vp-bubble-btn {
    position: relative;
    width: var(--smfs-vp-size);
    height: var(--smfs-vp-size);
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28), 0 0 0 3px #fff;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    display: block;
}

.smfs-vp-bubble-btn:hover,
.smfs-vp-bubble-btn:focus-visible {
    transform: scale(1.06);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34), 0 0 0 3px #fff;
    outline: none;
}

/* Seletor com dois níveis de propósito: temas/plugins costumam ter regras como
   `.elementor video { width: 100% }`, que ganhariam de uma classe só e poderiam
   deixar o vídeo sem preencher o círculo (aí apareceriam tarjas nas laterais). */
.smfs-vp-bubble .smfs-vp-bubble-video {
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center center;
    display: block;
    border-radius: 50%;
    background: #fff;
}

/* Anel pulsante — chama atenção sem poluir */
.smfs-vp-bubble-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.65);
    animation: smfs-vp-pulse 2.6s ease-out infinite;
}

@keyframes smfs-vp-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
    70%  { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.smfs-vp-bubble-close {
    position: absolute;
    top: -2px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #1a1a1a;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.smfs-vp-pos-right .smfs-vp-bubble-close { left: -2px; }
.smfs-vp-pos-left  .smfs-vp-bubble-close { right: -2px; }

.smfs-vp-bubble:hover .smfs-vp-bubble-close,
.smfs-vp-bubble:focus-within .smfs-vp-bubble-close {
    opacity: 1;
    transform: scale(1);
}

.smfs-vp-bubble-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0, 0, 0, 0.72);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.6;
}

/* ── Player em tela cheia ────────────────────────────────── */

.smfs-vp-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.smfs-vp-modal[hidden] {
    display: none;
}

.smfs-vp-modal.is-open {
    opacity: 1;
}

.smfs-vp-modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(8, 8, 10, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.smfs-vp-stage {
    position: relative;
    height: min(92dvh, 940px);
    aspect-ratio: 9 / 16;
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
    transform: scale(0.96);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    touch-action: pan-y;
}

.smfs-vp-modal.is-open .smfs-vp-stage {
    transform: scale(1);
}

/* Degradês no topo e na base: deixam barras, botões e cards legíveis
   sobre qualquer vídeo, inclusive os bem claros. */
.smfs-vp-stage::before,
.smfs-vp-stage::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    z-index: 4;
    pointer-events: none;
}

.smfs-vp-stage::before {
    top: 0;
    height: 130px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}

.smfs-vp-stage::after {
    bottom: 0;
    height: 45%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
}

/* Sem cards não faz sentido escurecer a base */
.smfs-vp-modal:not(.has-cards) .smfs-vp-stage::after {
    display: none;
}

/* Slides */

.smfs-vp-slides {
    position: absolute;
    inset: 0;
}

.smfs-vp-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.smfs-vp-slide.is-active {
    opacity: 1;
    visibility: visible;
}

/* Fundo desfocado para vídeos que não preenchem o quadro 9:16 */
.smfs-vp-slide-bg {
    position: absolute;
    inset: -8%;
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(0.5);
    transform: scale(1.1);
}

.smfs-vp-video {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    z-index: 1;
}

/* Spinner enquanto o vídeo carrega */
.smfs-vp-slide.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: smfs-vp-spin 0.8s linear infinite;
    z-index: 4;
}

@keyframes smfs-vp-spin {
    to { transform: rotate(360deg); }
}

/* Barras de progresso (stories) */

.smfs-vp-progress {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    z-index: 5;
}

.smfs-vp-bar {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.32);
    overflow: hidden;
}

.smfs-vp-bar-fill {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
    border-radius: 3px;
}

/* Controles */

.smfs-vp-topbar {
    position: absolute;
    top: 26px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 7;
}

.smfs-vp-ctrl {
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.smfs-vp-ctrl:hover,
.smfs-vp-ctrl:focus-visible {
    background: rgba(0, 0, 0, 0.68);
    transform: scale(1.06);
    outline: none;
}

/* Play/pause e som trocam de ícone conforme o estado */
.smfs-vp-icon-play,
.smfs-vp-modal.is-paused .smfs-vp-icon-pause,
.smfs-vp-icon-off,
.smfs-vp-modal.is-muted .smfs-vp-icon-on {
    display: none;
}

.smfs-vp-modal.is-paused .smfs-vp-icon-play,
.smfs-vp-modal.is-muted .smfs-vp-icon-off {
    display: block;
}

/* Setas laterais (desktop) */

.smfs-vp-nav {
    position: relative;
    z-index: 3;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.smfs-vp-nav:hover {
    background: rgba(255, 255, 255, 0.22);
}

.smfs-vp-nav[disabled] {
    opacity: 0;
    pointer-events: none;
}

/* Cards de produto */

.smfs-vp-cards {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 46%;
    overflow-y: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.smfs-vp-cards::-webkit-scrollbar {
    display: none;
}

.smfs-vp-cards:empty {
    display: none;
}

.smfs-vp-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(18, 18, 20, 0.62);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    color: #fff;
    transition: background 0.2s ease, transform 0.2s ease;
}

.smfs-vp-card:hover {
    background: rgba(28, 28, 32, 0.78);
    transform: translateY(-2px);
    color: #fff;
    text-decoration: none;
}

/* A área clicável do card (foto + textos). O botão de comprar fica fora dela
   porque link dentro de link é HTML inválido. */
.smfs-vp-card-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.smfs-vp-card-link:hover,
.smfs-vp-card-link:focus {
    text-decoration: none;
    color: inherit;
}

.smfs-vp-card-thumb {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    border-radius: 8px;
    object-fit: cover;
    background: #222;
}

.smfs-vp-card-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.smfs-vp-card-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.smfs-vp-card-price {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.3;
}

.smfs-vp-card-price del {
    opacity: 0.55;
    font-size: 11px;
    margin-right: 4px;
}

.smfs-vp-card-price ins {
    text-decoration: none;
    font-weight: 700;
}

.smfs-vp-card-price .woocommerce-Price-currencySymbol {
    font-size: 0.85em;
}

.smfs-vp-card-btn {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.smfs-vp-card-btn:hover {
    background: #e6e6e6;
    color: #111;
    text-decoration: none;
}

.smfs-vp-card-btn.loading {
    opacity: 0.65;
    pointer-events: none;
}

.smfs-vp-card-btn.added {
    background: #2dcb73;
    color: #fff;
}

/* Esconde o link "Ver carrinho" que o WooCommerce injeta depois do AJAX */
.smfs-vp-card .added_to_cart {
    display: none !important;
}

/* Aviso curto (ex: link copiado) */

.smfs-vp-toast {
    position: absolute;
    left: 50%;
    bottom: 50%;
    transform: translate(-50%, 50%);
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 999px;
    z-index: 8;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.smfs-vp-toast.is-visible {
    opacity: 1;
}

/* Trava o scroll do site enquanto o player está aberto */
body.smfs-vp-locked {
    overflow: hidden;
}

/* ── Responsivo ──────────────────────────────────────────── */

@media (max-width: 900px) {
    .smfs-vp-modal {
        gap: 0;
    }

    .smfs-vp-nav {
        display: none;
    }

    .smfs-vp-stage {
        width: 100%;
        height: 100%;
        height: 100dvh;
        aspect-ratio: auto;
        border-radius: 0;
    }

    .smfs-vp-video {
        object-fit: cover;
    }

    .smfs-vp-topbar {
        top: max(26px, env(safe-area-inset-top));
    }

    .smfs-vp-progress {
        top: max(12px, calc(env(safe-area-inset-top) - 14px));
    }

    .smfs-vp-cards {
        bottom: max(12px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 768px) {
    .smfs-vp-bubble {
        width: var(--smfs-vp-size-mobile);
        bottom: var(--smfs-vp-bottom-mobile);
    }

    .smfs-vp-pos-right { right: var(--smfs-vp-side-mobile); }
    .smfs-vp-pos-left  { left: var(--smfs-vp-side-mobile); }

    .smfs-vp-bubble-btn {
        width: var(--smfs-vp-size-mobile);
        height: var(--smfs-vp-size-mobile);
    }

    /* Sem hover no touch: o X fica sempre visível */
    .smfs-vp-bubble-close {
        opacity: 1;
        transform: scale(1);
    }

    .smfs-vp-no-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .smfs-vp-no-desktop {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .smfs-vp-bubble,
    .smfs-vp-bubble-btn,
    .smfs-vp-stage,
    .smfs-vp-card {
        transition: none;
    }

    .smfs-vp-bubble-ring {
        animation: none;
    }
}
