/* ========================================================
   24/7 ВИДЕОПЛЕЕР - СТИЛИ
   ======================================================== */

/* ----- ОСНОВНОЙ КОНТЕЙНЕР ----- */
.c247v-video-player {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: #000;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 200px;
}

/* ----- КОГДА БЛОК СКРЫТ (ОШИБКА) ----- */
.c247v-video-player.hidden {
    display: none !important;
}

/* ----- ВИДЕО ----- */
.c247v-video-player .c247v-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: 0;
}

.c247v-video-player .c247v-video.visible {
    opacity: 1;
}

/* Скрываем стандартные элементы управления */
.c247v-video-player .c247v-video:not([controls])::-webkit-media-controls {
    display: none !important;
}
.c247v-video-player .c247v-video:not([controls])::-webkit-media-controls-panel {
    display: none !important;
}
.c247v-video-player .c247v-video:not([controls])::-webkit-media-controls-enclosure {
    display: none !important;
}
.c247v-video-player .c247v-video:not([controls])::-moz-media-controls {
    display: none !important;
}

/* ----- ПОСТЕР ----- */
.c247v-video-player .c247v-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 1;
    transition: opacity 0.5s ease;
    display: none;
}

/* ----- ПРЕЛОАДЕР ----- */
.c247v-video-player .c247v-preloader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
}

.c247v-video-player .c247v-preloader-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

/* ----- СПИННЕР ----- */
.c247v-video-player .c247v-spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: c247v-spin 1s linear infinite;
    display: none;
}

@keyframes c247v-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ----- ПРОГРЕСС-БАР ----- */
.c247v-video-player .c247v-progress-bar-container {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.c247v-video-player .c247v-progress-bar {
    width: 0%;
    height: 100%;
    background: #FFFFFF;
    border-radius: 2px;
    animation: c247v-progress 1.5s ease-in-out infinite;
}

@keyframes c247v-progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* ----- ЛОГОТИП-ЗАГРУЗКА ----- */
.c247v-video-player .c247v-logo-loader {
    display: none;
    max-width: 100px;
    max-height: 100px;
    animation: c247v-pulse 1.5s ease-in-out infinite;
}

@keyframes c247v-pulse {
    0% { opacity: 0.6; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0.6; transform: scale(0.98); }
}

/* ----- СООБЩЕНИЕ ОБ ОШИБКЕ ----- */
.c247v-video-player .c247v-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    font-size: 24px;
    line-height: 1.5;
}

/* ----- НАЛОЖЕНИЕ ВРЕМЕНИ ----- */
.c247v-time-overlay {
    position: absolute;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.5);
    padding: 12px 24px;
    pointer-events: none;
    z-index: 1000;
    user-select: none;
    backdrop-filter: blur(4px);
    transition: opacity 0.5s ease;
    opacity: 1;
}

/* ----- АДАПТИВ ----- */
@media (max-width: 768px) {
    .c247v-time-overlay {
        padding: 8px 16px !important;
    }
    .c247v-video-player .c247v-error {
        font-size: 18px !important;
        padding: 15px !important;
    }
    .c247v-video-player .c247v-progress-bar-container {
        width: 150px;
    }
    .c247v-video-player .c247v-logo-loader {
        max-width: 80px;
        max-height: 80px;
    }
}

@media (max-width: 480px) {
    .c247v-time-overlay {
        padding: 6px 12px !important;
    }
    .c247v-video-player .c247v-error {
        font-size: 16px !important;
        padding: 12px !important;
    }
    .c247v-video-player .c247v-progress-bar-container {
        width: 120px;
    }
    .c247v-video-player .c247v-logo-loader {
        max-width: 60px;
        max-height: 60px;
    }
}

