/* ═══════════════════════════════════════════
   FLOATING PRODUCT VIDEO — style.css
   Desktop: rectangle bubble
   Mobile:  reel-style (portrait 9:16 ratio)
═══════════════════════════════════════════ */

/* ── Bubble (Desktop: rectangle) ── */
#fpv-bubble {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 160px;
    height: 96px;           /* 16:9 rectangle */
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.40);
    border: 2.5px solid rgba(255, 255, 255, 0.85);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    background: #000;
}

#fpv-bubble:hover,
#fpv-bubble:focus-visible {
    transform: scale(1.06);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.50);
    outline: none;
}

#fpv-bubble video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    display: block;
}

/* Play icon overlay */
.fpv-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    transition: opacity 0.2s ease;
}

#fpv-bubble:hover .fpv-play-overlay,
#fpv-bubble:focus-visible .fpv-play-overlay {
    opacity: 1;
}

/* ── Position variants ── */
#fpv-bubble.bottom-left  { right: auto; left: 28px; }
#fpv-bubble.top-right    { bottom: auto; top: 28px; }
#fpv-bubble.top-left     { bottom: auto; top: 28px; right: auto; left: 28px; }


/* ─────────────────────────────────────────
   POPUP OVERLAY
───────────────────────────────────────── */

#fpv-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.80);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fpvFadeIn 0.2s ease;
}

#fpv-overlay.active {
    display: flex;
}

@keyframes fpvFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Popup box (Desktop: widescreen 16:9) ── */
#fpv-popup {
    position: relative;
    width: 100%;
    max-width: 680px;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.70);
    animation: fpvSlideUp 0.25s ease;
}

@keyframes fpvSlideUp {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Desktop popup: 16:9 aspect ratio enforced */
#fpv-popup video {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #000;
}

/* Close button */
#fpv-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.60);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease;
    padding: 0;
}

#fpv-close:hover {
    background: rgba(220, 30, 30, 0.80);
}

#fpv-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}


/* ═══════════════════════════════════════════
   MOBILE — Reel style (portrait / 9:16)
═══════════════════════════════════════════ */

@media (max-width: 600px) {

    /* Bubble: portrait reel thumbnail */
    #fpv-bubble {
        width: 72px;
        height: 110px;      /* ~9:14, reel feel */
        border-radius: 10px;
        bottom: 20px;
        right: 16px;
    }

    #fpv-bubble.bottom-left { right: auto; left: 16px; }
    #fpv-bubble.top-right   { bottom: auto; top: 20px; right: 16px; }
    #fpv-bubble.top-left    { bottom: auto; top: 20px; right: auto; left: 16px; }

    /* Always show play icon on mobile (no hover) */
    .fpv-play-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.22);
    }

    /* Popup overlay: full-screen reel */
    #fpv-overlay {
        padding: 0;
        align-items: flex-end;
        background: #000;
        backdrop-filter: none;
    }

    /* Popup: full-screen portrait (reel style) */
    #fpv-popup {
        width: 100%;
        max-width: 100%;
        height: 100svh;          /* full screen height */
        border-radius: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Video: 9:16 portrait fill */
    #fpv-popup video {
        width: 100%;
        height: 100%;
        aspect-ratio: unset;
        object-fit: cover;       /* fills screen like a reel */
    }

    /* Close button: top-right, bigger tap target */
    #fpv-close {
        top: 16px;
        right: 16px;
        width: 42px;
        height: 42px;
        background: rgba(0, 0, 0, 0.55);
    }
}
