/* Стили для Select Мессенджера (как у Инпутов) */

/* Глобальный box-sizing для формы, чтобы паддинги не ломали ширину */
.callback-form *,
.callback-form *::before,
.callback-form *::after {
    box-sizing: border-box;
}

#callbackForm .input-group label {
    left: 50px;
}

/* ОБЩИЕ СТИЛИ ДЛЯ ИНПУТОВ И СЕЛЕКТА */
.callback-form input,
.callback-form .selected-city,
.callback-form .option {
    width: 100%;
    /* Высота как у инпутов (примерно 40-50px с учетом паддинга и шрифта) */
    padding: 10px 10px 10px 50px !important;
    /* Отступ 40px слева - ГЛАВНОЕ ВЫРАВНИВАНИЕ */
    border: none;
    border-bottom: 1.5px solid #D1D1D1;
    outline: none;
    background: transparent;
    font-family: Gilroy, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #111;
    border-radius: 0;
    letter-spacing: 0.8px;
    transition: border-color 0.3s ease;

    position: relative;
    /* Для позиционирования иконки */
    display: flex;
    /* Чтобы вертикально центрировать текст и иконку */
    align-items: center;
    min-height: 45px;
    /* Фиксируем высоту */
}

/* Убираем border-bottom у опций в выпадающем списке, если не нужно */
.messenger-options .option {
    border-bottom: 1px solid #eee;
    background: #fff;
    cursor: pointer;
}

/* Lucide icons in messenger select */
.custom-messenger-select .lucide-icon,
.js-custom-messenger-select .lucide-icon,
.messenger-options .lucide-icon {
    width: 18px;
    height: 18px;
    color: #2269F2;
    font-style: normal;
    flex-shrink: 0;
}

.messenger-options .option:last-child {
    border-bottom: none;
}

.messenger-options .option:hover {
    background-color: #f5f5f5;
}

/* СТИЛИ ИКОНКИ (Добавляется JS-ом img.icon) */
.callback-form .selected-city .icon,
.callback-form .option .icon {
    position: absolute;
    left: 10px;
    /* Прибиваем к левому краю контейнера */
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    pointer-events: none;
    z-index: 5;
    /* Чтобы была поверх всего */
    /* margin-left: 0; Убираем, так как left:0 */
}

/* Специфично для списка опций - чтобы он выпадал правильно */
.messenger-options {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    width: 100%;
    z-index: 20;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
}

/* Убираем старые конфликтующие стили, если они где-то есть */
.callback-form .select-arrow {
    display: none;
}

/* ДЛЯ ИНПУТА ВАШЕ ИМЯ */
.callback-form #cb-name {
    padding-left: 40px !important;
}

