/* Preview: doctor video visiting in #naprlav slot (?vizitka_napr=1)
   min-height on --with-video: absolute iframe must fit inside the box */

.spec-napr-box .napr-video {
    position: absolute;
    right: 40px;
    top: 40px;
    width: 368px;
    height: 271px;
    overflow: hidden;
    border-radius: 3px;
    background: #000;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.spec-napr-box .napr-video iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Reserve right slot + height for absolute video (top+h+bottom gap) */
.spec-napr-box.spec-napr-box--with-video {
    padding-right: 435px;
    position: relative;
    box-sizing: border-box;
    min-height: 351px; /* 40 + 271 + 40 */
}

@media only screen and (max-width: 1132px) {
    .spec-napr-box .napr-video {
        width: 264px;
        height: 194px;
        right: 15px;
        top: 15px;
    }

    .spec-napr-box.spec-napr-box--with-video {
        padding-right: 300px;
        min-height: 224px; /* 15 + 194 + 15 */
    }
}

@media only screen and (max-width: 850px) {
    .spec-napr-box .napr-video {
        position: static;
        width: 100%;
        max-width: 368px;
        height: auto;
        aspect-ratio: 368 / 271;
        margin: 16px auto 0;
    }

    .spec-napr-box.spec-napr-box--with-video {
        padding-right: 15px;
        text-align: center;
        min-height: 0;
    }
}

/* --- vizitka_napr=1|3: видео в правой колонке specpanel --- */
.specpanel .specpanel-video {
    position: relative;
    width: 32%;
    padding: 0 !important;
    border: 0;
    background: transparent;
    border-radius: 3px;
    overflow: visible;
    box-sizing: border-box;
    align-self: flex-start;
    scroll-margin-top: 100px;
}

/* Оглавление справа без видео: высота по пунктам, не растягивать на всю карточку */
.specpanel-inner > .regalii.soderzanie {
    align-self: flex-start;
    height: auto;
    max-height: none;
}

.specpanel-video__media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 3px;
    overflow: hidden;
}

.specpanel .specpanel-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    /* под постером сразу грузится плеер Rutube */
    opacity: 1;
    pointer-events: none;
    z-index: 1;
}

.specpanel .specpanel-video.is-playing iframe {
    pointer-events: auto;
}

.specpanel-video__poster {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    cursor: pointer;
    background: #1a1a1a;
    overflow: hidden;
}

.specpanel-video__poster img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.specpanel-video__play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #6094bc;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(45, 98, 139, 0.45);
    transition: background 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}

.specpanel-video__play svg {
    display: block;
    margin-left: 3px;
}

.specpanel-video__poster:hover .specpanel-video__play,
.specpanel-video__poster:focus .specpanel-video__play {
    background: #417298;
    transform: translate(-50%, -50%) scale(1.06);
}

.specpanel-video__poster:focus {
    outline: none;
}

.specpanel .specpanel-video.is-playing .specpanel-video__poster {
    display: none;
}

/* vizitka_napr=3: подпись над постером, как «Стаж работы» */
.specpanel .specpanel-video__caption {
    margin: 0 0 10px;
    padding: 0;
    font-weight: 500;
    color: #424242;
    line-height: 24px;
}

.specpanel .specpanel-video__caption .stazhinfo {
    display: inline-block;
    padding-left: 0;
    background: none;
    font-weight: inherit;
    color: inherit;
    line-height: inherit;
}

/* vizitka_napr=3: рейтинг под постером, foot — в колонке info */
.specpanel .specpanel-video > .rating {
    margin-top: 16px;
    width: 100%;
    box-sizing: border-box;
}

.specpanel .specpanel-video > .rating .rating__value .row {
    align-items: center;
}

