/* Форма оформления подписки (#twcSub). 13.11.2026 */

html.twc-sub-open,
html.twc-sub-open body {
    overflow: hidden;
}

.twc-sub[hidden],
.twc-sub [hidden],
.twc-sub-post[hidden] {
    display: none !important;
}

.twc-sub {
    position: fixed;
    inset: 0;
    z-index: 1000; /* шапка сайта — 801, плашка cookie — 999 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: text-font, Helvetica, Arial, sans-serif;
    color: #000;
    -webkit-text-size-adjust: 100%;
}

.twc-sub__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}

.twc-sub__dialog {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 520px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 28px 0 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.twc-sub__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 32px;
    line-height: 44px;
    color: #000;
    cursor: pointer;
}

.twc-sub__close:hover {
    background: #f1f1f1;
}

.twc-sub__title {
    margin: 0 80px 6px 36px;
    font-family: CeraPro-Medium, text-font, Helvetica, Arial, sans-serif;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 500;
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
    color: #000;
}

.twc-sub__lead {
    margin: 0 36px 14px;
    font-size: 15px;
    line-height: 1.4;
    color: #555;
    text-align: left;
}

.twc-sub__form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    text-align: left;
}

/* поля прокручиваются, согласие и кнопка всегда на виду */
.twc-sub__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 36px 4px;
}

.twc-sub__footer {
    flex: 0 0 auto;
    padding: 14px 36px 20px;
    border-top: 1px solid #ececec;
    background: #fff;
}

.twc-sub__step {
    min-width: 0;
    margin: 0 0 22px;
    padding: 0;
    border: 0;
}

.twc-sub__step legend {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    font-family: CeraPro-Medium, text-font, Helvetica, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.2;
    color: #000;
}

.twc-sub__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fc0;
    font-size: 14px;
}

.twc-sub__field {
    min-width: 0;
    margin: 0 0 14px;
}

.twc-sub__field > label,
.twc-sub__label {
    display: block;
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 400;
    color: #333;
}

.twc-sub input[type=text],
.twc-sub input[type=tel],
.twc-sub input[type=email] {
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    font-family: inherit;
    font-size: 16px; /* меньше 16px — iPhone приближает страницу при вводе */
    line-height: 1.2;
    color: #000;
    text-align: left;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.twc-sub input::placeholder {
    color: #9a9a9a;
    opacity: 1;
}

.twc-sub input[type=text]:focus,
.twc-sub input[type=tel]:focus,
.twc-sub input[type=email]:focus,
.twc-sub .bx-sls.bx-focus .dropdown-block,
.twc-sub .bx-sls .dropdown-block:focus-within {
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(255, 204, 0, .55);
}

.twc-sub__field.is-error input[type=text],
.twc-sub__field.is-error input[type=tel],
.twc-sub__field.is-error input[type=email],
.twc-sub__field.is-error .bx-sls .dropdown-block {
    border-color: #d92d20;
}

.twc-sub__error {
    display: none;
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.3;
    color: #d92d20;
    text-align: left;
}

.twc-sub__field.is-error > .twc-sub__error {
    display: block;
}

.twc-sub__hint {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #777;
    text-align: left;
}

/* телефон: код страны + номер */
.twc-sub .twc-sub__phone {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin: 0;
    padding: 0;
}

.twc-sub .twc-sub__phone .nice-select,
.twc-sub .twc-sub__phone select {
    flex: 0 0 104px;
    box-sizing: border-box;
    width: 104px;
    min-width: 0;
    height: 52px !important;
    margin: 0 !important;
    padding: 0 28px 0 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background-color: #fff !important;
    font-size: 16px;
    line-height: 50px !important;
    text-align: left;
    float: none;
}

.twc-sub .twc-sub__phone .nice-select .current {
    line-height: 50px;
}

.twc-sub .twc-sub__phone input {
    margin: 0;
}

.twc-sub__phone .nice-select .list {
    max-height: 240px;
    overflow-y: auto;
}

.twc-sub__phone input {
    flex: 1 1 auto;
    min-width: 0;
}

/* город (компонент Битрикса sale.location.selector.search) */
.twc-sub .bx-sls {
    width: 100%;
    margin: 0;
}

.twc-sub .bx-sls .dropdown-block {
    box-sizing: border-box;
    height: 52px;
    min-height: 52px;
    margin: 0;
    padding: 0 40px 0 36px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
}

.twc-sub .bx-sls .dropdown-block input[type=text] {
    height: 50px;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.twc-sub .bx-sls .dropdown-fade2white {
    display: none;
}

/* способы доставки */
.twc-sub__methods {
    display: grid;
    gap: 8px;
}

.twc-sub__method {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.twc-sub__method input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.twc-sub__method-body {
    display: block;
    padding: 12px 16px 12px 48px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    transition: border-color .15s, background-color .15s;
}

.twc-sub__method-body::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    box-sizing: border-box;
    border: 2px solid #b5b5b5;
    border-radius: 50%;
    background: #fff;
}

.twc-sub__method:hover .twc-sub__method-body {
    border-color: #000;
}

.twc-sub__method input:checked + .twc-sub__method-body {
    border-color: #000;
    background: #fff8d6;
}

.twc-sub__method input:checked + .twc-sub__method-body::before {
    border: 6px solid #000;
}

.twc-sub__method input:focus-visible + .twc-sub__method-body {
    box-shadow: 0 0 0 3px rgba(255, 204, 0, .55);
}

.twc-sub__method-title {
    display: block;
    font-size: 16px;
    line-height: 1.25;
    color: #000;
}

.twc-sub__method-hint {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.3;
    color: #777;
}

/* пункт выдачи */
.twc-sub__point {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border: 1px dashed #b5b5b5;
    border-radius: 8px;
}

.twc-sub__field.is-error .twc-sub__point {
    border-color: #d92d20;
}

.twc-sub__point-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.35;
    color: #777;
    text-align: left;
}

.twc-sub__point-text.is-chosen {
    color: #000;
}

.twc-sub__link {
    flex: 0 0 auto;
    padding: 8px 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.2;
    color: #000;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.twc-sub__map {
    margin-top: 10px;
}

.twc-sub__map-inner {
    position: relative;
    height: 440px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    overflow: hidden;
}

.twc-sub__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}