/* Base icon styles for callback forms */
.callback-form .icon,
.callback-form .name-icon,
.callback-form .pin-icon,
.callback-form .car-icon,
.callback-form .fly-icon,
.callback-form .settings-icon,
.callback-form .icon-mask {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    pointer-events: none;
    z-index: 5;
    opacity: 1 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Ensure icons have a background color for masks */
.callback-form .name-icon,
.callback-form .pin-icon,
.callback-form .car-icon,
.callback-form .fly-icon,
.callback-form .settings-icon {
    background-color: #359EFD !important;
}

/* ИНПУТ ТЕЛЕФОНА */
.callback-form .iti__input {
    padding-left: 60px !important;
    /* У телефона чуть больше отступ для стрелочки кода */
}

/* Убираем padding у самого span внутри selected (если есть) */
.callback-form .selected-city span,
.callback-form .option span {
    padding: 0 !important;
    margin: 0 !important;
}

/* Contact Choice Modal */
.modal__dialog--contacts {
    max-width: 440px;
}

.modal__header_contacts {
    justify-content: space-between;
    position: relative;
}

.modal__header_contacts .modal__title {
    font-size: 20px;
    font-weight: 700;
    text-align: left !important;
    margin: 0;
}

.modal__header_contacts .modal__close {
    position: static !important;
    transform: none;
    flex-shrink: 0;
}

.contacts-subtitle {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin: 0 0 32px;
    text-align: left;
}

@keyframes rocketFly {
    0% {
        transform: translate(-20px, 20px);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(0, 0);
        opacity: 1;
    }
}

@keyframes sparkle1 {
    0%, 100% { transform: translate(0, 0) scale(0); opacity: 0; }
    15% { opacity: 1; transform: translate(-4px, 3px) scale(1); }
    50% { transform: translate(-14px, 10px) scale(0.5); opacity: 0; }
}
@keyframes sparkle2 {
    0%, 100% { transform: translate(0, 0) scale(0); opacity: 0; }
    15% { opacity: 1; transform: translate(-3px, 5px) scale(0.9); }
    50% { transform: translate(-10px, 16px) scale(0.4); opacity: 0; }
}
@keyframes sparkle3 {
    0%, 100% { transform: translate(0, 0) scale(0); opacity: 0; }
    15% { opacity: 1; transform: translate(-5px, 2px) scale(0.8); }
    50% { transform: translate(-18px, 6px) scale(0.3); opacity: 0; }
}
@keyframes sparkle4 {
    0%, 100% { transform: translate(0, 0) scale(0); opacity: 0; }
    15% { opacity: 0.8; transform: translate(-2px, 6px) scale(0.7); }
    50% { transform: translate(-8px, 18px) scale(0.2); opacity: 0; }
}
@keyframes sparkle5 {
    0%, 100% { transform: translate(0, 0) scale(0); opacity: 0; }
    15% { opacity: 0.9; transform: translate(-6px, 1px) scale(1); }
    50% { transform: translate(-20px, 3px) scale(0.3); opacity: 0; }
}

.contacts-icon-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
    margin-top: 24px;
}

.contacts-icon-wrap .contacts-icon {
    animation: rocketFly 0.8s ease-out forwards;
    display: block;
}

.contacts-icon-wrap::before,
.contacts-icon-wrap::after,
.contacts-icon-wrap .sparkle,
.contacts-icon-wrap .sparkle2,
.contacts-icon-wrap .sparkle3 {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4A7CF7;
    pointer-events: none;
}

.contacts-icon-wrap::before {
    animation: sparkle1 1.8s 0.8s ease-out infinite;
}
.contacts-icon-wrap::after {
    animation: sparkle2 1.8s 1.1s ease-out infinite;
    width: 5px;
    height: 5px;
}
.contacts-icon-wrap .sparkle {
    animation: sparkle3 1.8s 1.4s ease-out infinite;
    width: 4px;
    height: 4px;
}
.contacts-icon-wrap .sparkle2 {
    animation: sparkle4 1.8s 1.7s ease-out infinite;
    width: 5px;
    height: 5px;
}
.contacts-icon-wrap .sparkle3 {
    animation: sparkle5 1.8s 2.0s ease-out infinite;
    width: 3px;
    height: 3px;
}

