/* Мини-видео акции: угол + попап (inc/video-promo.php) */
.vp {
    --vp-w: 220px;
    --vp-blue: #183F82;
    --vp-orange: #F96A30;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1030; /* ниже шапки (1040) и мобильного меню (1050) */
    transform: translateY(calc(100% + 40px));
    opacity: 0;
    transition: transform .7s cubic-bezier(.34, 1.45, .5, 1), opacity .4s ease;
}
.vp[hidden] { display: none; }
.vp.is-on { transform: none; opacity: 1; }

.vp-stage { position: relative; width: var(--vp-w); aspect-ratio: 16 / 9; }

.vp-frame {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    position: absolute;
    inset: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #0b1630;
    border: 2px solid #fff;
    box-shadow: 0 10px 30px rgba(10, 25, 60, .35), 0 2px 6px rgba(10, 25, 60, .25);
    transition: transform .25s ease;
}
.vp-frame:hover { transform: translateY(-2px) scale(1.03); }
.vp-frame:focus-visible { outline: 3px solid var(--vp-orange); outline-offset: 3px; }
.vp-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* блик по стеклу */
.vp-frame::after {
    content: "";
    position: absolute;
    inset: -20% -60%;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, .75) 50%, rgba(255, 255, 255, 0) 58%, transparent 60%);
    transform: translateX(-100%);
}
.vp-frame.is-shine::after { animation: vp-shine 1.1s cubic-bezier(.45, 0, .2, 1); }
@keyframes vp-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.vp-canvas { position: absolute; left: -70px; top: -70px; pointer-events: none; z-index: 3; }

/* значок «Со звуком» */
.vp-sound {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px 3px 6px;
    border-radius: 99px;
    background: rgba(8, 18, 40, .72);
    color: #fff;
    font: 600 11px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    pointer-events: none;
}
.vp-sound svg { width: 14px; height: 14px; flex: none; }
.vp-sound.is-ping { animation: vp-ping .9s ease; }
@keyframes vp-ping { 30% { transform: scale(1.18); background: var(--vp-orange); } }

/* подсказка рядом с плеером (в каждом цикле с блёстками) */
.vp-hint {
    position: absolute;
    right: calc(100% + 12px);
    bottom: 14px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    padding: 9px 14px 9px 12px;
    border-radius: 12px;
    background: #fff;
    color: var(--vp-blue);
    font: 600 14px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 8px 26px rgba(10, 25, 60, .22);
    cursor: pointer;
    opacity: 0;
    transform: translateX(14px);
    pointer-events: none;
    transition: opacity .35s ease, transform .45s cubic-bezier(.34, 1.4, .5, 1);
}
.vp-hint::after {
    content: "";
    position: absolute;
    right: -6px;
    bottom: 16px;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    border-radius: 2px;
}
.vp-hint i { width: 8px; height: 8px; border-radius: 50%; background: var(--vp-orange); box-shadow: 0 0 0 3px rgba(249, 106, 48, .2); flex: none; }
.vp-hint b { color: var(--vp-orange); font-weight: 700; }
.vp-hint.is-on { opacity: 1; transform: none; pointer-events: auto; }

/* свернуть / свёрнуто */
.vp-close {
    all: unset;
    cursor: pointer;
    position: absolute;
    top: -9px;
    right: -9px;
    z-index: 5;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff;
    color: #334;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    font: 16px/1 system-ui, sans-serif;
    opacity: 0;
    transition: opacity .2s;
}
.vp:hover .vp-close, .vp-close:focus-visible { opacity: 1; }
.vp-close:focus-visible { outline: 2px solid var(--vp-orange); }
@media (hover: none) { .vp-close { opacity: 1; } }

.vp-mini {
    all: unset;
    cursor: pointer;
    display: none;
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    place-items: center;
    background: var(--vp-blue);
    color: #fff;
    box-shadow: 0 8px 22px rgba(10, 25, 60, .35);
}
.vp-mini svg { width: 26px; height: 26px; }
.vp-mini::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--vp-orange);
    border: 2px solid #fff;
}
.vp-mini:focus-visible { outline: 3px solid var(--vp-orange); outline-offset: 3px; }
.vp.is-min .vp-stage { display: none; }
.vp.is-min .vp-mini { display: grid; }

/* попап */
.vp-modal {
    border: 0;
    padding: 0;
    background: transparent;
    width: 100%;
    max-width: min(920px, calc(100vw - 32px));
    overflow: visible;
}
.vp-modal::backdrop { background: rgba(6, 14, 32, .78); }
.vp-modal[open] { animation: vp-modal-in .35s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes vp-modal-in { from { opacity: 0; transform: scale(.94) translateY(12px); } }
.vp-modal__box { background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.vp-modal video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.vp-modal__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; }
.vp-modal__foot p { margin: 0 auto 0 0; color: #2a3550; font-size: 17px; font-weight: 600; }
.vp-modal__foot small { display: block; color: #7a869c; font-size: 13px; font-weight: 400; }
.vp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
    transition: background-color .2s, color .2s;
}
.vp-btn--fill { background: var(--vp-orange, #F96A30); color: #fff; }
.vp-btn--fill:hover { background: #e85a20; color: #fff; }
.vp-btn--line { background: #fff; color: #183F82; box-shadow: inset 0 0 0 2px #183F82; }
.vp-btn--line:hover { background: #183F82; color: #fff; }
.vp-btn:focus-visible { outline: 3px solid #F96A30; outline-offset: 2px; }
.vp-modal__x {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    position: absolute;
    top: 0;
    right: -60px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(8, 18, 40, .55);
    border: 1px solid rgba(255, 255, 255, .35);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: background-color .25s, border-color .25s, transform .35s cubic-bezier(.34, 1.45, .5, 1);
}
.vp-modal__x svg { width: 20px; height: 20px; display: block; transition: transform .35s cubic-bezier(.34, 1.45, .5, 1); }
.vp-modal__x:hover { background: var(--vp-orange, #F96A30); border-color: var(--vp-orange, #F96A30); }
.vp-modal__x:hover svg { transform: rotate(90deg); }
.vp-modal__x:active { transform: scale(.92); }
.vp-modal__x:focus-visible { outline: 3px solid #F96A30; outline-offset: 3px; }
/* узкий экран: справа места нет — крестик над окном */
@media (max-width: 1060px) { .vp-modal__x { top: -58px; right: 0; } }

@media (max-width: 640px) {
    .vp { --vp-w: 150px; right: 12px; bottom: 16px; }
    .vp-sound { padding: 3px 5px; }
    .vp-sound span { display: none; }
    .vp-hint { right: 0; bottom: calc(100% + 12px); font-size: 13px; transform: translateY(10px); }
    .vp-hint::after { right: 24px; bottom: -6px; }
    .vp-hint.is-on { transform: none; }
    .vp-modal__foot { padding: 14px 16px; }
    .vp-modal__foot p { flex: 1 0 100%; }
    .vp-btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
    .vp { transition: opacity .3s; }
    .vp-frame, .vp-frame::after, .vp-sound { animation: none !important; transition: none; }
}
@media print { .vp, .vp-modal { display: none !important; } }
