/* dr_store 30.09.2026: стили, нужные только после действия посетителя (окно заявки, выпадающий
   список трейд-ина, окно «Защита устройства»). Грузятся скриптами adw-request.js, adw-select.js и
   шаблоном окна защиты, чтобы не утяжелять общий файл на первом экране. */

/* Поп-ап «Оставьте заявку» (catalog/view/javascript/adw-request.js), макет 120:241 */
/* 01.10.2026: блокируем прокрутку на body, а не на html. У темы html и body высотой 100%, и при
   overflow: hidden на html прокручиваемым становился body высотой в экран - страница под окном
   прыгала в самый верх. Так же блокирует тема (.is-cart-open body). */
html.adw-request-lock body {
    overflow: hidden;
}

.adw-request {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.adw-request[hidden] {
    display: none;
}

.adw-request__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.adw-request__card {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 32px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 40px 40px 30px;
    border-radius: 30px;
    background: #fff;
    text-align: center;
}

.adw-request__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: none;
    color: #a4a4a4;
    cursor: pointer;
    transition: color 0.2s;
}

.adw-request__close:hover {
    color: #333;
}

.adw-request__title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.15;
    color: #333;
}

.adw-request__subtitle {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #a4a4a4;
}

.adw-request__subject {
    margin: 2px 0 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-link);
}

.adw-request__subject[hidden] {
    display: none;
}

.adw-request__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
    text-align: left;
}

.adw-request__input {
    width: 100%;
    height: 60px;
    padding: 0 25px;
    border: 2px solid #ececec;
    border-radius: 30px;
    background: #fff;
    font-size: 16px;
    color: #333;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s;
}

.adw-request__input:focus {
    border-color: var(--color-button);
}

.adw-request__input::placeholder {
    color: #a4a4a4;
}

.adw-request__button {
    height: 60px;
    border: 0;
    border-radius: 30px;
    background: var(--color-button);
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.adw-request__button:hover {
    background: #86ad26;
}

.adw-request__button:disabled {
    opacity: 0.6;
    cursor: default;
}

.adw-request__agree {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 4px 0 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: #a4a4a4;
    cursor: pointer;
}

.adw-request__agree input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.adw-request__check {
    position: relative;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin-top: 1px;
    border: 1px solid #a4a4a4;
    border-radius: 3px;
}

.adw-request__agree input:checked + .adw-request__check {
    border-color: var(--color-button);
    background: var(--color-button);
}

.adw-request__agree input:checked + .adw-request__check::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.adw-request__agree input:focus-visible + .adw-request__check {
    outline: 2px solid var(--color-button);
    outline-offset: 2px;
}

.adw-request__agree-text {
    text-wrap: balance;
}

.adw-request__agree a {
    color: var(--color-link);
    text-decoration: underline;
}

.adw-request__agree a:hover {
    text-decoration: none;
}

@media (max-width: 575px) {
    .adw-request__card {
        padding: 30px 20px 22px;
        border-radius: 24px;
    }

    .adw-request__title {
        font-size: 24px;
    }

    .adw-request__subtitle {
        font-size: 14px;
    }

    .adw-request__input,
    .adw-request__button {
        height: 52px;
    }

    .adw-request__button {
        font-size: 16px;
    }
}

/* Выпадающий список в стилистике калькуляторов вместо системного (adw-select.js) */
.adw-select {
    position: relative;
}

.adw-select__native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.adw-select__button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 50px;
    padding: 12px 20px;
    border: 0;
    border-radius: 25px;
    background: #fff;
    box-shadow: 0 0 20px 2px rgba(125, 125, 125, 0.2);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    color: #333;
    text-align: left;
    cursor: pointer;
}

.adw-select.is-empty .adw-select__value {
    color: #737373;
}

.adw-select__arrow {
    flex: 0 0 10px;
    transition: transform 0.2s;
}

.adw-select.is-open .adw-select__arrow {
    transform: rotate(180deg);
}

.adw-select__list {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    margin: 0;
    padding: 12px 0;
    list-style: none;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 0 20px 2px rgba(125, 125, 125, 0.2);
}

.adw-select__list[hidden] {
    display: none;
}

