.fvw-widget {
    position: fixed;
    bottom: 20px;
    width: 80px;
    height: 80px;
    z-index: 99999;
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    border: 3px solid #fff;
    background: #000;
}

/* Позиция через классы (не через inline style) */
.fvw-widget.fvw-pos-right { right: 20px; }
.fvw-widget.fvw-pos-left  { left: 20px; }

/* Скрытое состояние при загрузке */
.fvw-widget.fvw-hidden {
    transform: translateY(150px);
    opacity: 0;
    pointer-events: none;
}

/* --- Тултип --- */
.fvw-tooltip {
    position: absolute;
    bottom: 95px;
    right: 0;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: sans-serif;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    opacity: 1;
    transition: opacity 0.3s;
    pointer-events: none;
}
.fvw-pos-left .fvw-tooltip {
    right: auto;
    left: 0;
}
.fvw-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: transparent;
    display: block;
    width: 0;
}
.fvw-pos-left .fvw-tooltip::after {
    right: auto;
    left: 20px;
}
.fvw-widget.is-expanded .fvw-tooltip {
    opacity: 0;
}

/* --- Раскрытое состояние: размеры задаются через inline CSS из PHP --- */
.fvw-widget.is-expanded {
    border-radius: 20px;
    bottom: 20px;
    cursor: default;
}

.fvw-video-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: inherit;
}

.fvw-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    display: block;
}

/* --- Кнопки управления --- */
.fvw-close,
.fvw-mute-btn {
    position: absolute;
    top: 15px;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, background 0.2s;
    z-index: 10;
    border: none;
    padding: 0;
    line-height: 1;
    font-family: sans-serif;
}
.fvw-close:hover,
.fvw-mute-btn:hover {
    background: rgba(0,0,0,0.85);
}
.fvw-close {
    right: 15px;
    font-size: 22px;
}
.fvw-mute-btn {
    left: 15px;
}
.fvw-mute-btn svg {
    width: 16px;
    height: 16px;
}

.fvw-widget.is-expanded .fvw-close,
.fvw-widget.is-expanded .fvw-mute-btn {
    opacity: 1;
    pointer-events: auto;
}

/* --- CTA кнопка --- */
.fvw-cta {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-family: sans-serif;
    font-size: 15px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s 0.2s, filter 0.2s;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}
.fvw-cta:hover {
    filter: brightness(1.1);
}
.fvw-widget.is-expanded .fvw-cta {
    opacity: 1;
    pointer-events: auto;
}

/* --- Пульсация (свёрнутый виджет) --- */
.fvw-widget:not(.is-expanded)::after {
    content: '';
    position: absolute;
    top: -6px; left: -6px; right: -6px; bottom: -6px;
    border-radius: 50%;
    border: 2px solid transparent;
    animation: fvw-pulse 2s infinite;
    opacity: 0;
    z-index: -1;
}

@keyframes fvw-pulse {
    0%   { transform: scale(1);   opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* --- Мобильная адаптивность (горизонтальный режим) --- */
@media (max-width: 480px) {
    .fvw-widget.is-expanded {
        width: calc(100vw - 40px) !important;
        height: 70vh !important;
        left: 20px !important;
        right: 20px !important;
        bottom: 20px;
    }
}
