/* TOÀN BỘ CSS CHO CỬA SỔ CHI TIẾT XÃ - KHÔNG PHỤ THUỘC LEAFLET */
.formchitietxaphuong {
    width: 100% !important;
    max-width: 992px !important;
    /* Font chữ cơ sở: tối thiểu 14px, tối ưu 1.2vw, tối đa 18px */
    font-size: clamp(14px, 1.1vw, 18px) !important;
}
/* Khi popup ở trạng thái phóng to toàn màn hình */
.custom-window.is-maximized {
    /* Tăng font chữ lên để hài hòa với không gian rộng */
    font-size: clamp(16px, 1.5vw, 22px) !important;
}

/* Phóng to các tiêu đề ban lãnh đạo, thông tin khác */
.custom-window.is-maximized b {
    font-size: 1.1em;
}

/* Phóng to các nút bấm Dẫn đường/Quy hoạch */
.custom-window.is-maximized button {
    padding: 15px !important;
    font-size: 1.1em !important;
}
/* 1. Khung cửa sổ chính */
.custom-window {
    position: fixed;
    z-index: 99999 !important;
    background: #fff;
    height: 90%;
    min-width: 26vw;
    border: 2px solid #da251d;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    overflow: hidden;
   
    flex-direction: column;
    pointer-events: auto;
}


/* 2. Tiêu đề (Vùng nắm kéo thả) */
.custom-window__header {
    cursor: move;
    background: linear-gradient(177deg, #ffff54 0%, #b31d17 100%);
    padding: 12px 15px;
    user-select: none;
    border-bottom: 1px solid #da251d;
}

.window-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

.window-header-content b {
    /*text-shadow: 1px 1px 2px #000;*/
    font-size: 16px;
    color: #f00;
    text-transform: uppercase;
}

/* 3. Thân cửa sổ (Vùng nội dung có thanh cuộn) */
.custom-window__body {
    flex-grow: 1;
    font-size: 1em; /* 1em tương đương với giá trị clamp ở trên */
    overflow-y: auto;
    padding: 0; /* Padding được quản lý bên trong nội dung nạp vào */
    scrollbar-width: thin;
    scrollbar-color: #da251d #f1f1f1;
}

.custom-window__body::-webkit-scrollbar { width: 6px; }
.custom-window__body::-webkit-scrollbar-thumb { background: #da251d; border-radius: 10px; }

/* 4. CSS cho nội dung chi tiết nạp động */
.popup-scroll-container { padding: 15px; }
.popup-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.chart-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 100px;
    background: #fdfdfd;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid #eee;
    padding: 5px;
}

/* 5. Responsive cho thiết bị di động */
@media (max-width: 768px) {
    .formchitietxaphuong {
        /* Trên mobile dùng kích thước font cố định hơn để tránh bị quá bé */
        font-size: 15px !important; 
    }
    
    .popup-info-grid {
        grid-template-columns: 1fr !important; /* Chuyển thành 1 cột trên mobile */
    }
    .custom-window {
        max-width: 95vw;
        right: 0px !important;
        bottom: 0px;
        top: auto !important; /* Ép hiện ở dưới màn hình mobile */
    }
    .popup-info-grid { grid-template-columns: 1fr; }
}