/* ===================================================
   Map Địa Điểm – Frontend CSS
   =================================================== */
.page-id-46 .mdd-sidebar,
.page-id-18681 .mdd-sidebar,
.page-id-18683 .mdd-sidebar,
.page-id-102311 .rating-section{
    display: none !important;
}
/* ----- Wrapper ngoài: phá vỡ giới hạn max-width của theme ----- */
.mdd-fullwidth-wrap {
    width: 100%;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
}

/* ----- Container chính ----- */
.mdd-frontend-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #ddd;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-radius: 10px;
    font-family: Roboto, sans-serif;
    /* height được set qua inline style của shortcode */
}

/* ----- Sidebar ----- */
.mdd-sidebar {
    flex: 0 0 310px;
    width: 310px;
    min-width: 220px;
    max-width: 360px;
    overflow-y: auto;
    padding: 15px 5px;
    border-right: 1px solid #eee;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fafafa;
    scrollbar-width: thin;
    scrollbar-color: #ddd #f5f5f5;
}
.mdd-sidebar::-webkit-scrollbar { width: 5px; }
.mdd-sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.mdd-sidebar::-webkit-scrollbar-track { background: #f5f5f5; }

/* ----- Map area ----- */
.mdd-map {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
}

/* ----- Khu vực dropdown thành phố ----- */
.mdd-city-filter-wrap {
    margin-bottom: 12px;
}
.mdd-city-filter-wrap label {
    color: #666;
    font-size: 16px;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

/* ----- Danh sách địa điểm ----- */
.mdd-list {
    flex: 1;
    overflow-y: auto;
}

.mdd-location-item {
    padding: 11px 13px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.18s, border-left 0.15s;
    border-left: 3px solid transparent;
}
.mdd-location-item:last-child { border-bottom: none; }
.mdd-location-item:hover {
    background-color: #fff5ef;
    border-left-color: #f3741f;
}

.mdd-location-title {
    color: #f3741f;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 3px;
    line-height: 1.35;
}

.mdd-location-address {
    font-size: 14px;
    color: #555;
    line-height: 1.45;
}

/* ===================================================
   MapLibre Popup Styling
   =================================================== */
.maplibregl-popup-content {
    padding: 0 !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10) !important;
    overflow: hidden;
    min-width: 280px;
    max-width: 360px !important;
    max-height: 82vh;
    overflow-y: auto;
    font-family: Roboto, sans-serif;
    scrollbar-width: thin;
    scrollbar-color: #ddd #fff;
}
.maplibregl-popup-content::-webkit-scrollbar { width: 4px; }
.maplibregl-popup-content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.maplibregl-popup-close-button {
    font-size: 28px !important;
    color: #555 !important;
    padding: 4px 10px !important;
    line-height: 1 !important;
    background: transparent !important;
    z-index: 10;
    position: absolute;
    right: 6px;
    top: 4px;
    min-height: auto;
    margin: 0;
}
.maplibregl-popup-close-button:hover {
    color: #c00 !important;
    background: transparent !important;
}

/* ----- Popup nội dung ----- */
.mdd-popup-inner {
    padding: 14px 16px 12px;
    font-family: Roboto, sans-serif;
}
.mdd-popup-title {
    color: #f3741f;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
    margin-bottom: 9px;
    padding-right: 28px; /* tránh đè nút close */
}
.mdd-popup-info {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.5;
}
.mdd-popup-info strong {
    color: #444;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: block;
    margin-bottom: 4px;
}

/* ----- Icon & Helper Classes ----- */
.mdd-popup-inner i.fa-solid,
.mdd-popup-inner i.fa-regular {
    font-family: "Font Awesome 6 Free";
    font-style: normal;
}
.mdd-popup-inner i.fa-solid  { font-weight: 900; }
.mdd-popup-inner i.fa-regular { font-weight: 400; }
.modal-icon-width {
    width: 16px;
    display: inline-block;
    text-align: center;
    flex-shrink: 0;
}
.me-2 { margin-right: 0.45rem !important; }
.text-primary-custom { color: #f3741f !important; }
.mdd-popup-branch-label { font-weight: 700; color: #333; }

/* ----- Giờ hoạt động ----- */
.mdd-popup-hours-list {
    max-height: 120px;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: #ddd #fff;
}
.mdd-popup-hours-list::-webkit-scrollbar { width: 3px; }
.mdd-popup-hours-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
.mdd-popup-hour-item {
    font-size: 14px;
    line-height: 1.5;
    margin-top: 3px;
}
.mdd-popup-address-item {
    margin-top: 5px;
    line-height: 1.5;
    font-size: 14px;
}

/* ----- Tổng đài / Website ----- */
.mdd-popup-contact-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px !important;
    line-height: 1.5;
    font-size: 14px;
}
.mdd-popup-contact-link {
    color: #f3741f;
    font-weight: 600;
    text-decoration: none;
}
.mdd-popup-contact-link:hover {
    color: #c00;
    text-decoration: underline;
}

/* ----- Actions ----- */
.mdd-popup-actions {
    margin-top: 10px;
    display: flex;
    gap: 7px;
}
.mdd-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: Roboto, sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    flex: 1;
    border: none;
    padding: 7px 10px;
    cursor: pointer;
    transition: opacity 0.15s;
    line-height: 1.3;
}
.mdd-popup-btn:hover { opacity: 0.82; }
.mdd-popup-btn-nav { background-image: linear-gradient(90deg, #f3741f 0%, #f8ad7a 100%); color: #fff; }
.mdd-popup-btn-img { background: #333; color: #fff; }

/* ===================================================
   Modal thư viện ảnh
   =================================================== */
.mdd-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 999999;
    justify-content: center;
    align-items: center;
}
.mdd-modal-content {
    position: relative;
    max-width: 820px;
    width: 92%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0,0,0,0.55);
    text-align: center;
}
.mdd-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}
.mdd-modal-body { position: relative; padding: 18px; }
.mdd-modal-img {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}
.mdd-modal-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.18);
    color: #fff;
    border: none;
    font-size: 22px;
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}
.mdd-modal-btn:hover { background: rgba(255,255,255,0.45); }
.mdd-modal-prev { left: 8px; }
.mdd-modal-next { right: 8px; }

