/* Стили для пошагового выбора адреса с картой */

/* === БАЗОВЫЕ СТИЛИ === */
.address-wizard {
    max-width: 600px;
    margin: 0 auto;
}

.wizard-step {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.wizard-step.hidden {
    display: none;
}

/* === ЗАГОЛОВКИ ШАГОВ === */
.step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    position: relative;
}

.step-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.step-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.back-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* === ШАГ 1: ПОИСК ГОРОДА === */
.city-search {
    position: relative;
}

.city-input-wrapper {
    position: relative;
}

.city-input {
    width: 100%;
    padding: 16px 48px 16px 16px;
    font-size: 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    transition: all 0.15s ease;
    background: white;
}

.city-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Валидация городов */
.city-input.valid {
    border-color: #10b981;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2310b981'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 48px;
}

.city-input.invalid {
    border-color: #ef4444;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ef4444'%3E%3Cpath fill-rule='evenodd' d='M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 48px;
}

.search-loading {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

.search-loading.show {
    display: block;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.city-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.city-suggestions.show {
    display: block;
}

.city-suggestion-item {
    padding: 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
}

.city-suggestion-item:last-child {
    border-bottom: none;
}

.city-suggestion-item:hover {
    background-color: #f8fafc;
}

.city-main-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.city-region {
    font-size: 14px;
    color: #6b7280;
}

/* === ШАГ 2: КАРТА === */
.selected-city-info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e40af;
    font-weight: 500;
}

.selected-city-info i {
    color: #3b82f6;
}

.map-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
    margin-bottom: 16px;
}

.address-map {
    height: 450px;
    width: 100%;
}

.map-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-control-btn {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease;
    color: #374151;
    font-size: 14px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-control-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.map-info {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    z-index: 1000;
}

.map-info.hidden {
    display: none;
}

.map-info-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.map-info-icon {
    color: #3b82f6;
    font-size: 20px;
}

.map-info-text {
    flex: 1;
}

.map-info-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.map-info-subtitle {
    font-size: 14px;
    color: #6b7280;
}

/* Стили для ошибки определения адреса */
.map-info-content.error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #fecaca;
    color: #dc2626;
}

.map-info-content.error .map-info-icon {
    color: #dc2626;
}

.selected-address-info {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #10b981;
    z-index: 1000;
}

.selected-address-info.hidden {
    display: none;
}

.address-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #065f46;
    font-weight: 600;
    font-size: 14px;
}

.address-info-header i {
    color: #10b981;
}

.address-text {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 4px;
}

.address-coords {
    font-size: 12px;
    color: #6b7280;
}

.geolocation-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    flex-direction: column;
}

.geo-hint {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 400;
}

.geolocation-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
}

.geolocation-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === ШАГ 3: ФОРМА АДРЕСА === */
.address-form {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.15s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input[readonly] {
    background-color: #f3f4f6;
    color: #6b7280;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detected-address {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
}

.detected-address-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #166534;
    margin-bottom: 4px;
}

.detected-address-text {
    font-size: 14px;
    color: #374151;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
    .address-wizard {
        max-width: none;
        margin: 0;
    }

    .step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .step-header .back-btn {
        align-self: flex-end;
    }

    .step-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .step-title {
        font-size: 18px;
    }

    .city-input {
        padding: 14px 44px 14px 14px;
        font-size: 16px;
    }

    .address-map {
        height: 350px;
    }

    .map-controls {
        top: 8px;
        right: 8px;
        gap: 6px;
    }

    .map-control-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .map-info,
    .selected-address-info {
        bottom: 8px;
        left: 8px;
        right: 8px;
        padding: 12px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .city-suggestions {
        max-height: 180px;
    }

    .city-suggestion-item {
        padding: 12px;
    }
}

/* === LEAFLET СТИЛИ === */
.leaflet-container {
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 12px 16px;
    line-height: 1.4;
}

.custom-marker {
    background-color: #3b82f6;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}