﻿/* ➜ Đặt tại: wwwroot/css/home/hp-location-picker.css — hộp chọn vị trí (hp-location-picker.js, bản đồ Leaflet/OpenStreetMap) */
/* Luôn nằm trên modal khác đang mở (vd. Đăng ký tài khoản) */
.hp-loc-modal {
    z-index: 1065;
}

    .hp-loc-modal .modal-title {
        font-size: 17px;
        font-weight: 700;
    }

.hp-loc-search {
    position: relative;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

    .hp-loc-search i {
        position: absolute;
        left: 24px;
        top: 50%;
        transform: translateY(-50%);
        color: #888;
        font-size: 14px;
    }

    .hp-loc-search input {
        flex: 1 1 auto;
        min-width: 0;
        border: 1px solid #d9d9d9;
        border-radius: 20px;
        padding: 8px 12px 8px 34px;
        font-size: 15px;
        outline: none;
    }

        .hp-loc-search input:focus {
            border-color: #1f7a34;
        }

    .hp-loc-search button {
        flex: 0 0 auto;
        border: 0;
        border-radius: 20px;
        background: #1f7a34;
        color: #fff;
        padding: 0 16px;
        font-size: 14px;
    }

/* 3 bước hướng dẫn dưới ô tìm: 1 gõ địa chỉ → 2 kéo ghim → 3 bấm Lưu */
.hp-loc-steps {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0 12px 8px;
    list-style: none;
    border-bottom: 1px solid #eee;
}

    .hp-loc-steps li {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        align-items: flex-start;
        gap: 6px;
        padding: 6px 8px;
        border-radius: 8px;
        background: #f5f6f7;
        color: #888;
        font-size: 12.5px;
        line-height: 1.35;
        transition: background .2s, color .2s;
    }

        .hp-loc-steps li b {
            flex: 0 0 auto;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #ced4da;
            color: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
        }

        .hp-loc-steps li strong {
            font-weight: 600;
        }

        .hp-loc-steps li.is-active {
            background: #eaf6ee;
            color: #1f5f2c;
            box-shadow: inset 0 0 0 1px #9fd3ad;
        }

            .hp-loc-steps li.is-active b {
                background: #1f7a34;
            }

        .hp-loc-steps li.is-done {
            color: #5b8a66;
        }

            .hp-loc-steps li.is-done b {
                background: #1f7a34;
                font-size: 0;
            }

                .hp-loc-steps li.is-done b::after {
                    content: "✓";
                    font-size: 12px;
                }

    .hp-loc-steps .hp-short {
        display: none;
    }

@media (max-width: 575.98px) {
    .hp-loc-steps .hp-long {
        display: none;
    }

    .hp-loc-steps .hp-short {
        display: inline;
    }

    .hp-loc-steps li {
        font-size: 12px;
        padding: 5px 6px;
        gap: 4px;
        align-items: center;
    }

        .hp-loc-steps li b {
            width: 18px;
            height: 18px;
            font-size: 11px;
        }
}
/* Bước 3: nút Lưu nhấp nháy nhẹ */
.hp-loc-save.hp-loc-save-ready:not(:disabled) {
    animation: hpLocSavePulse 1.6s ease-in-out infinite;
}

@keyframes hpLocSavePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(31,122,52,.55);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(31,122,52,0);
    }
}

/* Danh sách gợi ý / kết quả Tìm: nổi đè lên bản đồ ngay dưới ô tìm (không đẩy bản đồ xuống) */
.hp-loc-modal .modal-body {
    position: relative;
}

.hp-loc-results {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 56px;
    z-index: 5;
    background: #fff;
    border: 1px solid #dfe3e6;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(0,0,0,.18);
    max-height: 240px;
    overflow-y: auto;
}

    .hp-loc-results[hidden] {
        display: none;
    }

    .hp-loc-results button {
        display: block;
        width: 100%;
        text-align: left;
        border: 0;
        border-bottom: 1px solid #f3f3f3;
        background: #fff;
        padding: 9px 14px;
        font-size: 14px;
    }

        .hp-loc-results button:hover, .hp-loc-results button.is-active {
            background: #f1f8f3;
        }

        .hp-loc-results button:last-child {
            border-bottom: 0;
        }

    .hp-loc-results i {
        color: #d63939;
        margin-right: 4px;
    }

