/* ==========================================================================
   GIAO DIỆN PLUGIN ĐỊA ĐIỂM ĂN UỐNG V1.0
   ========================================================================== */

/* --- 1. Biến toàn cục cho Font & Màu sắc --- */
:root {
    --chv-font-family: 'Be Vietnam Pro', sans-serif;
    --chv-primary-color: #d32f2f;  /* Màu đỏ đậm cho ẩm thực */
    --chv-primary-color-hover: #b71c1c;
    --chv-text-color: #212121;
    --chv-subtle-text-color: #757575;
    --chv-border-color: #e0e0e0;
    --chv-background-color: #f5f5f5;
    --chv-white-color: #ffffff;
    --chv-star-color: #ffb300;
    --chv-box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    --chv-border-radius: 8px;
}

/* --- 2. Style chung --- */
.chv-filter-form, .chv-location-list, .chv-pagination, .chv-location-details-box {
    font-family: var(--chv-font-family);
    color: var(--chv-text-color);
}

/* --- 3. Style cho Form Lọc --- */
.chv-filter-form {
    background-color: var(--chv-white-color);
    padding: 25px;
    border: 1px solid var(--chv-border-color);
    border-radius: var(--chv-border-radius);
    margin-bottom: 40px;
    box-shadow: var(--chv-box-shadow);
}
.chv-filter-form form { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.chv-filter-form .filter-item { display: flex; flex-direction: column; flex: 1 1 200px; }
.chv-filter-form label { font-weight: 500; margin-bottom: 8px; font-size: 0.9em; }
.chv-filter-form select, .chv-filter-form button { padding: 12px; border: 1px solid var(--chv-border-color); border-radius: 6px; font-size: 1em; background: var(--chv-white-color); }
.chv-filter-form button { background-color: var(--chv-primary-color); color: var(--chv-white-color); border: none; cursor: pointer; transition: background-color 0.3s ease; font-weight: 700; }
.chv-filter-form button:hover { background-color: var(--chv-primary-color-hover); }

/* --- 4. Style cho Bản đồ --- */
#chv-interactive-map { height: 450px; width: 100%; margin-bottom: 40px; border-radius: var(--chv-border-radius); border: 1px solid var(--chv-border-color); box-shadow: var(--chv-box-shadow); }

/* --- 5. Style cho danh sách địa điểm (V2 - có hiệu ứng hover) --- */
.chv-location-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; padding: 0; margin: 20px 0; }
.chv-location-item { border: 1px solid var(--chv-border-color); border-radius: var(--chv-border-radius); overflow: hidden; background-color: var(--chv-white-color); box-shadow: var(--chv-box-shadow); transition: box-shadow 0.3s ease, transform 0.3s ease; }
.chv-location-item:hover { box-shadow: 0 8px 25px rgba(0,0,0,0.12); transform: translateY(-5px); }
.chv-location-item-link { text-decoration: none; color: inherit; display: block; }
.chv-location-item-image { width: 100%; height: 180px; background-color: #f0f0f0; overflow: hidden; } /* Thêm overflow: hidden */
.chv-location-item-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; } /* Thêm transition */
.chv-location-item:hover .chv-location-item-image img { transform: scale(1.05); } /* Hiệu ứng zoom ảnh */
.chv-location-item-content { padding: 20px; }
.chv-location-item-title { font-size: 1.25em; margin: 0 0 10px 0; color: var(--chv-text-color); font-weight: 700; transition: color 0.3s ease; } /* Thêm transition */
.chv-location-item:hover .chv-location-item-title { color: var(--chv-primary-color); } /* Hiệu ứng đổi màu tiêu đề */
.chv-location-item-address { font-size: 0.9em; color: var(--chv-subtle-text-color); margin: 0 0 10px 0; }
.chv-location-item-excerpt { font-size: 0.95em; color: var(--chv-subtle-text-color); line-height: 1.6; }