/* custom */
.maplibregl-popup-close-button{
    min-height: auto;
    margin: 0;
}
.maplibregl-ctrl-group button{
    margin-right: 0;
}
/* custom */

/* ===================================================
   Responsive – Tablet (769px – 1024px)
   =================================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .mdd-sidebar {
        flex: 0 0 240px;
        width: 240px;
        min-width: 200px;
        padding: 12px 10px;
    }
    .mdd-location-title { font-size: 13px; }
    .mdd-location-address { font-size: 12px; }
}

/* ===================================================
   Responsive – Mobile (≤ 768px)
   =================================================== */
@media (max-width: 768px) {
    .mdd-frontend-container {
        flex-direction: column;
        border-radius: 8px;
        height: auto !important; /* bỏ height cố định trên mobile */
    }

    /* Map hiện trước, sidebar bên dưới */
    .mdd-frontend-container {
        flex-direction: column-reverse;
    }

    .mdd-sidebar {
        flex: none;
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        height: 260px;
        border-right: none;
        border-top: 1px solid #eee;
        padding: 10px 12px;
        background: #fafafa;
        overflow-y: auto;
    }

    .mdd-map {
        width: 100% !important;
        height: 320px !important;
        flex: none;
    }

    .mdd-location-title { font-size: 13px; }
    .mdd-location-address { font-size: 12px; }

    .maplibregl-popup-content {
        min-width: 240px;
        max-width: 280px !important;
        max-height: 70vh;
    }
    .mdd-popup-title { font-size: 15px; }
    .mdd-popup-info { font-size: 13px; }
}

/* ===================================================
   Responsive – Small mobile (≤ 480px)
   =================================================== */
@media (max-width: 480px) {
    .mdd-sidebar { height: 450px; }
    .mdd-map { height: 450px !important; }

    .maplibregl-popup-content {
        min-width: 290px;
        max-width: 310px !important;
    }
    .mdd-popup-actions { flex-direction: column; gap: 5px; }
}