.adw-select__option {
    padding: 7px 20px;
    font-size: 15px;
    line-height: 1.35;
    color: #737373;
    cursor: pointer;
    transition: color 0.2s;
}

.adw-select__option:hover {
    color: var(--color-link);
}

.adw-select__option.is-active {
    color: var(--color-button);
}

/* Окно защиты из карточки (макет 420:196): сроки кнопками, цена, «Добавить» */
.adw-protect-offer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
}

.adw-protect-offer__terms {
    display: flex;
    gap: 14px;
}

.adw-protect-offer__term {
    flex: 1 1 0;
    height: 44px;
    padding: 0 20px;
    border: 1px solid #d9d9d9;
    border-radius: 30px;
    background: #fff;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.adw-protect-offer__terms .adw-protect-offer__term:only-child {
    cursor: default;
}

.adw-protect-offer__term.is-active:not(:only-child) {
    border-color: #d9d9d9;
    background: #d9d9d9;
}

.adw-protect-offer__price {
    min-width: 140px;
    padding: 11px 24px;
    border-radius: 30px;
    background: var(--color-button);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    white-space: nowrap;
}

.adw-protect-offer__add {
    height: 44px;
    padding: 0 26px;
    border: 1px solid var(--color-button);
    border-radius: 30px;
    background: #fff;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-link);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.adw-protect-offer__add:hover {
    background: var(--color-button);
    color: #fff;
}

