/* ==========================================================================
   FUGA — khối đánh giá trang sản phẩm (giao diện kiểu Judge.me, viết mới)
   Đo theo bản tĩnh: khối rộng tối đa 1150px, lề ngoài 20 / 32 / 96px (≥700 / ≥1399),
   khoảng trên dưới 32 / 48 / 56px (≥1000 / ≥1399); xếp dọc khi ≤991px.
   ========================================================================== */
.fg-reviews {
	--rv-line: rgba(11, 11, 11, .1);
	--rv-ink: #0b0b0b;
	--rv-muted: #6b6b6b;
	background: #fff;
	color: #1c1c1c;
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: .56px;
	padding-block: 32px;
}
.fg-reviews__container { margin-inline: 20px; }
.fg-rv { max-width: 1150px; margin: 0 auto; padding: 24px 16px; }
.fg-reviews svg { display: inline-block; flex: none; }

/* ---------- Sao ---------- */
.fg-stars { display: inline-flex; align-items: center; color: #000; line-height: 1; }
.fg-stars .fg-star { display: block; margin-right: 4px; }
.fg-stars .fg-star:last-child { margin-right: 0; }
.fg-stars--sum .fg-star { width: 17.5px; height: 16.7px; margin-right: 3px; }
.fg-stars--rev .fg-star { width: 15.5px; height: 14.8px; margin-right: 3px; }
.fg-stars--hist { width: 83px; }
.fg-stars--hist .fg-star { width: 14.2px; height: 13.6px; margin-right: 2.55px; }
.fg-stars--hist .fg-star:last-child { margin-right: 0; }

/* ---------- Đầu khối: tiêu đề, tổng hợp, biểu đồ ---------- */
.fg-rv__title {
	margin: 0 0 12px;
	font-size: 21px;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	color: #1c1c1c;
}
.fg-rv__stats { text-align: center; }
.fg-rv__summary { margin-bottom: 24px; }
.fg-rv__summary-stars { display: flex; align-items: center; justify-content: center; height: 22.4px; }
.fg-rv__avg { margin-left: 4px; }
.fg-rv__based { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 19.6px; }
.fg-rv__verified-mark { display: inline-flex; }
.fg-rv__verified-mark svg { width: 17px; height: 17px; }

.fg-rv__hist { margin-bottom: 24px; }
.fg-rv__hrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 14px;
	margin: 0 0 10px;
	font-size: 12px;
	line-height: 14px;
	letter-spacing: .56px;
	cursor: pointer;
}
.fg-rv__hrow:nth-child(5) { margin-bottom: 0; }
.fg-rv__hrow:disabled { cursor: default; }
.fg-rv__hrow .fg-stars--hist { height: 14px; }
.fg-rv__bar {
	position: relative;
	flex: none;
	width: 140px;
	height: 14px;
	margin: 0 28px;
	background: rgba(224, 224, 224, .5);
}
.fg-rv__bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--rv-ink); }
.fg-rv__hrow:nth-child(2) .fg-rv__bar-fill { opacity: .8; }
.fg-rv__hrow:nth-child(3) .fg-rv__bar-fill { opacity: .6; }
.fg-rv__hrow:nth-child(4) .fg-rv__bar-fill { opacity: .4; }
.fg-rv__hrow:nth-child(5) .fg-rv__bar-fill { opacity: .2; }
.fg-rv__freq { flex: none; min-width: 24px; text-align: left; color: var(--rv-muted); }
.fg-rv__hist.is-filtered .fg-rv__hrow { opacity: .4; }
.fg-rv__hist.is-filtered .fg-rv__hrow[aria-pressed="true"] { opacity: 1; }
.fg-rv__hclear {
	display: block;
	margin: 10px auto 0;
	font-size: 12px;
	line-height: 14px;
	text-decoration: underline;
	color: var(--rv-ink);
}
.fg-rv__hrow:focus-visible, .fg-rv__hclear:focus-visible { outline: 1px solid var(--rv-ink); outline-offset: 2px; }

