/* Глобальные стили модального окна тарифов */

/* Базовые стили для модалки тарифа */
#modal-tariff .modal-content {
    max-width: 500px;
    height: 900px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#step-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 12px;
}

#modal-tariff .modal-footer {
    flex-shrink: 0;
    padding: 12px;
}

/* Прогресс-бар */
.modal-progress {
    margin-bottom: 15px;
    flex-shrink: 0;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.progress-steps .step-indicator {
    display: none;
}

.progress-steps .step-separator {
    display: none;
}

.step-title {
    color: var(--color-accent, #FF9800);
    font-weight: 600;
    margin: 0 0 8px 0;
    font-size: 18px;
}

/* Кнопки навигации */
.step-buttons {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 15px !important;
}

.step-buttons .btn {
    flex: 1;
}

/* Общие стили для шагов */
.step-description {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.step-description strong {
    color: var(--color-primary, #2E7D32);
}

/* Анимация появления */
.fade-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Общие стили для всех модалок (перенесено из main.css) */
.modal-content {
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    padding: 40px;
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    height: auto;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

/* ========== АДАПТАЦИЯ ========== */

/* Ноутбуки 1536px и меньше (16" 100%) */
@media (max-width: 1536px) {
    #modal-tariff .modal-content {
        max-width: 480px;
        height: 85vh;
    }
}

/* Ноутбуки 1366px (старые ноутбуки) */
@media (max-width: 1366px) {
    #modal-tariff .modal-content {
        max-width: 450px;
        height: 90vh;
    }
    .selected-list-container {
        max-height: 180px;
    }
}

/* Маленькие ноутбуки 1280px */
@media (max-width: 1280px) {
    #modal-tariff .modal-content {
        max-width: 420px;
        height: 90vh;
    }
    .selected-list-container {
        max-height: 160px;
    }
    .step-description {
        font-size: 12px;
    }
}

/* Планшеты горизонтально 1024px */
@media (max-width: 1024px) {
    #modal-tariff .modal-content {
        max-width: 90%;
        height: 85vh;
    }
    .modal-content {
        padding: 30px 25px;
    }
    .selected-list-container {
        max-height: 200px;
    }
}

/* Планшеты вертикально и телефоны 768px */
@media (max-width: 768px) {
    /* 1. Настройки самого модального окна */
    #modal-tariff .modal-content {
        max-width: 95%;
        height: 90vh;
        padding: 15px;
    }
    
    /* 2. Строка ввода кадастрового номера */
    .input-group {
        display: flex;
        flex-direction: row;
        gap: 8px;
        align-items: center;
    }
    
    /* Поле ввода */
    .input-group .cadastral-input {
        flex: 1;
    }
    
    /* Кнопка "Добавить" — справа от поля, меньшего размера */
    .btn-add-number {
        width: auto;
        min-width: 80px;
        font-size: 13px;
        padding: 0 12px;
        min-height: 38px;
    }
    
    /* 3. Список выбранных участков */
    .selected-list-container {
        max-height: 150px;
        margin: 8px 0;
    }
    
    /* 4. Текст подсказок — компактнее */
    .step-description {
        font-size: 11px;
        line-height: 1.3;
    }
    
    /* 5. Блоки "Период" и "Подтверждение" */
    .period-block, .confirm-block {
        padding: 6px 8px;
        margin: 4px 0;
    }
    
    .period-label, .confirm-label {
        font-size: 12px;
    }
    
    .confirm-wrapper {
        gap: 6px;
    }
    
    /* 6. Кнопка "Карта" — видимая, компактная */
    .map-tab-button {
        display: flex !important;
        width: 32px;
        height: 80px;
        font-size: 12px;
        background-color: #2196F3;
        border-radius: 0 16px 16px 0;
        z-index: 1999;
        left: auto !important;
        right: 10px;
        top: 50% !important;
        transform: translateY(-50%);
    }
    
    /* 7. Стоимость */
    .price-block {
        font-size: 14px;
        padding: 6px 10px;
    }
    
    .price-value {
        font-size: 16px;
    }
}