.contact-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.contact-btn {
    width: 100% !important;
    max-width: none !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 64px !important;
    border-radius: 12px !important;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.2s ease;
    color: #fff !important;
    border: none !important;
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Phone Button */
.contact-btn.phone-btn {
    background: #2269F2 !important;
}

.contact-btn.phone-btn:hover {
    background: #1a54c9 !important;
}

/* WhatsApp Button */
.contact-btn.whatsapp-btn {
    background: #25D366 !important;
}

.contact-btn.whatsapp-btn:hover {
    background: #1ebc59 !important;
}

/* Telegram Button */
.contact-btn.telegram-btn {
    background: #2AABEE !important;
}

.contact-btn.telegram-btn:hover {
    background: #229ED9 !important;
}

.contact-btn img {
    filter: brightness(0) invert(1);
    /* Make icons white */
    display: block;
}

/* Transfer address toggle — on desktop: hide checkbox, show fields */
.tr-field--addr-toggle .tr-addr-checkbox {
    display: none;
}
.tr-field--addr-toggle .tr-addr-collapse {
    max-height: none;
    opacity: 1;
    overflow: visible;
}

/* TRANSFER MULTI-STEP STYLES (MATCHING ADMIN CALCULATOR UX) */
.modal__dialog--transfer {
    width: min(760px, calc(100vw - 32px)) !important;
    overflow: visible !important;
}

/* Desktop: hide subtitle, center title */
.modal__dialog--transfer .callback-subtitle {
    display: none;
}
.modal__header_transfer {
    justify-content: center;
    position: relative;
}
.modal__header_transfer .transfer__header-wrap {
    text-align: center;
    flex: unset;
    padding-right: 0;
}
.modal__header_transfer .modal__close {
    position: absolute !important;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* Close button lives inside modal__header now, reset absolute positioning */
.modal__dialog--transfer .modal__header_transfer .modal__close {
    position: absolute;
}

.tr-step {
    display: none;
    animation: trFadeIn 0.3s ease-out;
}

.tr-step.active {
    display: block;
}

@keyframes trFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tr-section-title {
    font-size: 14px;
    font-weight: 800;
    color: #111;
    text-transform: uppercase;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.tr-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.tr-form-grid-details {
    grid-template-columns: 2fr 1fr;
}

.tr-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tr-field label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Улучшенные стили для city-select в transfer modal */
#modal-transfer .custom-city-select .selected-city {
    position: relative !important;
    background-color: transparent !important;
    border: none !important;
    border-bottom: 1.5px solid #D1D1D1 !important;
    border-radius: 0 !important;
    padding: 12px 30px 10px 40px !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #111 !important;
    cursor: pointer !important;
    transition: border-color 0.3s, box-shadow 0.3s !important;
    background-image: url('../img/icons/dropdown2.svg') !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    background-size: 14px !important;
}

#modal-transfer .custom-city-select .selected-city.placeholder {
    color: #AAA !important;
}

#modal-transfer .custom-city-select.active .selected-city {
    background-image: url('../img/icons/dropdown2_.svg') !important;
}

/* Анимация подчёркивания для city-select при active */
#modal-transfer .custom-city-select .selected-city::before,
#modal-transfer .custom-city-select .selected-city::after {
    background: #2269F2;
}

#modal-transfer .custom-city-select.active .selected-city::before,
#modal-transfer .custom-city-select.active .selected-city::after {
    width: 50%;
}

/* Иконки в selected-city для transfer modal */
#modal-transfer .custom-city-select .selected-city .icon-mask {
    position: absolute !important;
    left: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    background-color: #359EFD !important;
    mask-size: contain !important;
    -webkit-mask-size: contain !important;
    mask-repeat: no-repeat !important;
    -webkit-mask-repeat: no-repeat !important;
    mask-position: center !important;
    -webkit-mask-position: center !important;
}

/* Dropdown list для transfer modal */
#modal-transfer .custom-city-select .city-options {
    border: 1px solid #EEE !important;
    border-radius: 12px !important;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15) !important;
    margin-top: 5px !important;
    z-index: 100000 !important;
}

#modal-transfer .custom-city-select .city-options.active {
    display: block !important;
}

#modal-transfer .custom-city-select.active {
    z-index: 100001 !important;
}

#modal-transfer .custom-city-select .city-options .option {
    padding: 14px 20px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border-bottom: 1px solid #f8f8f8 !important;
    transition: all 0.2s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    text-transform: uppercase !important;
}

#modal-transfer .custom-city-select .city-options .option:hover {
    background: #F0F8FF !important;
    color: #359EFD !important;
}

#modal-transfer .custom-city-select .city-options .option:hover .icon-mask {
    background-color: #359EFD !important;
}

/* Улучшенные стили для input полей "СВОЙ АДРЕС" в transfer modal */
#modal-transfer .tr-input-wrapper:not(.tr-custom-select) {
    background-color: transparent !important;
    border: none !important;
    border-bottom: 1.5px solid #D1D1D1 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    transition: border-color 0.3s, box-shadow 0.3s !important;
}

/* серая полоска остаётся, синяя анимация рисуется поверх */

#modal-transfer .tr-input-wrapper:not(.tr-custom-select) input {
    border: none !important;
    padding: 12px 15px 12px 45px !important;
    border-radius: 0 !important;
    background: transparent !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #111 !important;
}

#modal-transfer .tr-input-wrapper:not(.tr-custom-select) input::placeholder {
    color: #AAA !important;
    font-weight: 600 !important;
}

