﻿.leaflet-control-zoom {
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    border: none;
    border-radius: 2px;
    overflow: hidden;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    background-color: white;
    color: #444;
    font-size: 20px;
    width: 32px;
    height: 32px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    border-bottom: 1px solid #ccc;
}

.leaflet-control-zoom-out {
    border-bottom: none;
}

    /* Hover giống Google */
    .leaflet-control-zoom-in:hover,
    .leaflet-control-zoom-out:hover {
        background-color: #f1f1f1;
    }


.leaflet-control-custom {
    background-color: white;
    background-size: cover;
    padding: 2px;
    box-shadow: 0 0 3px rgba(0,0,0,0.3);
    border-radius: 4px;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 3px 9px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .tag:hover {
        background-color: #f8f8f8;
    }

    .tag.active {
        border-color: #e10000;
        color: #e10000;
        background-color: #fff;
        font-weight: 500;
    }

.store-list {
    border-radius: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
    background-color: #fff;
}

.store-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #fdfdfd;
}

    .store-item .badge {
        display: inline-block;
        background-color: var(--accent-color);
        color: #fff;
        font-size: 13px;
        padding: 4px 10px;
        border-radius: 999px;
        margin-right: 4px;
        margin-bottom: 4px;
        font-weight: 500;
    }

    .store-item p {
        margin: 8px 0 0 0;
        font-size: 14px;
    }

.box-group-csyt {
    max-height: 80vh; /* Đặt chiều cao tối đa */
    overflow-y: auto; /* Cho phép cuộn dọc nếu nội dung quá dài */
    padding: 10px; /* Khoảng cách trong */
    border: 1px solid #ccc; /* Viền để dễ nhìn */
    box-sizing: border-box; /* Đảm bảo padding và border không ảnh hưởng đến kích thước */
    margin-bottom: 30px !important;
}

.store-list .active {
    background-color: var(--secondary-color);
}

.leaflet-touch .leaflet-bar {
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.leaflet-control-zoom {
    border-radius: 6px;
}

.leaflet-touch .leaflet-bar a {
    width: 26px;
    height: 26px;
    line-height: 26px;
}

.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
    font-size: 17px;
}
/* Map Modal — scoped styles (prefix: map-) */
.modal-lg {
    max-width: 1200px;
}

.map-modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.16);
}

.map-modal-header {
    background: linear-gradient(135deg, #4753bf 0%, #3a44a0 100%);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6;
}

.map-modal-header--duoc {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
}

.map-modal-header-icon {
    width: 24px;
    height: 20px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    flex-shrink: 0;
}

.map-modal-header-text {
    flex: 1;
    min-width: 0;
}

.map-modal-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}

.map-modal-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
}

.map-modal-close {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    font-size: 0.8rem;
}

    .map-modal-close:hover {
        background: rgba(255, 255, 255, 0.28);
    }

.map-modal-body {
    padding: 16px 20px 20px;
    background: #f8fafc;
}

.map-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    margin: 16px 0 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .map-section-title i {
        color: #4753bf;
        font-size: 0.8rem;
    }

.map-info-section {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e9edf2;
    overflow: hidden;
}

.map-info-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid #f1f5f9;
}

    .map-info-row:last-child {
        border-bottom: none;
    }

.map-info-label {
    flex: 0 0 155px;
    color: #64748b;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .map-info-label i {
        color: #94a3b8;
        font-size: 0.72rem;
        width: 13px;
        text-align: center;
        flex-shrink: 0;
    }

.map-info-value {
    flex: 1;
    color: #1e293b;
    font-size: 0.855rem;
    line-height: 1.5;
    word-break: break-word;
}

.map-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

    .map-grid-2col .map-info-row {
        flex-direction: column;
        gap: 2px;
        border-right: 1px solid #f1f5f9;
        align-items: flex-start;
    }

        .map-grid-2col .map-info-row:nth-child(even) {
            border-right: none;
        }

        .map-grid-2col .map-info-row.map-grid-full {
            grid-column: 1 / -1;
            flex-direction: row;
            align-items: baseline;
            border-right: none;
            gap: 8px;
        }

            .map-grid-2col .map-info-row.map-grid-full .map-info-label {
                flex: 0 0 155px;
            }

    .map-grid-2col .map-info-label {
        flex: unset;
        font-size: 0.72rem;
        color: #94a3b8;
    }

    .map-grid-2col .map-info-value {
        font-size: 0.845rem;
    }

.map-badge-blue {
    display: inline-block;
    background: #eef2ff;
    color: #4753bf;
    font-weight: 600;
    border-radius: 5px;
    padding: 1px 8px;
    font-size: 0.8rem;
}