.fg-rv__actions { margin-bottom: 24px; }
.fg-rv__write, .fg-rv__btn {
	display: inline-block;
	padding: 10px 24px;
	border: 1px solid var(--rv-ink);
	background: var(--rv-ink);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 20px;
	letter-spacing: .56px;
	text-align: center;
	transition: background-color .2s, color .2s;
}
.fg-rv__write:hover, .fg-rv__btn:hover { background: #fff; color: var(--rv-ink); }
.fg-rv__btn--ghost { background: #fff; color: var(--rv-ink); }
.fg-rv__btn--ghost:hover { background: var(--rv-ink); color: #fff; }
.fg-rv__write[aria-expanded="true"] { display: none; }

@media (min-width: 992px) {
	.fg-rv__title { margin-bottom: 24px; }
	.fg-rv__stats { display: flex; align-items: stretch; padding-bottom: 24px; }
	.fg-rv__summary, .fg-rv__actions { flex: 0 0 30%; margin: 0; display: flex; align-items: center; justify-content: center; }
	.fg-rv__summary-inner { text-align: left; }
	.fg-rv__summary-stars, .fg-rv__based { justify-content: flex-start; }
	.fg-rv__hist {
		flex: 0 0 40%;
		display: flex;
		flex-direction: column;
		justify-content: center;
		margin: 0;
		border-left: 1px solid var(--rv-line);
	}
	.fg-rv__actions { border-left: 1px solid var(--rv-line); }
	.fg-rv__stats.is-empty .fg-rv__summary { flex-basis: 70%; }
	.fg-rv__stats.is-empty .fg-rv__summary-inner { text-align: center; }
	.fg-rv__stats.is-empty .fg-rv__summary-stars, .fg-rv__stats.is-empty .fg-rv__based { justify-content: center; }
}

/* ---------- Thông báo, form viết đánh giá ---------- */
.fg-rv__notice {
	margin: 0 0 24px;
	padding: 12px 16px;
	background: #f6f7f9;
	border-left: 3px solid var(--rv-ink);
	color: var(--rv-ink);
}
.fg-rv__form { border-top: 1px solid var(--rv-line); padding: 24px 0 32px; }
.fg-rv__fields { max-width: 640px; margin: 0 auto; }
.fg-rv__form-title { margin: 0 0 20px; font-size: 18px; font-weight: 700; line-height: 1.4; text-align: center; color: var(--rv-ink); }
.fg-rv__field { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.fg-rv__label { display: block; margin: 0 0 8px; padding: 0; font-weight: 600; color: var(--rv-ink); }
.fg-rv__field input[type="text"], .fg-rv__field input[type="email"], .fg-rv__field textarea {
	display: block;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid rgba(11, 11, 11, .25);
	border-radius: 0;
	background: #fff;
	font-size: 14px;
	line-height: 20px;
	color: var(--rv-ink);
}
.fg-rv__field textarea { min-height: 120px; resize: vertical; }
.fg-rv__field input:focus, .fg-rv__field textarea:focus { outline: none; border-color: var(--rv-ink); }
.fg-rv__field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fg-rv__logged { color: var(--rv-muted); }
.fg-rv__rate { text-align: center; }
.fg-rv__rate .fg-rv__label { margin-inline: auto; }
.fg-rv__rate-stars { display: inline-flex; gap: 6px; color: #000; }
.fg-rv__rate-stars label { position: relative; display: block; width: 26px; height: 25px; cursor: pointer; }
.fg-rv__rate-stars label svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fg-rv__rate-stars label .is-on { opacity: 0; transition: opacity .12s; }
.fg-rv__rate-stars label.is-lit .is-on { opacity: 1; }
.fg-rv__rate-stars input:focus-visible + label { outline: 1px solid var(--rv-ink); outline-offset: 2px; }
.fg-rv__error { margin: 0 0 16px; color: #c2180e; text-align: center; }
.fg-rv__form-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Sắp xếp ---------- */
.fg-rv__toolbar { display: flex; padding: 8px 0; border-top: 1px solid var(--rv-line); }
.fg-rv__sort { position: relative; display: inline-flex; align-items: center; height: 40px; color: var(--rv-ink); }
.fg-rv__sort select {
	position: relative;
	z-index: 1;
	height: 40px;
	padding: 10px 20px 10px 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	-webkit-appearance: none;
	appearance: none;
	font-size: 14px;
	line-height: 19.6px;
	letter-spacing: normal;
	color: var(--rv-ink);
	cursor: pointer;
}
.fg-rv__sort select:focus-visible { outline: 1px solid var(--rv-ink); }
.fg-rv__sort svg { position: absolute; right: -2px; top: 50%; width: 12px; height: 12px; margin-top: -6px; }

/* ---------- Danh sách ---------- */
.fg-rv__body { position: relative; transition: opacity .2s; }
.fg-rv__body.is-loading { opacity: .4; pointer-events: none; }
.fg-rv__none { margin: 0; padding: 16px 0; border-top: 1px solid var(--rv-line); }
.fg-rv__item { padding: 16px 0; border-top: 1px solid var(--rv-line); }
.fg-rv__item-head { margin-bottom: 10px; }
.fg-rv__item-rating { display: flex; justify-content: space-between; align-items: flex-start; height: 21px; margin-bottom: 8px; }
.fg-rv__item-rating .fg-stars { margin-top: 3px; }
.fg-rv__date { font-size: 12px; line-height: 16px; color: var(--rv-muted); }
.fg-rv__item-profile { position: relative; min-height: 33px; padding-left: 44px; line-height: 20px; }
.fg-rv__avatar {
	position: absolute;
	left: 0;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background: rgba(224, 224, 224, .5);
	color: var(--rv-ink);
}
.fg-rv__avatar .fg-rv__ico-user { width: 25px; height: 25px; margin: 3px 3px 0 0; }
.fg-rv__avatar-check {
	position: absolute;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 12px;
	height: 12px;
	background: var(--rv-ink);
	color: #fff;
}
.fg-rv__avatar-check svg { width: 12px; height: 12px; }
.fg-rv__author { color: var(--rv-ink); overflow-wrap: anywhere; }
.fg-rv__badge {
	position: relative;
	top: 2px;
	display: inline-block;
	vertical-align: top;
	height: 16px;
	margin-left: 5px;
	padding: 2px 6px;
	background: var(--rv-ink);
	color: #fff;
	font-size: 12px;
	line-height: 12px;
}
.fg-rv__item-content { margin-bottom: 16px; overflow-wrap: anywhere; }
.fg-rv__item-title { margin: 0 0 8px; font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--rv-ink); }
.fg-rv__text p { margin: 0; }
.fg-rv__text p + p { margin-top: 8px; }
.fg-rv__pics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 5px; }
.fg-rv__pic { display: block; width: 96px; height: 96px; border: 1px solid #e4e4e4; overflow: hidden; }
.fg-rv__pic img { width: 100%; height: 100%; object-fit: cover; }
.fg-rv__translate { display: flex; align-items: flex-start; gap: 4px; }
.fg-rv__translate svg { width: 21px; height: 21px; color: #108474; }
.fg-rv__translate-btn { color: #108474; text-decoration: underline; line-height: 20px; }

/* ---------- Phân trang ---------- */
.fg-rv__pages { padding: 16px 0; border-top: 1px solid var(--rv-line); text-align: center; line-height: 29px; }
.fg-rv__page {
	display: inline-block;
	vertical-align: middle;
	padding: 4px 8px;
	font-size: 14px;
	line-height: 14px;
	color: var(--rv-ink);
}
.fg-rv__page.is-current { font-size: 21px; font-weight: 700; line-height: 21px; color: var(--rv-muted); cursor: default; }
.fg-rv__page.is-arrow { padding: 4px 9px; }
.fg-rv__page.is-arrow svg { display: block; width: 14px; height: 15px; }
.fg-rv__page:hover:not(.is-current) { text-decoration: underline; }

/* ---------- Ảnh phóng to ---------- */
.fg-rv-lightbox {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .85);
}
.fg-rv-lightbox img { max-width: 90vw; max-height: 85vh; width: auto; height: auto; object-fit: contain; }
.fg-rv-lightbox button { position: absolute; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: #fff; }
.fg-rv-lightbox button svg { width: 24px; height: 24px; }
.fg-rv-lightbox__close { top: 16px; right: 16px; }
.fg-rv-lightbox__prev { left: 16px; top: 50%; margin-top: -22px; }
.fg-rv-lightbox__next { right: 16px; top: 50%; margin-top: -22px; }

@media (min-width: 700px) {
	.fg-reviews__container { margin-inline: 32px; }
}
@media (min-width: 1000px) {
	.fg-reviews { padding-block: 48px; }
}
@media (min-width: 1399px) {
	.fg-reviews { padding-block: 56px; }
	.fg-reviews__container { margin-inline: 96px; }
}
@media (max-width: 767px) {
	.fg-rv__bar { width: 126px; margin: 0 20px 0 19px; }
	.fg-rv__field-row { grid-template-columns: 1fr; gap: 0; }
}