#modal-transfer .tr-input-wrapper:not(.tr-custom-select) .icon {
    left: 15px !important;
    width: 18px !important;
    height: 18px !important;
    opacity: 0.6 !important;
}

.tr-input-wrapper {
    position: relative;
    border-bottom: 1.5px solid #D1D1D1;
    transition: border-color 0.3s;
}

/* Анимация подчёркивания из центра (как на основном сайте) */
#modal-transfer .tr-input-wrapper::before,
#modal-transfer .tr-input-wrapper::after {
    content: '';
    height: 2px;
    width: 0;
    bottom: -1px;
    position: absolute;
    background: #2269F2;
    transition: 0.5s ease all;
}

#modal-transfer .tr-input-wrapper::before {
    left: 50%;
}

#modal-transfer .tr-input-wrapper::after {
    right: 50%;
}

#modal-transfer .tr-input-wrapper:focus-within::before,
#modal-transfer .tr-input-wrapper:focus-within::after {
    width: 50%;
}

/* intl-tel-input .iti - растянуть на всю ширину в трансфер-модале */
#modal-transfer .tr-input-wrapper .iti {
    width: 100% !important;
    display: block !important;
}

/* При ошибке валидации — красная толстая полоска поверх серой (серая остаётся) */
#modal-transfer .tr-input-wrapper:has(.input-error)::before,
#modal-transfer .tr-input-wrapper:has(.input-error)::after,
#modal-transfer .tr-input-wrapper.has-error::before,
#modal-transfer .tr-input-wrapper.has-error::after {
    background: #e53935;
    width: 50%;
}

.tr-input-wrapper select,
.tr-input-wrapper input {
    width: 100%;
    border: none !important;
    padding: 10px 10px 10px 35px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    background: transparent !important;
    outline: none !important;
}

/* Hide native date picker indicator — we have our own icon */
#tr-date::-webkit-calendar-picker-indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
#tr-date::-moz-calendar-picker-indicator {
    opacity: 0;
}

/* Clean up tr-input icon base */
.tr-input-wrapper .icon {
    position: absolute;
    left: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 22px !important;
    height: 22px !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Quantity controls in modal */
.tr-qty-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 5px 0;
}

.tr-qty-btn {
    width: 32px;
    height: 32px;
    border: 1.5px solid #D1D1D1;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    transition: all 0.2s;
}

.tr-qty-btn:hover {
    border-color: #2269F2;
    color: #2269F2;
}

.tr-qty-val {
    font-size: 18px;
    font-weight: 800;
    color: #111;
    min-width: 20px;
    text-align: center;
}

.tr-calc-summary {
    background: rgba(34, 105, 242, 0.05);
    border: 1.5px dashed rgba(34, 105, 242, 0.3);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 30px;
    text-align: center;
}

.tr-summary-price {
    font-size: 52px;
    font-weight: 900;
    color: #2269F2;
    margin-bottom: 6px;
    line-height: 1;
}

.tr-summary-route {
    font-size: 16px;
    color: #111;
    font-weight: 700;
}