.hp-loc-results-loading {
    padding: 9px 14px;
    font-size: 13.5px;
    color: #777;
}

.hp-loc-results button.is-recent i {
    color: #1f7a34;
}
/* địa chỉ gần đây của khách */
.hp-loc-results .hp-loc-results-loading i {
    color: #1f7a34;
}

.hp-loc-mapwrap {
    position: relative;
    height: 380px;
    background: #e9ecef;
}
/* z-index:1 tạo lớp riêng cho Leaflet (các lớp bên trong dùng z-index 400–1000) → ghim, nút GPS, gợi ý luôn nằm TRÊN bản đồ */
.hp-loc-map {
    position: absolute;
    inset: 0;
    z-index: 1;
}

    .hp-loc-map.leaflet-container {
        background: #e9ecef;
        font: inherit;
    }

    .hp-loc-map .leaflet-control-attribution {
        font-size: 10.5px;
    }
/* Ghim cố định giữa bản đồ — đầu nhọn chạm đúng tâm */
.hp-loc-pin {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -100%);
    z-index: 2;
    pointer-events: none;
    font-size: 40px;
    line-height: 1;
    color: #d63939;
    filter: drop-shadow(0 3px 3px rgba(0,0,0,.35));
    transition: transform .15s ease;
}

.hp-loc-modal.is-dragging .hp-loc-pin {
    transform: translate(-50%, -115%);
}

.hp-loc-pin::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -3px;
    width: 8px;
    height: 4px;
    margin-left: -4px;
    border-radius: 50%;
    background: rgba(0,0,0,.35);
}

.hp-loc-gps {
    position: absolute;
    right: 10px;
    bottom: 26px;
    z-index: 2;
    border: 0;
    border-radius: 20px;
    background: #fff;
    color: #1f7a34;
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

    .hp-loc-gps:disabled {
        opacity: .6;
    }

.hp-loc-hint {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    z-index: 2;
    background: rgba(33,37,41,.78);
    color: #fff;
    font-size: 12.5px;
    padding: 4px 12px;
    border-radius: 14px;
    pointer-events: none;
    white-space: nowrap;
}

.hp-loc-loading {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f1f3f5;
    color: #555;
    font-size: 14px;
    text-align: center;
}

    .hp-loc-loading[hidden] {
        display: none;
    }

.hp-loc-info {
    padding: 10px 14px 12px;
}

.hp-loc-addr {
    font-weight: 600;
    color: #222;
    font-size: 14.5px;
}

.hp-loc-coord {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.hp-loc-use {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13.5px;
    color: #333;
    cursor: pointer;
}

    .hp-loc-use[hidden] {
        display: none;
    }

.hp-loc-error {
    margin-top: 8px;
    font-size: 13px;
    color: #c92a2a;
}

    .hp-loc-error[hidden] {
        display: none;
    }

@media (max-width: 575.98px) {
    .hp-loc-mapwrap {
        height: calc(100vh - 330px);
        min-height: 260px;
    }
}

/* ----- Dòng "Vị trí giao hàng" trên Hồ sơ / Giỏ hàng / Vị trí cửa hàng ----- */
.hp-loc-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8f9fa;
    border: 1px dashed #ced4da;
    font-size: 14px;
}

    .hp-loc-status.is-set {
        background: #eef8f1;
        border: 1px solid #b7e1c3;
    }

.hp-loc-status-text {
    flex: 1 1 200px;
    min-width: 0;
    color: #555;
}

.hp-loc-status.is-set .hp-loc-status-text {
    color: #1f5f2c;
}

.hp-loc-status-text i {
    margin-right: 4px;
}

.hp-loc-status-btn {
    border: 1px solid #1f7a34;
    background: #fff;
    color: #1f7a34;
    border-radius: 18px;
    padding: 5px 14px;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
}

    .hp-loc-status-btn:hover {
        background: #1f7a34;
        color: #fff;
    }

/* Giỏ hàng: dòng vị trí nằm trong form giao hàng */
.hp-cart-box .hp-loc-status {
    margin: 0 0 12px;
}
