/* =====================================================================
 * Đánh giá tour – trang Tài khoản (dải + popup) & trang chi tiết tour
 * Chỉ dùng 4 màu: --hg-primary, --hg-text, --hg-button, --green-natural
 * ===================================================================== */
.hgr-bar, .hgr-modal, .hgr-section, .hgr-lb {
	--hgr-brand: var(--hg-primary);
	--hgr-button: var(--hg-button);
	--hgr-text: var(--hg-text);
	--hgr-star: var(--hg-star, #FBC421);
	--hgr-ok: var(--green-natural);
	--hgr-muted: color-mix(in srgb, var(--hgr-text) 68%, #fff);
	--hgr-border: color-mix(in srgb, var(--hgr-text) 20%, #fff);
	--hgr-line: color-mix(in srgb, var(--hgr-text) 10%, #fff);
	--hgr-soft: color-mix(in srgb, var(--hgr-brand) 7%, #fff);
	--hga-brand: var(--hg-primary); /* nút .hga-btn dùng chung với trang Tài khoản */
	--hga-button: var(--hg-button);
	color: var(--hgr-text);
}
.hgr-bar *, .hgr-modal *, .hgr-section *, .hgr-lb * { box-sizing: border-box; }

/* ---------- Sao ---------- */
.hgr-stars { position: relative; display: inline-block; flex: none; font-size: 16px; line-height: 1; letter-spacing: 2px; color: var(--hgr-border); white-space: nowrap; }
.hgr-stars::before { content: "★★★★★"; }
.hgr-stars::after { content: "★★★★★"; position: absolute; top: 0; left: 0; width: calc(var(--hgr-v, 0) / 5 * 100%); overflow: hidden; color: var(--hgr-star); }
.hgr-stars.is-lg { font-size: 22px; }

/* =====================================================================
 * Trang Tài khoản – dải đánh giá dưới tour đã hoàn thành
 * ===================================================================== */
.hgr-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px 16px; border-top: 1px dashed var(--hgr-border); background: var(--hgr-soft); }
.hgr-bar-text { min-width: 0; }
.hgr-bar-text b { display: block; font-size: 15px; line-height: 1.4; }
.hgr-bar-text small { display: block; color: var(--hgr-muted); font-size: 13px; line-height: 1.45; }
.hgr-bar-rated { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 3px; }
.hgr-bar-rated em { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-style: normal; font-weight: 600; line-height: 1.5; }
.hgr-bar-rated em.is-wait { background: color-mix(in srgb, var(--hgr-text) 8%, #fff); }
.hgr-bar-rated em.is-ok { 
    background: color-mix(in srgb, var(--hgr-ok) 18%, #fff); 
    color: var(--hgr-brand); 
}
.hga-account .hgr-bar .hga-btn { gap: 8px; height: 42px; min-width: 0; padding: 0 20px; font-size: 15px; }
.hgr-bar .hga-btn .hga-ic { width: 18px; height: 18px; fill: currentColor; }

/* =====================================================================
 * Popup viết đánh giá
 * ===================================================================== */
.hgr-lock, .hgr-lock body { overflow: hidden; }
.hgr-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 24px; background: color-mix(in srgb, var(--hgr-text) 55%, transparent); opacity: 0; transition: opacity .2s; }
.hgr-modal[hidden] { display: none; }
.hgr-modal.is-open { opacity: 1; }
.hgr-modal-box { position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: hidden auto; padding: 30px 32px 26px; border-radius: 20px; background: #fff; box-shadow: 0 10px 40px color-mix(in srgb, var(--hgr-text) 18%, transparent); transform: translateY(14px) scale(.98); transition: transform .25s ease; overscroll-behavior: contain; }
.hgr-modal.is-open .hgr-modal-box { transform: none; }
.hgr-modal .hgr-close { position: absolute; top: 14px; right: 14px; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0; padding: 0; min-height: 0; border: 0 !important; border-radius: 50%; background: var(--hgr-soft) !important; color: var(--hgr-text) !important; box-shadow: none; cursor: pointer; }
.hgr-modal .hgr-close svg { width: 18px; height: 18px; }

.hgr-form-head { padding-right: 36px; margin-bottom: 18px; }
.hgr-form-head h2 { margin: 0 0 4px; color: var(--hgr-brand); font-size: 24px; font-weight: 700; line-height: 1.3; }
.hgr-form-tour { margin: 0; color: var(--hgr-muted); font-size: 14px; line-height: 1.45; }

/* Chọn sao */
.hgr-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 18px; padding: 16px; border-radius: 14px; background: var(--hgr-soft); text-align: center; }
.hgr-pick-stars { display: flex; gap: 6px; }
.hgr-pick-stars label { position: relative; display: block; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hgr-modal .hgr-pick-stars input[type="radio"] { position: absolute !important; top: 0; left: 0; width: 1px !important; height: 1px !important; margin: 0 !important; padding: 0; opacity: 0; pointer-events: none; }
.hgr-pick-stars svg { display: block; width: 40px; height: 40px; fill: #fff; stroke: var(--hgr-border); stroke-width: 1.3; stroke-linejoin: round; transition: transform .15s, fill .15s, stroke .15s; }
.hgr-pick-stars label.is-on svg { fill: var(--hgr-star); stroke: var(--hgr-star); }
.hgr-pick-stars label:hover svg { transform: scale(1.12); }
.hgr-pick-stars input:focus-visible + svg { outline: 2px solid var(--hgr-brand); outline-offset: 2px; border-radius: 6px; }
.hgr-pick-label { min-height: 22px; color: var(--hgr-brand); font-size: 15px; font-weight: 600; }
.hgr-pick-label.is-empty { color: var(--hgr-muted); font-weight: 500; }

.hgr-field { margin-bottom: 16px; }
.hgr-field > label, .hgr-label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; line-height: 1.4; }
.hgr-label small { color: var(--hgr-muted); font-weight: 400; }
.hgr-modal textarea { display: block; width: 100%; min-height: 120px; margin: 0; padding: 12px 14px; border: 1px solid var(--hgr-border) !important; border-radius: 12px; background: #fff !important; box-shadow: none; color: var(--hgr-text) !important; font-size: 15px; line-height: 1.55; resize: vertical; }
.hgr-modal textarea:focus { border-color: var(--hgr-brand) !important; box-shadow: 0 0 0 3px var(--hgr-soft) !important; outline: none; }
.hgr-modal textarea.is-invalid { border-color: var(--hgr-brand) !important; }
.hgr-field-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
.hgr-count, .hgr-hint { color: var(--hgr-muted); font-size: 12px; line-height: 1.4; }
.hgr-hint { display: block; margin-top: 6px; }
.hgr-err { display: block; color: var(--hgr-brand); font-size: 13px; font-weight: 500; line-height: 1.4; }
.hgr-err:empty { display: none; }

/* Ảnh / video */
.hgr-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.hgr-add, .hgr-prev { position: relative; aspect-ratio: 1; margin: 0; border-radius: 10px; overflow: hidden; }
.hgr-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1.5px dashed var(--hgr-border); color: var(--hgr-brand); font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.hgr-add:hover { border-color: var(--hgr-brand); background: var(--hgr-soft); }
.hgr-add svg { width: 26px; height: 26px; }
.hgr-add[hidden] { display: none; }
.hgr-prev { background: var(--hgr-text); }
.hgr-prev img, .hgr-prev video { display: block; width: 100%; height: 100%; object-fit: cover; }
.hgr-prev .hgr-x { position: absolute; top: 4px; right: 4px; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: 0; padding: 0; min-height: 0; border: 0 !important; border-radius: 50%; background: color-mix(in srgb, var(--hgr-text) 75%, transparent) !important; color: #fff !important; font-size: 16px; line-height: 1; box-shadow: none; cursor: pointer; }
.hgr-prev .hgr-tag { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--hgr-text) 75%, transparent); color: #fff; font-size: 11px; font-weight: 600; }

.hgr-msg { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--hgr-brand) 8%, #fff); color: var(--hgr-brand); font-size: 14px; line-height: 1.45; }
.hgr-progress { height: 6px; margin: 0 0 12px; border-radius: 999px; background: var(--hgr-line); overflow: hidden; }
.hgr-progress span { 
    display: block; 
    width: 0; 
    height: 100%; 
    border-radius: inherit; 
    background: var(--hgr-ok); 
    transition: width .2s; 
}
.hgr-modal .hgr-submit { width: 100%; }
.hgr-modal .hgr-submit:disabled { opacity: .8; cursor: wait; }
.hgr-note { margin: 10px 0 0; color: var(--hgr-muted); font-size: 13px; line-height: 1.45; text-align: center; }

.hgr-done { padding: 18px 0 6px; text-align: center; }
.hgr-done[hidden] { display: none; }
.hgr-done-icon { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 72px; 
    height: 72px; 
    margin: 0 auto 16px; 
    border-radius: 50%; 
    background: color-mix(in srgb, var(--hgr-ok) 16%, #fff); 
    color: var(--hgr-brand); 
}
.hgr-done-icon .hga-ic { width: 36px; height: 36px; stroke-width: 2.4; }
.hgr-done h2 { margin: 0 0 8px; color: var(--hgr-brand); font-size: 24px; font-weight: 700; }
.hgr-done p { max-width: 380px; margin: 0 auto 20px; color: var(--hgr-muted); font-size: 15px; line-height: 1.55; }

/* =====================================================================
 * Trang chi tiết tour – mục Đánh giá
 * ===================================================================== */
.hgr-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hgr-section .hgr-write { display: inline-flex; align-items: center; gap: 6px; color: var(--hgr-brand); font-size: 14px; font-weight: 600; text-decoration: none; }
.hgr-section .hgr-write:hover { color: var(--hgr-button); }
.hgr-write .hga-ic { width: 16px; height: 16px; }

.hgr-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 20px; border: 1px dashed var(--hgr-border); border-radius: 14px; text-align: center; }
.hgr-empty p { max-width: 460px; margin: 0; color: var(--hgr-muted); font-size: 15px; line-height: 1.55; }

.hgr-summary { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 8px; padding: 20px 24px; border-radius: 14px; background: var(--hgr-soft); }
.hgr-score { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.hgr-score b { color: var(--hgr-brand); font-size: 46px; font-weight: 700; line-height: 1; }
.hgr-score small { color: var(--hgr-muted); font-size: 14px; }
.hgr-dist { margin: 0; padding: 0; list-style: none; }
.hgr-dist li { display: grid; grid-template-columns: 36px minmax(0, 1fr) 32px; gap: 10px; align-items: center; margin: 0; padding: 3px 0; font-size: 14px; }
.hgr-dist span { 
    color: var(--hgr-text); 
    font-weight: 600; 
    white-space: nowrap; 
}
.hgr-dist span b { 
    color: var(--hgr-star); 
    font-weight: 400; 
}
.hgr-dist i { display: block; height: 8px; border-radius: 999px; background: #fff; overflow: hidden; }
.hgr-dist em { display: block; height: 100%; border-radius: inherit; background: var(--hgr-star); }
.hgr-dist small { color: var(--hgr-muted); text-align: right; }

.hgr-item { padding: 20px 0; border-bottom: 1px solid var(--hgr-line); }
.hgr-item:last-child { border-bottom: 0; }
.hgr-item-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.hgr-item-head > div { flex: 1 1 auto; min-width: 0; }
.hgr-item-head b { display: block; font-size: 15px; line-height: 1.35; }
.hgr-item-head small { display: block; color: var(--hgr-muted); font-size: 13px; line-height: 1.4; }
.hgr-item-avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--hgr-soft); }
.hgr-item-text { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.hgr-item-media { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hgr-section .hgr-thumb { position: relative; display: block; width: 84px; height: 84px; margin: 0; padding: 0; min-height: 0; border: 0 !important; border-radius: 10px; background: var(--hgr-text) !important; overflow: hidden; box-shadow: none; cursor: zoom-in; }
.hgr-thumb img, .hgr-thumb video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: transform .25s; }
.hgr-thumb:hover img, .hgr-thumb:hover video { transform: scale(1.06); }
.hgr-play { position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; transform: translate(-50%, -50%); border-radius: 50%; background: color-mix(in srgb, #fff 90%, transparent); }
.hgr-play::after { content: ""; position: absolute; top: 50%; left: 55%; transform: translate(-50%, -50%); border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent var(--hgr-brand); }

.hgr-more-wrap { margin-top: 16px; text-align: center; }
.hgr-section .hgr-more { display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: 10px 24px; min-height: 0; border: 1px solid var(--hgr-border) !important; border-radius: 999px; background: #fff !important; color: var(--hgr-brand) !important; font-size: 14px; font-weight: 600; line-height: 1.2; text-transform: none; letter-spacing: 0; box-shadow: none; cursor: pointer; }
.hgr-section .hgr-more:hover { border-color: var(--hgr-brand) !important; }
.hgr-section .hgr-more:disabled { opacity: .6; cursor: wait; }

/* Điểm đánh giá đầu trang tour bấm được → cuộn tới mục Đánh giá */
.ctd-rating.is-link { cursor: pointer; }
.ctd-rating.is-link:hover span:not(.ctd-stars) { text-decoration: underline; }

/* ---------- Xem ảnh / video ---------- */
.hgr-lb { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center; padding: 56px 64px; background: color-mix(in srgb, var(--hgr-text) 94%, #000); }
.hgr-lb[hidden] { display: none; }
.hgr-lb-stage { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.hgr-lb-stage img, .hgr-lb-stage video { display: block; max-width: 100%; max-height: 100%; border-radius: 8px; object-fit: contain; }
.hgr-lb button { position: absolute; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0; min-height: 0; border: 0 !important; border-radius: 50%; background: color-mix(in srgb, #fff 14%, transparent) !important; color: #fff !important; box-shadow: none; cursor: pointer; }
.hgr-lb button:hover { background: color-mix(in srgb, #fff 26%, transparent) !important; }
.hgr-lb-close { top: 12px; right: 12px; width: 40px; height: 40px; font-size: 26px; line-height: 1; }
.hgr-lb-prev, .hgr-lb-next { top: 50%; width: 44px; height: 44px; transform: translateY(-50%); }
.hgr-lb-prev { left: 12px; } .hgr-lb-next { right: 12px; }
.hgr-lb-prev svg, .hgr-lb-next svg { width: 22px; height: 22px; }
.hgr-lb-prev[hidden], .hgr-lb-next[hidden] { display: none; }
.hgr-lb-count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; }

/* =====================================================================
 * Điện thoại
 * ===================================================================== */
@media (max-width: 849px) {
	.hgr-modal { align-items: flex-end; padding: 0; }
	.hgr-modal-box { max-width: none; max-height: 92vh; max-height: 92dvh; padding: 24px 18px 20px; border-radius: 20px 20px 0 0; transform: translateY(40px); }
	.hgr-form-head h2 { font-size: 21px; }
	.hgr-pick-stars svg { width: 38px; height: 38px; }
	.hgr-bar { flex-direction: column; align-items: stretch; }
	.hga-account .hgr-bar .hga-btn { width: 100%; }

	.hgr-summary { grid-template-columns: 1fr; gap: 14px; padding: 18px; }
	.hgr-score { flex-direction: row; justify-content: center; gap: 10px; }
	.hgr-score b { font-size: 38px; }
	.hgr-item-head .hgr-stars { font-size: 14px; letter-spacing: 1px; }
	.hgr-section .hgr-thumb { width: 72px; height: 72px; }
	.hgr-lb { padding: 56px 8px; }
	.hgr-lb-prev, .hgr-lb-next { top: auto; bottom: 8px; transform: none; }
}