.tr-back-link {
    display: block;
    text-align: center;
    margin-top: 25px;
    font-size: 13px;
    font-weight: 700;
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.tr-back-link:hover {
    color: #2269F2;
}

/* Global fix for the modal to allow dropdowns to be visible */
.modal__dialog--transfer {
    overflow: visible !important;
}

/* Specific styles for Transfer Modal Custom Selects */
.tr-input-wrapper.tr-custom-select {
    position: relative;
    z-index: 100;
    cursor: pointer;
    background-image: url('../img/icons/dropdown2.svg');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 14px;
    background-color: transparent !important;
    border: none !important;
    border-bottom: 1.5px solid #D1D1D1 !important;
    border-radius: 0 !important;
    transition: all 0.3s;
}

.tr-input-wrapper.tr-custom-select:hover {
    border-color: #D1D1D1 !important;
}

.tr-input-wrapper.tr-custom-select.active {
    z-index: 10005;
    background-image: url('../img/icons/dropdown2_.svg');
}

/* Анимация подчёркивания для transport type select */
.tr-input-wrapper.tr-custom-select::before,
.tr-input-wrapper.tr-custom-select::after {
    content: '';
    height: 2px;
    width: 0;
    bottom: -1px;
    position: absolute;
    background: #2269F2;
    transition: 0.5s ease all;
}

.tr-input-wrapper.tr-custom-select::before {
    left: 50%;
}

.tr-input-wrapper.tr-custom-select::after {
    right: 50%;
}

.tr-input-wrapper.tr-custom-select.active::before,
.tr-input-wrapper.tr-custom-select.active::after {
    width: 50%;
}

/* Убираем дублирующие ::before/::after и dropdown arrow с .selected-city внутри .tr-custom-select */
.tr-input-wrapper.tr-custom-select .selected-city::before,
.tr-input-wrapper.tr-custom-select .selected-city::after {
    display: none !important;
}

.tr-input-wrapper.tr-custom-select .selected-city {
    border-bottom: none !important;
    background-image: none !important;
}

.tr-input-wrapper.tr-custom-select .icon {
    pointer-events: none;
    /* Icons shouldn't block clicks */
}

/* Lucide icon inside transfer service select */
.tr-select-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px !important;
    height: 18px !important;
    color: #2269F2;
    pointer-events: none;
    z-index: 1;
}
/* Lucide icon inside address inputs */
.tr-addr-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px !important;
    height: 18px !important;
    color: #2269F2;
    pointer-events: none;
    z-index: 1;
}
.tr-input-wrapper.tr-custom-select .tr-selected-val {
    padding-left: 42px;
}
/* Unified Blue Mask Icons (#359EFD) */
.tr-step .name-icon,
.tr-step .pin-icon,
.tr-step .car-icon,
.tr-step .fly-icon,
.tr-step .settings-icon,
.tr-step .icon-mask,
.tr-step .phone-icon,
.tr-option-item .icon-mask,
#modal-transfer .option .icon-mask {
    background-color: #359EFD !important;
    mask-size: contain !important;
    -webkit-mask-size: contain !important;
    mask-repeat: no-repeat !important;
    -webkit-mask-repeat: no-repeat !important;
    mask-position: center !important;
    -webkit-mask-position: center !important;
    background-image: none !important;
}

/* Base Mask Assignments */
.name-icon {
    mask-image: url('../img/icons/user.svg') !important;
    -webkit-mask-image: url('../img/icons/user.svg') !important;
}

.pin-icon {
    mask-image: url('../img/icons/map-pin.svg') !important;
    -webkit-mask-image: url('../img/icons/map-pin.svg') !important;
}

.car-icon {
    mask-image: url('../img/icons/bus.svg') !important;
    -webkit-mask-image: url('../img/icons/bus.svg') !important;
}

.fly-icon {
    mask-image: url('../img/icons/airplane.svg') !important;
    -webkit-mask-image: url('../img/icons/airplane.svg') !important;
}

.settings-icon {
    mask-image: url('../img/icons/info.svg') !important;
    -webkit-mask-image: url('../img/icons/info.svg') !important;
}

.phone-icon {
    mask-image: url('../img/icons/mob-phone2.svg') !important;
    -webkit-mask-image: url('../img/icons/mob-phone2.svg') !important;
}

/* Original Image Icons (Social & Specialized) */
.tr-input-wrapper img.icon {
    background-color: transparent !important;
    mask: none !important;
    -webkit-mask: none !important;
    background-image: none !important;
    object-fit: contain !important;
    opacity: 1 !important;
    border: none !important;
}

/* Date Icon - Specific from main site style */
.tr-input-wrapper .icon.date-icon {
    background-image: url('../img/icons/calendar-icon.svg') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-color: transparent !important;
    mask: none !important;
    -webkit-mask: none !important;
    width: 22px !important;
    height: 22px !important;
    opacity: 1 !important;
}