.specpanel .specpanel-video > .rating .rating__value .val {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.specpanel-base > .specpanel-foot {
    width: 100%;
    margin-top: 16px;
    padding: 14px 16px;
    box-sizing: border-box;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.specpanel-base > .specpanel-foot .specpanel-goback {
    display: none !important;
}

.specpanel-base > .specpanel-foot .specpanel-foot-left {
    width: auto;
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}

/* цена: подпись сверху, сумма снизу — влезает рядом с кнопками */
.specpanel-base > .specpanel-foot .specpanel-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    margin: 0;
    font-size: 12px;
    line-height: 1.25;
    color: #707070;
    white-space: normal;
    text-align: left;
}

.specpanel-base > .specpanel-foot .specpanel-price span {
    font-size: 18px;
    font-weight: 600;
    color: #000;
    line-height: 1.2;
}

.specpanel-base > .specpanel-foot .appointment {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: auto;
    flex: 0 0 auto;
    margin-left: auto;
}

.specpanel-base > .specpanel-foot .appointment .btn {
    margin-right: 0;
    margin-bottom: 0;
    padding: 0 12px;
    flex: 0 0 auto;
    white-space: nowrap;
    box-sizing: border-box;
}

/* vizitka=3: узкая колонка / мобильный — цена сверху, кнопки на всю ширину */
@media only screen and (max-width: 900px) {
    .specpanel-base > .specpanel-foot {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 12px;
        padding: 14px 12px;
    }

    .specpanel-base > .specpanel-foot .specpanel-foot-left {
        width: 100%;
        justify-content: center;
    }

    .specpanel-base > .specpanel-foot .specpanel-price {
        align-items: center;
        text-align: center;
    }

    .specpanel-base > .specpanel-foot .appointment {
        width: 100%;
        margin-left: 0;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .specpanel-base > .specpanel-foot .appointment .btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 0 10px;
        text-align: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media only screen and (max-width: 1220px) {
    .specpanel .specpanel-video > .rating {
        max-width: 368px;
    }
}

@media only screen and (max-width: 767px) {
    .specpanel .specpanel-video > .rating {
        max-width: 100%;
    }

    .specpanel-base > .specpanel-foot {
        padding: 12px 0;
    }

    .specpanel-base > .specpanel-foot .appointment {
        flex-direction: column;
        align-items: stretch;
    }

    .specpanel-base > .specpanel-foot .appointment .btn {
        width: 100%;
        flex: 0 0 auto;
    }
}

/* --- vizitka_napr=1: якоря строкой под карточкой --- */
.regalii.soderzanie--row {
    width: 100%;
    margin: -20px 0 35px;   /* компенсация margin-bottom:35px у .specpanel */
    padding: 15px 20px !important;
    border: 0;
}

.regalii.soderzanie--row ul {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin: 0;
    padding: 0;
}

.regalii.soderzanie--row ul li {
    width: auto;
    flex: 0 1 auto;
    position: relative;
    padding-left: 16px;
    margin: 0;
}

@media only screen and (max-width: 1220px) {
    .specpanel .specpanel-video {
        width: 100%;
        max-width: 368px;
        margin: 0 0 20px;
    }
}

@media only screen and (max-width: 767px) {
    .specpanel .specpanel-video {
        max-width: 100%;
    }
    .regalii.soderzanie--row ul {
        gap: 10px 16px;
    }
    .regalii.soderzanie--row ul li {
        width: 100%;
    }
}

/* --- vizitka_napr=2: play на фото + модалка --- */
.specpanel-photo {
    position: relative;
}

.specpanel-photo__play {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #6094bc; /* фирменный .btn--blue */
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(45, 98, 139, 0.35);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.specpanel-photo__play:hover,
.specpanel-photo__play:focus {
    background: #417298;
    outline: none;
    transform: scale(1.06);
    box-shadow: 0 3px 10px rgba(45, 98, 139, 0.45);
}

.specpanel-photo__play svg {
    display: block;
    width: 24px;
    height: 24px;
    margin-left: 3px; /* оптический центр треугольника */
}

.yz-vizitka-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.yz-vizitka-modal[hidden] {
    display: none !important;
}

html.yz-vizitka-modal-open {
    overflow: hidden;
}

.yz-vizitka-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.yz-vizitka-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    background: #000;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.yz-vizitka-modal__close {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.yz-vizitka-modal__close:hover,
.yz-vizitka-modal__close:focus {
    background: rgba(0, 102, 179, 0.92);
    outline: none;
}

.yz-vizitka-modal__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.yz-vizitka-modal__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@media only screen and (max-width: 600px) {
    .specpanel-photo__play {
        width: 44px;
        height: 44px;
        top: 8px;
        right: 8px;
    }
    .specpanel-photo__play svg {
        width: 20px;
        height: 20px;
    }
    .yz-vizitka-modal {
        padding: 12px;
    }
}