.map-badge-teal {
    display: inline-block;
    background: #f0fdfa;
    color: #0f766e;
    font-weight: 600;
    border-radius: 5px;
    padding: 1px 8px;
    font-size: 0.8rem;
}

.map-text-warning {
    color: #b45309;
}

.map-text-danger {
    color: #b91c1c;
}

.map-modal-table {
    border-collapse: collapse;
    font-size: 0.8rem;
    border-radius: 8px;
    overflow: hidden;
}

    .map-modal-table thead th {
        background: #4753bf;
        color: #fff;
        font-weight: 600;
        padding: 9px 10px;
        text-align: center;
        border: none;
        white-space: nowrap;
    }

    .map-modal-table tbody tr:nth-child(odd) {
        background: #f8fafc;
    }

    .map-modal-table tbody tr:nth-child(even) {
        background: #fff;
    }

    .map-modal-table tbody tr:hover {
        background: #eef2ff;
        transition: background 0.15s;
    }

    .map-modal-table tbody td {
        padding: 7px 10px;
        border-bottom: 1px solid #f1f5f9;
        color: #334155;
        vertical-align: middle;
        text-align: center;
    }

        .map-modal-table tbody td:nth-child(2),
        .map-modal-table tbody td:nth-child(3) {
            text-align: left;
        }

.map-modal-footer {
    padding: 10px 20px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
}

.map-modal-btn-close {
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    padding: 6px 18px;
    font-size: 0.855rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

    .map-modal-btn-close:hover {
        background: #e2e8f0;
        color: #1e293b;
    }

@@media (max-width: 575px) {
    .map-info-label {
        flex: 0 0 110px;
    }

    .map-grid-2col {
        grid-template-columns: 1fr;
    }

        .map-grid-2col .map-info-row {
            border-right: none;
            flex-direction: row;
            align-items: baseline;
            gap: 8px;
        }

        .map-grid-2col .map-info-label {
            flex: 0 0 110px;
        }

    .map-modal-body {
        padding: 12px 14px 16px;
    }
}

/* ── Phân trang nhân sự ── */
.map-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 2px 2px;
}

.map-page-info {
    font-size: 0.78rem;
    color: #64748b;
}

.map-page-nav {
    display: flex;
    align-items: center;
    gap: 3px;
}

.map-page-nums {
    display: flex;
    gap: 3px;
}

.map-page-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .map-page-btn:hover:not(:disabled) {
        background: #eef2ff;
        border-color: #4753bf;
        color: #4753bf;
    }

    .map-page-btn.active {
        background: #4753bf;
        border-color: #4753bf;
        color: #fff;
        font-weight: 700;
    }

    .map-page-btn:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }
/* ── Popup bản đồ ── */
.map-popup-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    max-width: 220px;
    word-break: break-word;
}

.map-popup-name--active {
    color: #4753bf;
}

.map-popup-type {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

/* Popup bình thường */
.map-popup-normal .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.map-popup-normal .leaflet-popup-content {
    margin: 8px 12px;
}

/* Popup đang được chọn — highlight */
.map-popup-active .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 0 0 3px #4753bf, 0 4px 16px rgba(71, 83, 191, 0.35) !important;
    background: #fff;
    animation: map-popup-pulse 0.3s ease;
    min-width: 275px;
    min-height: 36px;
}

/* Căn giữa nội dung popup active */
.map-popup-active .leaflet-popup-content {
    margin: 0;
    width: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 28px 8px 14px;
    box-sizing: border-box;
}

    /* Căn giữa hàng icon + tên */
    .map-popup-active .leaflet-popup-content > div {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 100%;
        text-align: center;
    }

        .map-popup-active .leaflet-popup-content > div i {
            flex-shrink: 0;
            margin-right: 0;
        }

    .map-popup-active .leaflet-popup-content .map-popup-name {
        max-width: 200px;
        text-align: left;
    }

.map-popup-active .leaflet-popup-tip {
    background: #4753bf;
}

/* Nút đóng popup toàn bộ — fallback CSS (JS cũng set trực tiếp) */
.map-popup-active .leaflet-popup-close-button {
    color: #e53e3e !important;
    font-weight: 700 !important;
    font-size: 18px !important;
}