.tr-selected-val {
    width: 100%;
    padding: 12px 40px 12px 45px;
    font-size: 15px;
    font-weight: 600;
    color: #111;
    min-height: 48px;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.tr-selected-val span {
    pointer-events: none;
}

.tr-selected-val.placeholder {
    color: #AAA;
}

.tr-options-list {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
    z-index: 100000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #EEE;
}

.tr-options-list.active {
    display: block;
}

.tr-options-scroll {
    max-height: 260px;
    overflow-y: auto !important;
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar */
.tr-options-scroll::-webkit-scrollbar {
    width: 6px;
}

.tr-options-scroll::-webkit-scrollbar-track {
    background: #f9f9f9;
}

.tr-options-scroll::-webkit-scrollbar-thumb {
    background: #359EFD;
    border-radius: 10px;
}

.tr-option-item {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    transition: all 0.2s;
    border-bottom: 1px solid #f8f8f8;
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
    text-transform: uppercase;
}

.tr-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tr-option-name {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    line-height: 1.3;
}

.tr-option-sub {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: none;
    line-height: 1.2;
}

.tr-option-item:hover .tr-option-name {
    color: #359EFD;
}

.tr-option-item:hover .tr-option-sub {
    color: #6bb5fd;
}

.tr-option-item:hover {
    background: #F0F8FF;
    color: #359EFD;
}

.tr-option-item:hover .icon-mask {
    background-color: #359EFD !important;
}

/* Stacking Fix */
.tr-option-item .icon-mask {
    position: static !important;
    margin: 0 !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    align-self: center !important;
    flex-shrink: 0 !important;
}

/* Same fix for .option inside transfer city-select (uses CSS mask icons instead of <img>) */
#modal-transfer .custom-city-select .option .icon-mask {
    position: static !important;
    margin: 0 !important;
    width: 20px !important;
    height: 20px !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
    pointer-events: none !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
}

.tr-options-mobile-header {
    display: none;
    padding: 0 24px;
    padding-right: 60px;
    font-weight: 800;
    text-align: left;
    font-size: 18px;
    text-transform: uppercase;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
    height: 72px;
    line-height: 72px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
    color: #333;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .tr-options-list.mobile-fs,
    .tr-options-list.mobile-fullscreen {
        position: fixed;
        top: 0;
        left: 0;
        width: 100dvw;
        height: 100dvh;
        z-index: 200000;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        background: #fff;
    }

    .tr-options-list.mobile-fs .tr-options-mobile-header,
    .tr-options-list.mobile-fullscreen .tr-options-mobile-header {
        display: block;
    }

    .tr-options-list.mobile-fullscreen > .mobile-close-btn {
        position: fixed !important;
        top: 24px !important;
        right: 20px !important;
        z-index: 200001 !important;
        font-size: 24px !important;
        color: #333 !important;
        cursor: pointer !important;
        width: 24px !important;
        height: 24px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: none !important;
        border: none !important;
        box-shadow: none !important;
    }

    .tr-options-list.mobile-fullscreen .tr-options-scroll {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 80px;
        max-height: none !important;
    }

    .tr-option-item {
        padding: 18px 24px;
        font-size: 16px;
        gap: 14px;
    }

    .tr-option-item .icon-mask {
        width: 32px !important;
        height: 32px !important;
    }

    .tr-option-name {
        font-size: 16px;
    }

    .tr-option-sub {
        font-size: 13px;
    }

    /* ── Transfer address checkbox toggle (mobile only) ── */
    .tr-field--addr-toggle .tr-addr-checkbox {
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        padding: 10px 0 6px;
        user-select: none;
        -webkit-user-select: none;
    }

    .tr-field--addr-toggle .tr-addr-checkbox input {
        display: none;
    }

    .tr-field--addr-toggle .tr-addr-checkbox__mark {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
        border: 2px solid #c4c4c4;
        border-radius: 6px;
        background: #fff;
        position: relative;
        transition: all .25s;
    }

    .tr-field--addr-toggle .tr-addr-checkbox input:checked ~ .tr-addr-checkbox__mark {
        background: #2269F2;
        border-color: #2269F2;
    }

    .tr-field--addr-toggle .tr-addr-checkbox__mark::after {
        content: '';
        position: absolute;
        left: 6px;
        top: 2px;
        width: 6px;
        height: 11px;
        border: solid #fff;
        border-width: 0 2.5px 2.5px 0;
        transform: rotate(45deg);
        opacity: 0;
        transition: opacity .2s;
    }

    .tr-field--addr-toggle .tr-addr-checkbox input:checked ~ .tr-addr-checkbox__mark::after {
        opacity: 1;
    }

    .tr-field--addr-toggle .tr-addr-checkbox__text {
        font-size: 13px;
        font-weight: 700;
        color: #555;
        text-transform: uppercase;
        letter-spacing: .03em;
    }

    .tr-field--addr-toggle .tr-addr-collapse {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height .35s ease, opacity .25s ease, margin .25s ease;
        margin-top: 0;
    }

    .tr-field--addr-toggle .tr-addr-collapse.open {
        max-height: 120px;
        opacity: 1;
        margin-top: 8px;
    }

    .tr-field--addr-toggle .tr-addr-collapse > label {
        display: none;
    }

    /* === TRANSFER MODAL — full-screen on mobile like terms modal === */
    .modal__dialog--transfer {
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        display: flex;
        flex-direction: column;
        overflow: hidden !important;
    }

    /* Mobile: show subtitle, left-align title */
    .modal__dialog--transfer .callback-subtitle {
        display: block;
    }
    .modal__header_transfer .transfer__header-wrap {
        text-align: left;
        flex: 1;
        padding-right: 16px;
    }
    .modal__header_transfer .modal__close {
        position: static !important;
        transform: none;
    }

    /* Transfer header on mobile */
    .modal__dialog--transfer .modal__header_transfer {
        flex-shrink: 0;
        padding: 16px 20px;
    }

    .modal__dialog--transfer .modal__header_transfer .transfer__header-wrap {
        font-size: 20px;
    }

    .modal__dialog--transfer .callback-content {
        flex: 1;
        min-height: 0;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 0 0 0 0;
    }

    .modal__dialog--transfer .callback-subtitle {
        flex-shrink: 0;
        margin: 0;
        padding: 0 20px 12px;
        border-bottom: 1px solid #eee;
    }
    .modal__dialog--transfer .callback-form {
        padding: 0 20px 80px;
    }

    /* Hide section labels on mobile */
    .modal__dialog--transfer .tr-section-title {
        display: none !important;
    }

    /* Hide subtitle on mobile */
    .modal__dialog--transfer .callback-subtitle {
        display: none !important;
    }

    /* === CALLBACK MODAL (ЗАЯВКА / ОБРАТНЫЙ ЗВОНОК) — full-screen on mobile === */
    #modal-callback .modal__dialog--callback {
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        display: flex;
        flex-direction: column;
        overflow: hidden !important;
    }

    #modal-callback .modal__dialog--callback > .modal__close {
        position: absolute;
        top: 14px;
        right: 14px;
        z-index: 10;
    }

    #modal-callback .modal__dialog--callback .callback-content {
        flex: 1;
        overflow-y: auto;
        padding: 40px 20px 25px;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    /* City dropdown fullscreen inside transfer modal — must be above modal z-index */
    #modal-transfer .custom-city-select .city-options.mobile-fullscreen {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: #fff !important;
        z-index: 200010 !important;
        overflow-y: auto !important;
        padding: 72px 0 90px 0 !important;
        box-sizing: border-box !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        max-height: none !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch !important;
    }

    #modal-transfer .custom-city-select .city-options.mobile-fullscreen .city-select-mobile-title {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 72px !important;
        background: #fff !important;
        z-index: 200011 !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 16px 0 24px !important;
        font-size: 20px !important;
        font-weight: 700 !important;
        color: #333 !important;
        text-align: left !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16) !important;
        box-sizing: border-box !important;
    }

    #modal-transfer .custom-city-select .city-options.mobile-fullscreen .mobile-close-btn {
        position: fixed !important;
        top: 14px !important;
        right: 16px !important;
        z-index: 200012 !important;
    }

    #modal-transfer .custom-city-select .city-options.mobile-fullscreen .option {
        padding: 20px 24px !important;
        font-size: 18px !important;
        border-bottom: 1px solid #eee !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 14px !important;
    }

    #modal-transfer .custom-city-select .city-options.mobile-fullscreen .option:last-child {
        border-bottom: none !important;
    }

    #modal-transfer .custom-city-select .city-options.mobile-fullscreen .option:active {
        background-color: #f0f8ff !important;
    }

    #modal-transfer .custom-city-select .city-options.mobile-fullscreen .option .icon-mask {
        width: 22px !important;
        height: 22px !important;
    }
}