/* Большие телефоны 480px */
@media (max-width: 480px) {
    #modal-tariff .modal-content {
        height: 95vh;
        padding: 12px;
    }
    .modal-content {
        padding: 15px 12px;
    }
    .step-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .step-buttons .btn {
        width: 100%;
    }
    .selected-list-container {
        max-height: 120px;
    }
    .form-control {
        font-size: 14px;
        padding: 8px 10px;
    }
    .btn-add-number {
        min-width: 70px;
        font-size: 12px;
        padding: 0 10px;
        min-height: 36px;
    }
    .map-tab-button {
        width: 28px;
        height: 70px;
        font-size: 11px;
        right: 5px;
    }
}

/* Маленькие телефоны 360px */
@media (max-width: 360px) {
    #modal-tariff .modal-content {
        height: 95vh;
    }
    .selected-list-container {
        max-height: 100px;
    }
    .step-title {
        font-size: 14px;
    }
    .step-description {
        font-size: 10px;
    }
    .btn-add-number {
        min-width: 65px;
        font-size: 11px;
    }
}

/* ========== СТИЛИ ДЛЯ КАРТЫ ========== */

/* Селектор карты - по центру, голубой, неподвижный */
.map-selector {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2003;
    background: #E3F2FD;
    padding: 10px 20px;
    border-radius: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    font-size: 14px;
    font-family: var(--font-family, sans-serif);
    user-select: none;
    border: 1px solid #90CAF9;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.map-selector label {
    margin-right: 8px;
    color: #1565C0;
    font-weight: 500;
    pointer-events: none;
}

.map-selector select {
    padding: 6px 12px;
    border-radius: 30px;
    border: 1px solid #90CAF9;
    background: white;
    cursor: pointer;
    pointer-events: auto;
    font-size: 13px;
    color: #1565C0;
    font-weight: 500;
    outline: none;
}

.map-selector select:focus {
    border-color: #FF9800;
    box-shadow: 0 0 0 2px rgba(255,152,0,0.2);
}

/* Кнопка закрытия карты - оранжевая */
.map-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background-color: #FF9800 !important;
    border: none;
    border-radius: 50%;
    font-size: 32px;
    cursor: pointer;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 2003;
    transition: all 0.2s ease;
}

.map-modal-close:hover {
    background-color: #F57C00 !important;
    transform: scale(1.05);
}

/* ========== СТИЛИ ДЛЯ МОДАЛКИ "ПОДРОБНЕЕ" (ДЛЯ КОГО) ========== */
#modal-target.modal .modal-content {
    display: flex;
    flex-direction: column;
    height: 80vh;
    max-height: 80vh;
    min-height: auto;
    width: 90%;
    max-width: 600px;
    padding: 30px 25px;
    position: relative;
}

#modal-target .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    background: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

#modal-target #modal-target-description {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
    margin-top: 10px;
}

#modal-target .modal-footer {
    flex-shrink: 0;
    background: white;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    margin-top: 0;
}
.yookassa-widget-container {
    min-height: 450px;
    height: auto;
    overflow: visible;
}

.yookassa-widget-container {
    margin: 16px 0;
    width: 100%;
    height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}
/* Стили для подсказок кадастровых номеров - скролл */
.cadastral-suggestions {
    max-height: 200px !important;
    overflow-y: auto !important;
}

/* Стили для списка выбранных участков - скролл */
.selected-list-container {
    max-height: 150px;
    overflow-y: auto;
}

#step-content > div {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

#step-content > div .selected-list-container {
    flex: 1;
    min-height: 0;
}

#step-content > div {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#step-content > div .selected-list-container {
    flex: 1;
    min-height: 0;
}

/* Прижимаем все блоки от "Период отслеживания" и ниже к низу */
#step-content > div .period-block,
#step-content > div .confirm-block,
#step-content > div .price-block {
    margin-top: auto;
}

/* Чтобы блоки шли друг за другом, а не поверх */
#step-content > div .period-block {
    margin-top: auto;
}

#step-content > div .confirm-block {
    margin-top: 0;
}

#step-content > div .price-block {
    margin-top: 0;
}