/* --- 6. Style cho Phân trang --- */
.chv-pagination { margin-top: 40px; text-align: center; }
.chv-pagination .page-numbers { display: inline-block; padding: 10px 16px; margin: 0 4px; border: 1px solid var(--chv-border-color); border-radius: 6px; text-decoration: none; color: var(--chv-primary-color); background-color: var(--chv-white-color); transition: background-color 0.3s ease, color 0.3s ease; font-weight: 500; }
.chv-pagination .page-numbers:hover { background-color: #f5f5f5; }
.chv-pagination .page-numbers.current { background-color: var(--chv-primary-color); border-color: var(--chv-primary-color); color: var(--chv-white-color); cursor: default; }
.chv-pagination .page-numbers.dots { border: none; background: none; }

/* --- 7. Style cho khung thông tin chi tiết --- */
.chv-location-details-box { margin-top: 40px; padding: 30px; border-radius: var(--chv-border-radius); background-color: var(--chv-background-color); }
.chv-location-details-box h2 { margin-top: 0; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--chv-border-color); font-weight: 700; }
.chv-location-details-box ul { list-style: none; padding: 0; margin: 0; }
.chv-location-details-box ul li { padding: 12px 0; border-bottom: 1px solid var(--chv-border-color); display: flex; flex-wrap: wrap; align-items: center; }
.chv-location-details-box ul li:last-child { border-bottom: none; }
.chv-location-details-box ul li strong { flex: 0 0 130px; margin-right: 15px; color: var(--chv-text-color); font-weight: 500; }

/* --- 8. Style cho Rating & Review --- */
#commentform .comment-form-rating { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
#commentform .comment-form-rating .stars-rating { display: inline-block; border: none; unicode-bidi: bidi-override; direction: rtl; }
#commentform .comment-form-rating .stars-rating > input { display: none; }
#commentform .comment-form-rating .stars-rating > label { font-size: 2.2em; color: #ddd; cursor: pointer; transition: color 0.2s; margin: 0; padding: 0 2px; }
#commentform .comment-form-rating .stars-rating > input:checked ~ label, #commentform .comment-form-rating .stars-rating:not(:checked) > label:hover, #commentform .comment-form-rating .stars-rating:not(:checked) > label:hover ~ label { color: var(--chv-star-color); }
.comment-rating, .stars-average { font-size: 1.2em; color: var(--chv-star-color); }
.comment-rating .star-empty, .stars-average .star-empty { color: #ddd; }
.average-rating-display .rating-text { margin-left: 10px; font-weight: normal; color: var(--chv-subtle-text-color); font-size: 0.9em; vertical-align: middle; }

/* --- 9. Responsive cho thiết bị di động --- */
@media (max-width: 600px) {
    .chv-filter-form form {
        flex-direction: column;
        align-items: stretch;
    }
}

/* --- 10. Style cho Popup trên Bản đồ --- */
.chv-map-popup {
    font-family: var(--chv-font-family);
    max-width: 280px;
}
.chv-map-popup .popup-title {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-weight: 700;
}
.chv-map-popup .popup-title a {
    text-decoration: none;
    color: var(--chv-primary-color);
}
.chv-map-popup .popup-body {
    display: flex;
    gap: 10px;
}
.chv-map-popup .popup-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}
.chv-map-popup .popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}
.chv-map-popup .popup-details {
    font-size: 0.9em;
    color: var(--chv-subtle-text-color);
}
.chv-map-popup .popup-address {
    margin-bottom: 5px;
}
.chv-map-popup .popup-rating {
    font-size: 1.1em;
    color: var(--chv-star-color);
}
.leaflet-popup-content {
    margin: 15px !important;
    width: auto !important;
}
.leaflet-popup-content-wrapper {
    border-radius: var(--chv-border-radius) !important;
}

/* --- THÊM MỚI: Style cho bảng đánh giá chi tiết trên single page --- */
.chv-location-details-box .comment-rating-details { 
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--chv-border-color);
}
.comment-rating-details h4 { margin-top: 0; }
.comment-rating-details .rating-item { display: grid; grid-template-columns: 100px 1fr 50px; align-items: center; gap: 15px; margin-bottom: 8px; font-size: 0.9em; }
.comment-rating-details .rating-item:last-child { margin-bottom: 0; }
.comment-rating-details .rating-label { font-weight: 500; }
.comment-rating-details .rating-bar { width: 100%; height: 10px; background-color: #e0e0e0; border-radius: 5px; overflow: hidden; }
.comment-rating-details .rating-score { display: block; height: 100%; background-color: var(--chv-star-color); border-radius: 5px; }
.comment-rating-details .rating-value { font-weight: 700; text-align: right; }

/* --- THÊM MỚI: Style cho thanh trượt trên form frontend --- */
form.acf-form .acf-field[data-type="range"] .acf-range-wrap {
    display: flex;
    align-items: center;
    gap: 15px;
}
form.acf-form .acf-field[data-type="range"] input[type="range"] {
    flex-grow: 1;
}
form.acf-form .acf-field[data-type="range"] .acf-range-value {
    font-weight: bold;
    color: var(--chv-primary-color);
    min-width: 50px;
    text-align: right;
}