@media (max-width: 640px) {
    .tr-form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* State for long-distance transfer results */
.tr-calc-summary.is-far {
    background: rgba(243, 156, 18, 0.05) !important;
    border: 1.5px dashed #f39c12 !important;
}

.tr-far-badge {
    display: inline-block;
    background: #f39c12;
    color: #fff;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* Lucide icons in forms */
.input-group .lucide-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #359EFD;
    pointer-events: none;
    z-index: 5;
    font-style: normal;
}

.callback-form .lucide-icon {
    left: 15px;
    width: 22px;
    height: 22px;
}

/* Pin icon to top for textarea (prevents jumping on multi-line) */
.input-group textarea ~ .lucide-icon,
.input-group textarea ~ i.lucide-icon {
    top: 18px;
    transform: none;
}

/* Lucide иконка map-pin-check-inside в city-select триггере transfer modal */
.tr-city-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #2269F2;
    pointer-events: none;
    z-index: 1;
    font-style: normal;
}

/* Lucide иконки в заголовках секций transfer modal */
.tr-section-icon {
    width: 18px;
    height: 18px;
    color: #999;
    flex-shrink: 0;
    font-style: normal;
}

/* ============ UNIVERSAL SUCCESS POPUP ============ */
.success-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: successFadeIn .3s ease;
}
.success-popup__overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.45);
}
.success-popup__dialog {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 48px 36px 36px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: successSlideUp .4s ease;
}
.success-popup__close {
    position: absolute;
    top: 14px; right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    color: #aaa;
    cursor: pointer;
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .2s, color .2s;
}
.success-popup__close:hover {
    background: #f0f0f0;
    color: #333;
}
.success-popup__icon {
    margin-bottom: 20px;
}
.success-popup__title {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 10px;
    line-height: 1.3;
}
.success-popup__text {
    font-size: 15px;
    color: #666;
    margin: 0 0 20px;
    line-height: 1.5;
}
.success-popup__order {
    font-size: 14px;
    color: #2269F2;
    font-weight: 700;
    margin-bottom: 24px;
}
.success-popup__order:empty {
    display: none;
}
.success-popup__btn {
    background: #2269F2;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 48px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .1s;
    letter-spacing: .02em;
}
.success-popup__btn:hover {
    background: #1a57d0;
}
.success-popup__btn:active {
    transform: scale(.97);
}
@keyframes successFadeIn {
    from { opacity: 0 }
    to { opacity: 1 }
}
@keyframes successSlideUp {
    from { opacity: 0; transform: translateY(30px) }
    to { opacity: 1; transform: translateY(0) }
}
@media (max-width: 480px) {
    .success-popup__dialog {
        padding: 40px 24px 28px;
        border-radius: 16px;
    }
    .success-popup__title { font-size: 20px; }
    .success-popup__btn { padding: 13px 36px; font-size: 15px; width: 100%; }
}
/* ============ END SUCCESS POPUP ============ */

/* === CONTACTS MODAL — full-width on mobile, flush top === */
@media (max-width: 768px) {
    .modal__dialog--contacts {
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        display: flex;
        flex-direction: column;
        background: #fff;
    }

    .modal__header_contacts {
        padding: 16px 20px;
        flex-shrink: 0;
    }

    .modal__header_contacts .modal__title {
        text-align: left;
    }

    .modal__dialog--contacts .callback-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        /* padding: 24px 20px 0; */
    }

    .modal__dialog--contacts .contacts-subtitle {
                width: 100%;
        text-align: center;
        font-size: 17px;
        margin-bottom: 50px;
    }

    .modal__dialog--contacts .contact-options-list {
        width: 100%;
        margin: 0;
        margin-top: 20px;
    }
}