@media (max-width: 767px) {
    .adw-protect-offer {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .adw-protect-offer__terms {
        grid-column: 1 / -1;
    }

    .adw-protect-offer__price,
    .adw-protect-offer__add {
        min-width: 0;
        height: 44px;
        padding: 0 12px;
        display: grid;
        place-items: center;
    }

    /* Окно защиты на телефоне - как у cmstore: полисы карточками в ряд с прокруткой пальцем,
       преимущества компактной сеткой 2 x 2 */
    .adw-protect-popup .adw-protect-list {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 4px 16px 16px;
        margin: 0 -16px;
        -webkit-overflow-scrolling: touch;
    }

    .adw-protect-popup .adw-protect-list > .info-section {
        flex: 0 0 86%;
        scroll-snap-align: center;
        margin: 0;
    }

    .adw-protect-popup .adw-protect-list .info-section__content {
        height: 100%;
        padding: 18px 16px;
        display: flex;
        flex-direction: column;
    }

    .adw-protect-popup .adw-protect-list .adw-protect-offer {
        margin-top: auto;
        padding-top: 14px;
    }

    .adw-protect-popup .adw-protect-list .title {
        font-size: 18px;
    }

    .adw-protect-popup .list-icon__value,
    .adw-protect-popup .list-icon__value *,
    .adw-protect-popup .info-section__content-strong {
        font-size: 13px;
        line-height: 1.35;
    }

    .adw-protect-popup .info-section__list-icon {
        gap: 8px;
    }

    .adw-protect-popup .adw-protect-list > .info-section > .container,
    .adw-protect-popup .adw-protect-list .info-section__block {
        height: 100%;
    }

    .adw-protect-popup .info-section_middle .title {
        font-size: 20px;
    }

    .adw-protect-popup .advantages-wrapper .advantages {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .adw-protect-popup .advantages-wrapper .advantages__item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }

    .adw-protect-popup .advantages-wrapper .advantage__icon {
        width: 36px;
        min-width: 36px;
        padding: 6px;
    }

    .adw-protect-popup .advantages-wrapper .advantage__title {
        font-size: 14px;
    }

    .adw-protect-popup .advantages-wrapper .advantage__desc {
        font-size: 11px;
    }
}

/* 01.10.2026 Окно защиты на телефоне в формате cmstore (п.146): окно выезжает снизу с просветом сверху,
   шапка «Защита устройства», карусель коротких карточек программ, преимущества 2 x 2, риски и сроки
   выбранной программы, внизу одна кнопка «Оформить за … ₽». Разметку перестраивает скрипт окна. */
@media (max-width: 767px) {
    .adw-protect-fancybox .fancybox-slide--html {
        padding: 12vh 0 0;
    }

    /* у темы на всех окнах .popup поля и скругление с !important - перекрываем так же */
    .adw-protect-fancybox .adw-protect-popup.adw-pm {
        width: 100%;
        max-width: 100%;
        min-height: 88vh;
        margin: 0;
        padding: 0 16px !important;
        border-radius: 20px 20px 0 0 !important;
        vertical-align: bottom;
        text-align: left;
    }

    .adw-pm .info-section_middle,
    .adw-pm .adw-protect-list {
        display: none;
    }

    .adw-pm__head {
        margin: 0 -16px 16px;
        padding: 20px 56px 16px 16px;
        border-bottom: 1px solid #e5e5e5;
        font-size: 20px;
        font-weight: 700;
        line-height: 1.2;
        color: #333;
    }

    .adw-pm__cards {
        display: flex;
        gap: 10px;
        margin: 0 -16px;
        padding: 2px 16px 4px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .adw-pm__cards::-webkit-scrollbar {
        display: none;
    }

    .adw-pm__card {
        flex: 0 0 78%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 14px 16px;
        border: 2px solid transparent;
        border-radius: 16px;
        background: #f2f2f2;
        color: #333;
        text-align: left;
        scroll-snap-align: center;
        cursor: pointer;
    }

    .adw-pm__card.is-active {
        border-color: #333;
        background: #fff;
    }

    .adw-pm__name {
        font-size: 16px;
        font-weight: 700;
        line-height: 1.25;
    }

    .adw-pm__desc {
        font-size: 13px;
        font-weight: 400;
        line-height: 1.35;
        color: #a4a4a4;
    }

    .adw-pm__price {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: auto;
        padding-top: 6px;
        font-size: 16px;
        font-weight: 700;
    }

    .adw-pm__check {
        display: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #333;
        position: relative;
    }

    .adw-pm__check::after {
        content: '';
        position: absolute;
        left: 7px;
        top: 4px;
        width: 5px;
        height: 9px;
        border: solid #fff;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }

    .adw-pm__card.is-active .adw-pm__check {
        display: inline-block;
    }

    .adw-pm__dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin: 10px 0 16px;
    }

    .adw-pm__dot {
        width: 18px;
        height: 3px;
        border-radius: 2px;
        background: #d9d9d9;
    }

    .adw-pm__dot.is-active {
        background: #333;
    }

    .adw-pm .advantages-wrapper {
        margin: 0 0 20px;
        padding: 0;
    }

    .adw-pm__subtitle {
        display: block;
        margin-bottom: 12px;
        font-size: 17px;
        font-weight: 700;
        color: #333;
    }

    .adw-pm__pane {
        display: none;
    }

    .adw-pm__pane.is-active {
        display: block;
    }

    .adw-pm__pane .info-section__list-icon {
        gap: 10px;
    }

    .adw-pm__pane .adw-protect-offer {
        display: block;
        margin-top: 16px;
    }

    .adw-pm__pane .adw-protect-offer__price,
    .adw-pm__pane .adw-protect-offer__add,
    .adw-pm__pane .info-section__footer-button {
        display: none;
    }

    .adw-pm__bar {
        position: sticky;
        bottom: 0;
        z-index: 2;
        margin: 16px -16px 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: #fff;
        box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.06);
    }

    .adw-pm__bar[hidden] {
        display: none;
    }

    .adw-pm__buy {
        width: 100%;
        height: 50px;
        border: 0;
        border-radius: 30px;
        background: #333;
        font-size: 16px;
        font-weight: 500;
        color: #fff;
        cursor: pointer;
    }
}

/* Окно защиты на телефоне: кнопка чата не ложится на «Оформить за … ₽», пока окно открыто */
@media (max-width: 767px) {
    body.fancybox-active jdiv {
        display: none !important;
    }
}

/* Окно защиты: панель fancybox (лупа и второй крестик) не нужна - у окна свой крестик.
   Параметр toolbar: false тема не учитывает, прячем стилем. */
.adw-protect-fancybox .fancybox-toolbar,
.adw-protect-fancybox .fancybox-navigation,
.adw-protect-fancybox .fancybox-infobar {
    display: none !important;
}