/* согласие */
.twc-sub__agree {
    margin-bottom: 12px;
}

.twc-sub .twc-sub__check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #000;
    cursor: pointer;
}

.twc-sub__check input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.twc-sub .twc-sub__box {
    display: block;
    flex: 0 0 24px;
    box-sizing: border-box;
    width: 24px;
    min-width: 24px;
    height: 24px;
    margin: -2px 0 0;
    padding: 0;
    border: 2px solid #8a8a8a;
    border-radius: 6px;
    background: #fff center / 16px no-repeat;
}

.twc-sub__check input:checked + .twc-sub__box {
    border-color: #000;
    background-color: #fc0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.twc-sub__check input:focus-visible + .twc-sub__box {
    box-shadow: 0 0 0 3px rgba(255, 204, 0, .55);
}

.twc-sub__agree.is-error .twc-sub__box {
    border-color: #d92d20;
}

.twc-sub__check a {
    color: #000;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.twc-sub__form-error {
    margin: 0 0 14px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #fdecea;
    font-size: 14px;
    line-height: 1.4;
    color: #8a1c13;
    text-align: left;
}

.twc-sub__form-error a {
    color: inherit;
    text-decoration: underline;
}

.twc-sub__submit {
    display: block;
    width: 100%;
    min-height: 56px;
    margin: 0;
    padding: 0 20px;
    border: 0;
    border-radius: 8px;
    background: #fc0;
    font-family: CeraPro-Medium, text-font, Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    color: #000;
    cursor: pointer;
    transition: background-color .15s;
}

.twc-sub__submit:hover {
    background: #ffd633;
}

.twc-sub__submit:disabled {
    background: #e6e6e6;
    color: #777;
    cursor: default;
}

.twc-sub__note {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #777;
    text-align: left;
}

/* карта Почты России — отдельный слой поверх формы */
.twc-sub-post {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: #fff;
}

.twc-sub-post #twcSubPost {
    width: 100%;
    height: 100%;
}

.twc-sub-post__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
    font-size: 30px;
    line-height: 44px;
    color: #000;
    cursor: pointer;
}

@media (max-width: 600px) {
    .twc-sub {
        padding: 0;
        align-items: stretch;
    }

    .twc-sub__dialog {
        max-width: none;
        height: 100%;
        max-height: none;
        padding-top: 18px;
        border-radius: 0;
    }

    .twc-sub__title {
        margin-left: 16px;
        margin-right: 60px;
    }

    .twc-sub__lead {
        margin-left: 16px;
        margin-right: 16px;
    }

    .twc-sub__body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .twc-sub__footer {
        padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
    }

    .twc-sub__note {
        display: none;
    }

    .twc-sub__title {
        font-size: 22px;
    }

    .twc-sub__map-inner {
        height: 62vh;
    }

    .twc-sub__point {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
