/* ============================================
   FlowMaps - Стили карты доставки
   Версия: 1.0.0
   ============================================ */

/* ===== ОСНОВНОЙ КОНТЕЙНЕР ===== */
.flowmaps-container {
    max-width: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.flowmaps-field-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.flowmaps-field-wrapper:focus-within {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12);
}

.flowmaps-address-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    background: transparent;
    outline: none;
    color: #1a1a1a;
    min-width: 0;
}

.flowmaps-address-input::placeholder {
    color: #999;
    font-weight: 400;
}

.flowmaps-open-map-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: #7eca1d;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.flowmaps-open-map-btn:active {
    transform: scale(0.97);
}

.flowmaps-open-map-btn svg {
    width: 22px;
    height: 22px;
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.flowmaps-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.flowmaps-modal.active {
    display: flex;
    opacity: 1;
}

.flowmaps-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.flowmaps-modal-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    max-width: 92%;
    width: 720px;
    max-height: 95%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flowmaps-modal.active .flowmaps-modal-content {
    transform: translateY(0) scale(1);
}

/* ===== ШАПКА МОДАЛКИ ===== */
.flowmaps-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
    background: #fafafa;
}

.flowmaps-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
}

.flowmaps-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.flowmaps-modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
}

.flowmaps-modal-close svg {
    width: 20px;
    height: 20px;
}

/* ===== ТЕЛО МОДАЛКИ ===== */
.flowmaps-modal-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* ===== КАРТА ===== */
#flowmaps-map {
    border-radius: 14px;
    overflow: hidden;
    border: 1.5px solid #e8e8e8;
    min-height: 380px;
    height: 480px!important;
    width: 100%;
    position: relative;
    background: #f0f2f5;
}

/* ===== ЦЕНТРАЛЬНЫЙ МАРКЕР ===== */
.flowmaps-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
    font-size: 42px;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    animation: float-marker 2s ease-in-out infinite;
}

@keyframes float-marker {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50%      { transform: translate(-50%, -55%) scale(1.05); }
}

/* ===== КНОПКИ ДЕЙСТВИЙ ===== */
.flowmaps-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.flowmaps-btn-primary,
.flowmaps-btn-secondary {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flowmaps-btn-primary {
    background: #7eca1d;
    color: #fff;
}

.flowmaps-btn-primary:hover {
    background: #43a047;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.25);
}

.flowmaps-btn-primary:active {
    transform: scale(0.97);
}

.flowmaps-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.flowmaps-btn-secondary:hover {
    background: #e8e8e8;
}

.flowmaps-btn-secondary:active {
    transform: scale(0.97);
}

/* ============================================
   АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ============================================ */

@media (max-width: 768px) {
    .flowmaps-open-map-btn {
        justify-content: center;
        padding: 14px;
        font-size: 15px;
    }

    .flowmaps-modal-content {
        max-width: 98%;
        max-height: 95vh;
        border-radius: 16px;
    }

    .flowmaps-modal-header {
        padding: 14px 18px;
    }

    .flowmaps-modal-header h3 {
        font-size: 15px;
    }

    .flowmaps-modal-body {
        padding: 14px 16px 18px;
        gap: 12px;
    }

    #flowmaps-map {
        min-height: 280px;
        height: 280px;
        border-radius: 12px;
    }

    .flowmaps-btn-primary,
    .flowmaps-btn-secondary {
        width: 100%;
        padding: 14px;
    }

    .flowmaps-crosshair {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .flowmaps-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
        margin: 0 8px;
    }

    .flowmaps-modal-header {
        padding: 12px 16px;
    }

    .flowmaps-modal-header h3 {
        font-size: 14px;
    }

    .flowmaps-modal-body {
        padding: 12px 14px 16px;
        gap: 10px;
    }

    #flowmaps-map {
        min-height: 220px;
        height: 220px;
        border-radius: 10px;
    }

    .flowmaps-address-input {
        font-size: 15px;
        padding: 12px 14px;
    }

    .flowmaps-btn-primary,
    .flowmaps-btn-secondary {
        padding: 12px;
        font-size: 13px;
        border-radius: 10px;
    }

    .flowmaps-crosshair {
        font-size: 30px;
    }
}

/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ СТИЛИ
   ============================================ */

.leaflet-control-zoom {
    border-radius: 10px !important;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.leaflet-control-zoom a {
    background: #fff !important;
    color: #333 !important;
    font-weight: 500 !important;
}

.leaflet-control-zoom a:hover {
    background: #f5f5f5 !important;
}

.flowmaps-container * {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.flowmaps-modal-body::-webkit-scrollbar {
    width: 4px;
}

.flowmaps-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.flowmaps-modal-body::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 4px;
}

.flowmaps-modal-body::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}