/* ----- ПОДДЕРЖКА СТАРЫХ БРАУЗЕРОВ ----- */
@supports not (aspect-ratio: 16 / 9) {
    .c247v-video-player {
        height: 0;
        padding-bottom: 56.25%;
    }
    .c247v-video-player .c247v-video,
    .c247v-video-player .c247v-poster,
    .c247v-video-player .c247v-preloader,
    .c247v-video-player .c247v-error {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* ========================================================
   ПОДДЕРЖКА ELEMENTOR
   ======================================================== */

.c247v-elementor-wrapper {
    width: 100%;
    max-width: 100%;
}

.c247v-elementor-wrapper .c247v-video-player {
    width: 100%;
    max-width: 100%;
    background: #000;
    position: relative;
    overflow: hidden;
}

.elementor-editor-active .c247v-video-player .c247v-video {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.elementor-editor-active .c247v-video-player .c247v-poster {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
}

.elementor-editor-active .c247v-video-player .c247v-preloader {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    display: flex;
}

/* ========================================================
   КНОПКИ И ССЫЛКИ ЛАЙТБОКСА
   ======================================================== */

/* ----- КНОПКИ ----- */
.c247v-lightbox-button {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
    font-family: inherit;
}

.c247v-lightbox-button:hover {
    transform: translateY(-2px);
    text-decoration: none;
    opacity: 0.9;
}

.c247v-lightbox-button:active {
    transform: translateY(0);
}

.c247v-button-icon {
    margin-right: 6px;
}

/* Стили кнопок */
.c247v-button-primary {
    background: #007cba;
    color: #fff;
}
.c247v-button-primary:hover {
    background: #005a87;
    color: #fff;
}

.c247v-button-secondary {
    background: #6c757d;
    color: #fff;
}
.c247v-button-secondary:hover {
    background: #5a6268;
    color: #fff;
}

.c247v-button-success {
    background: #28a745;
    color: #fff;
}
.c247v-button-success:hover {
    background: #1e7e34;
    color: #fff;
}

.c247v-button-danger {
    background: #dc3545;
    color: #fff;
}
.c247v-button-danger:hover {
    background: #bd2130;
    color: #fff;
}

.c247v-button-warning {
    background: #ffc107;
    color: #212529;
}
.c247v-button-warning:hover {
    background: #e0a800;
    color: #212529;
}

/* Размеры кнопок */
.c247v-button-small {
    padding: 8px 20px;
    font-size: 14px;
}

.c247v-button-medium {
    padding: 12px 30px;
    font-size: 16px;
}

.c247v-button-large {
    padding: 16px 40px;
    font-size: 20px;
}

/*  ССЫЛКИ */
.c247v-lightbox-link {
    color: #007cba;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.3s ease;
}

.c247v-lightbox-link:hover {
    color: #005a87;
}

.c247v-link-icon {
    margin-right: 6px;
}

/* ============================================================
   СТИЛИ ДЛЯ FANCYBOX
   ============================================================ */

/* Убираем дублирующуюся кнопку закрытия внутри видео */
.fancybox-slide--html .c247v-video-player .fancybox-close-small {
    display: none !important;
}

/* Переопределяем контейнер видео в лайтбоксе - минимальные стили */
.fancybox-slide--html .c247v-video-player {
    background: #000 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
    max-width: 90vw !important;
    max-height: 85vh !important;
}

.fancybox-slide--html .c247v-video-player .c247v-video {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    opacity: 1 !important;
    background: #000 !important;
    position: relative !important;
}

/* Контент лайтбокса */
.fancybox-slide--html .fancybox-content {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Центрирование слайда */
.fancybox-slide--html {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

/* Отключаем закрытие по клику на фон */
.fancybox-bg {
    pointer-events: none !important;
    cursor: default !important;
}

/* Но кнопка закрытия должна работать */
.fancybox-button--close {
    pointer-events: auto !important;
    z-index: 9999 !important;
}

/* Инфобар */
.fancybox-infobar {
    background: rgba(0, 0, 0, 0.5) !important;
    border-radius: 20px !important;
    padding: 4px 14px !important;
    font-size: 13px !important;
    color: #fff !important;
    margin: 10px !important;
    position: fixed !important;
    top: 10px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 9999 !important;
    pointer-events: none !important;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .fancybox-slide--html .c247v-video-player {
        max-width: 98vw !important;
        max-height: 92vh !important;
        border-radius: 0 !important;
    }
}
@media (max-width: 480px) {
    .fancybox-slide--html .c247v-video-player {
        max-width: 100vw !important;
        max-height: 95vh !important;
        border-radius: 0 !important;
    }
}

/* Убираем курсор-руку (grab) в модальном окне */
.fancybox-slide--html .c247v-video-player,
.fancybox-slide--html .c247v-video-player .c247v-video,
.fancybox-slide--html .c247v-video-player video {
    cursor: default !important;
}

/* Отключаем курсор grab для всего контента слайда */
.fancybox-slide--html .fancybox-content {
    cursor: default !important;
}

/* Для всех элементов внутри плеера - курсор по умолчанию */
.fancybox-slide--html .c247v-video-player * {
    cursor: default !important;
}

/* Но для кнопок управления видео оставляем pointer */
.fancybox-slide--html .c247v-video-player video::-webkit-media-controls-play-button,
.fancybox-slide--html .c247v-video-player video::-webkit-media-controls-volume-slider,
.fancybox-slide--html .c247v-video-player video::-webkit-media-controls-mute-button,
.fancybox-slide--html .c247v-video-player video::-webkit-media-controls-fullscreen-button {
    cursor: pointer !important;
}

/* ============================================================
   СТИЛИ ДЛЯ MAGNIFIC POPUP
   ============================================================ */

/* Базовые стили для Magnific */
.mfp-content .c247v-video-player {
    width: auto !important;
    height: auto !important;
    max-width: 90vw !important;
    max-height: 85vh !important;
    background: #000 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: none !important;
}

.mfp-content .c247v-video-player .c247v-video {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    background: #000 !important;
    opacity: 1 !important;
    transition: none !important;
}

/* Контейнер Magnific */
.mfp-container {
    padding: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.mfp-content {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    margin: 0 auto !important;
}

/* Кнопка закрытия */
.mfp-close {
    color: #fff !important;
    opacity: 0.8 !important;
    transition: opacity 0.3s ease !important;
    font-size: 28px !important;
    right: 10px !important;
    top: 10px !important;
    position: fixed !important;
    z-index: 9999 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
    text-align: center !important;
}

.mfp-close:hover {
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.8) !important;
}

/* Анимация появления */
.mfp-fade.mfp-bg {
    opacity: 0;
    transition: all 0.3s ease-out;
}

.mfp-fade.mfp-bg.mfp-ready {
    opacity: 1;
}

.mfp-fade.mfp-bg.mfp-removing {
    opacity: 0;
}

.mfp-fade.mfp-wrap .mfp-content {
    opacity: 0;
    transition: all 0.3s ease-out;
}

.mfp-fade.mfp-wrap.mfp-ready .mfp-content {
    opacity: 1;
}

.mfp-fade.mfp-wrap.mfp-removing .mfp-content {
    opacity: 0;
}

/* Убираем курсор-руку */
.mfp-content * {
    cursor: default !important;
}

.mfp-content .c247v-video-player video {
    cursor: default !important;
}

.mfp-close {
    cursor: pointer !important;
}

/* Отключаем анимации для плавного ресайза */
.mfp-content .c247v-video-player,
.mfp-content .c247v-video-player * {
    transition: none !important;
    -webkit-transition: none !important;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .mfp-content .c247v-video-player {
        max-width: 98vw !important;
        max-height: 92vh !important;
        border-radius: 0 !important;
    }
    
    .mfp-content {
        max-width: 100vw !important;
        max-height: 95vh !important;
    }
    
    .mfp-close {
        font-size: 24px !important;
        width: 36px !important;
        height: 36px !important;
        line-height: 36px !important;
        right: 5px !important;
        top: 5px !important;
    }
}

@media (max-width: 480px) {
    .mfp-content .c247v-video-player {
        max-width: 100vw !important;
        max-height: 95vh !important;
        border-radius: 0 !important;
    }
}