@@keyframes map-popup-pulse {
    0% {
        transform: scale(0.92);
        opacity: 0.7;
    }

    60% {
        transform: scale(1.04);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    padding: 8px 14px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all .25s ease;
}

    .btn-action .icon {
        width: 26px;
        height: 26px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: rgba(255,255,255,0.25);
    }

/* Chỉ đường */
.btn-route {
    background: #dc3545;
    color: white;
}

    .btn-route:hover {
        background: #bb2d3b;
        transform: translateY(-1px);
    }

/* Xem chi tiết */
.btn-detail {
    background: #0d6efd;
    color: white;
}

    .btn-detail:hover {
        background: #0b5ed7;
        transform: translateY(-1px);
    }

/* Liên hệ */
.btn-call {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

    .btn-call:hover {
        background: #e9ecef;
    }
/* ================================================================
   RESPONSIVE MODAL — mapKcbDetailModal & mapKddDetailModal
   ================================================================ */

/* ── Desktop: giới hạn lại modal-lg cho hợp lý ── */
.modal-lg {
    max-width: 860px;
}

/* ── Tablet (≤ 767px) ── */
@media (max-width: 767px) {
    .modal-lg {
        max-width: 98vw;
        margin: 0.5rem auto;
    }

    /* Header gọn lại */
    .map-modal-header {
        padding: 10px 12px;
        gap: 10px;
    }

    .map-modal-header-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .map-modal-title {
        font-size: 0.88rem;
    }

    /* Body padding nhỏ hơn */
    .map-modal-body {
        padding: 12px 12px 16px;
    }

    /* ── Row 2 cột (label+value+label+value) → stack thành 2 hàng ── */
    .map-info-row {
        flex-wrap: wrap;
        gap: 4px 8px;
    }

    .map-info-label {
        flex: 0 0 130px;
        font-size: 0.76rem;
    }

    .map-info-value {
        flex: 1;
        min-width: 0;
        font-size: 0.82rem;
    }
}

/* ── Mobile (≤ 575px) — ghi đè lại toàn bộ ── */
@media (max-width: 575px) {
    /* Dialog chiếm gần full màn hình */
    .modal-dialog.modal-lg {
        max-width: 100%;
        margin: 0;
        min-height: 100%;
        align-items: flex-end;
    }

    .modal-content.map-modal-content {
        border-radius: 18px 18px 0 0;
        max-height: 92dvh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    /* Body cuộn độc lập */
    .map-modal-body {
        padding: 10px 10px 14px;
        overflow-y: auto;
        flex: 1 1 auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Header */
    .map-modal-header {
        padding: 10px 10px;
        gap: 8px;
        flex-shrink: 0;
    }

    .map-modal-header-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        font-size: 0.9rem;
    }

    .map-modal-title {
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .map-modal-close {
        width: 28px;
        height: 28px;
    }

    /* Footer */
    .map-modal-footer {
        padding: 8px 12px;
        flex-shrink: 0;
    }

    /* Section title */
    .map-section-title {
        font-size: 0.68rem;
        margin: 12px 0 5px;
    }

    /* ── Mỗi info-row trên mobile: stack label trên, value dưới ── */
    .map-info-row {
        flex-direction: column;
        gap: 2px;
        padding: 7px 10px;
    }

    .map-info-label {
        flex: none;
        width: 100%;
        font-size: 0.7rem;
        color: #94a3b8;
        gap: 4px;
    }

    .map-info-value {
        width: 100%;
        font-size: 0.83rem;
        padding-left: 0;
    }

    /* ── Badge ── */
    .map-badge-blue,
    .map-badge-teal {
        font-size: 0.75rem;
        padding: 1px 6px;
    }

    /* ── Bảng nhân sự: scroll ngang + font nhỏ hơn ── */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .map-modal-table {
        min-width: 520px;
        font-size: 0.75rem;
    }

        .map-modal-table thead th {
            padding: 7px 8px;
            font-size: 0.72rem;
        }

        .map-modal-table tbody td {
            padding: 6px 8px;
            font-size: 0.75rem;
        }

    /* ── Phân trang ── */
    .map-pagination {
        justify-content: center;
        gap: 5px;
    }

    .map-page-btn {
        min-width: 27px;
        height: 27px;
        font-size: 0.75rem;
    }

    /* ── Button đóng ── */
    .map-modal-btn-close {
        width: 100%;
        text-align: center;
        padding: 8px;
        font-size: 0.82rem;
    }
}

/* ── Rất nhỏ (≤ 380px, iPhone SE…) ── */
@media (max-width: 380px) {
    .map-modal-title {
        font-size: 0.76rem;
    }

    .map-info-label {
        font-size: 0.67rem;
    }

    .map-info-value {
        font-size: 0.79rem;
    }

    .map-modal-table {
        min-width: 460px;
    }
}