/* Floating video widget: templates/partials/video_widget.html.ep, public/js/video-widget.js */

.vw[hidden],
.vw-modal[hidden],
.vw-modal__play[hidden] {
    display: none !important;
}

/* Mini window */

.vw {
    position: fixed;
    left: 20px;
    bottom: 150px; /* выше кнопки «Записаться на занятие» на первом экране */
    z-index: 1030;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .4s ease-out, transform .4s ease-out;
}

.vw--shown {
    opacity: 1;
    transform: none;
}

.menu_open .vw {
    visibility: hidden;
}

.vw__mini {
    position: relative;
    width: 130px;
    height: 180px;
    border: 3px solid #fff;
    border-radius: 20px;
    background: #000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .2);
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s ease-out, box-shadow .2s ease-out;
}

.vw__mini:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}

.vw__mini:focus {
    outline: none;
}

.vw__mini:focus-visible {
    box-shadow: 0 0 0 3px #e8781a, 0 5px 15px rgba(0, 0, 0, .2);
}

.vw__mini-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 17px;
}

.vw__dismiss {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font: 18px/22px Arial, Helvetica, sans-serif;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .3s ease-out, background-color .2s ease-out;
}

.vw__mini:hover .vw__dismiss,
.vw__dismiss:focus {
    opacity: 1;
}

.vw__dismiss:hover {
    background: rgba(0, 0, 0, .6);
}

@media (hover: none) {
    .vw__dismiss {
        opacity: 1;
        width: 26px;
        height: 26px;
        line-height: 26px;
    }

    .vw__mini:hover {
        transform: none;
    }
}

/* Full screen player */

.vw-lock {
    overflow: hidden;
}

.vw-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .75);
}

.vw-modal__card {
    position: relative;
    height: 90vh;
    max-height: 860px;
    width: 50.625vh; /* 90vh * 9/16 */
    max-width: 483px;
    border-radius: 20px;
    background: #000;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.vw-modal__card:before,
.vw-modal__card:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
    pointer-events: none;
}

.vw-modal__card:before {
    top: 0;
    height: 120px;
    background: linear-gradient(rgba(0, 0, 0, .45), rgba(0, 0, 0, 0));
}

.vw-modal__card:after {
    bottom: 0;
    height: 140px;
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .5));
}

.vw-modal__video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.vw-modal__progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    height: 4px;
    background: rgba(255, 255, 255, .3);
}

.vw-modal__progress span {
    display: block;
    width: 0;
    height: 100%;
    background: #e8781a;
}

.vw-modal__time {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    color: #fff;
    font: 12px/1 Arial, Helvetica, sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}

.vw-modal__btn {
    position: absolute;
    right: 12px;
    z-index: 2;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font: 22px/30px Arial, Helvetica, sans-serif;
    text-align: center;
    cursor: pointer;
    transition: background-color .2s ease-out;
}

.vw-modal__btn:hover {
    background: rgba(0, 0, 0, .6);
}

.vw-modal__btn svg {
    display: block;
    margin: 7px;
}

.vw-modal__close {
    top: 36px;
}

.vw-modal__sound {
    top: 74px;
}

.vw-modal__sound .vw-icon-off,
.vw-modal__sound.is-muted .vw-icon-on {
    display: none;
}

.vw-modal__sound.is-muted .vw-icon-off {
    display: block;
}

.vw-modal__play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 72px;
    height: 72px;
    margin: -36px 0 0 -36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    cursor: pointer;
}

.vw-modal__play svg {
    display: block;
    margin: 20px 0 0 22px;
}

.vw-modal__cta,
.vw-modal__cta:visited {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 2;
    transform: translateX(-50%);
    padding: 14px 26px;
    border-radius: 999px;
    background: #e8781a;
    color: #fff;
    font: 15px/1.2 "CenturyGothic-Bold", Helvetica, Arial, sans-serif;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
    transition: background-color .2s ease-out;
}

.vw-modal__cta:hover,
.vw-modal__cta:focus {
    background: #d4680f;
    color: #fff;
    text-decoration: none;
}

.vw-modal button:focus {
    outline: none;
}

.vw-modal button:focus-visible,
.vw-modal__cta:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .vw {
        left: 12px;
        bottom: 12px;
    }

    .vw__mini {
        width: 96px;
        height: 136px;
        border-radius: 16px;
    }

    .vw__mini-video {
        border-radius: 13px;
    }

    .vw-modal__card {
        width: 100vw;
        max-width: none;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
    }

    .vw-modal__time {
        top: calc(14px + env(safe-area-inset-top, 0px));
    }

    .vw-modal__close {
        top: calc(36px + env(safe-area-inset-top, 0px));
    }

    .vw-modal__sound {
        top: calc(74px + env(safe-area-inset-top, 0px));
    }

    .vw-modal__cta,
    .vw-modal__cta:visited {
        bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .vw,
    .vw__mini,
    .vw__dismiss {
        transition: none;
    }

    .vw__mini:hover {
        transform: none;
    }
}
