/* =====================================================================
 * map-picker.css — 通用地图选点弹层样式（前后台共用，移动端优先）
 * 约定类名：.map-picker-modal / .map-picker-modal.show / .map-picker-foot
 * 与 map-picker.js 内部 .mp-* 元素一一对应。
 * ===================================================================== */

.map-picker-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: 92vw;
    max-width: 480px;
    height: 82vh;
    max-height: 760px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 11000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.map-picker-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* 移动端接近全屏 */
@media (max-width: 520px) {
    .map-picker-modal {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        border-radius: 0;
        left: 0;
        top: 0;
        transform: translateY(100%);
    }
    .map-picker-modal.show {
        transform: translateY(0);
    }
}

.mp-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.mp-close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
}
.mp-close:active { color: #555; }

.mp-hint {
    flex: 0 0 auto;
    margin: 8px 12px 0;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #a05a00;
    background: #fff7e6;
    border: 1px solid #ffe1a8;
    border-radius: 8px;
}
.mp-hint[hidden] { display: none; }

.mp-search {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
}
.mp-search-input {
    flex: 1 1 auto;
    height: 38px;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
    -webkit-appearance: none;
}
.mp-search-input:focus { border-color: #2e8bff; }
.mp-locate {
    flex: 0 0 auto;
    border: 1px solid #2e8bff;
    background: #fff;
    color: #2e8bff;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    cursor: pointer;
}
.mp-locate:active { background: #eef5ff; }

.mp-results {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid #f2f2f2;
    min-height: 40px;
}
.mp-result {
    padding: 10px 14px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
}
.mp-result:active { background: #f7f9ff; }
.mp-r-name {
    font-size: 14px;
    color: #1a1a1a;
    word-break: break-all;
}
.mp-r-addr {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
    word-break: break-all;
}
.mp-empty {
    padding: 18px;
    text-align: center;
    color: #bbb;
    font-size: 13px;
}

.mp-map {
    flex: 0 0 42%;
    min-height: 160px;
    background: #e9eef3;
    position: relative;
}
.mp-map[style*="display: none"] { display: none !important; }

/* 操作区：同时满足 .mp-foot 与既有契约 .map-picker-foot */
.mp-foot,
.map-picker-foot {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
}
.mp-cancel,
.mp-confirm {
    flex: 1 1 0;
    height: 40px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    border: 1px solid #e2e2e2;
}
.mp-cancel {
    background: #f5f5f5;
    color: #555;
}
.mp-confirm {
    background: #2e8bff;
    color: #fff;
    border-color: #2e8bff;
}
.mp-confirm:disabled {
    background: #b9d6ff;
    border-color: #b9d6ff;
    cursor: not-allowed;
}
.mp-confirm:not(:disabled):active { background: #1f7af0; }

/* 遮罩（点击空白关闭） */
.map-picker-modal::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: -1;
}
