/**
 * Fansidea-like product reviews — true masonry (column flow by image height).
 */

body.single-product .fi-reviews-section {
	width: 100vw;
	max-width: 100vw;
	margin: 8px 0 48px;
	margin-left: calc(50% - 50vw);
	padding: 36px max(20px, calc((100vw - 1400px) / 2)) 48px;
	background: #fff;
	box-sizing: border-box;
	clear: both;
}

body.single-product .fi-reviews-section > .elementor-element,
body.single-product .fi-reviews-section .elementor-widget-container {
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
}

body.single-product #reviews {
	font-family: Outfit, "Segoe UI", sans-serif;
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
}

body.single-product #reviews .woocommerce-Reviews-title,
body.single-product #reviews .woocommerce-noreviews {
	font-size: 18px;
	font-weight: 800;
	color: #111;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	line-height: 1.35;
	margin: 0 0 12px;
	padding: 0 0 14px;
	border-bottom: 1px solid #e6e6e6;
}

body.single-product #reviews .woocommerce-Reviews-title span {
	font-weight: inherit;
}

.fi-reviews-summary {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 18px;
	font-family: Outfit, "Segoe UI", sans-serif;
}

.fi-reviews-summary__stars {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	color: #e8c24a;
	line-height: 1;
}

.fi-reviews-summary__star {
	color: #ddd;
	display: block;
}

.fi-reviews-summary__star.is-on {
	color: #e8c24a;
}

.fi-reviews-summary__count {
	font-size: 14px;
	font-weight: 500;
	color: #444;
	line-height: 1;
}

body.single-product #reviews .star-rating {
	color: #f5b400;
	float: none !important;
	margin: 0 0 6px !important;
}

/* True masonry: items pack by natural height (driven by photos). */
body.single-product #reviews .commentlist {
	display: block !important;
	column-count: 5;
	column-gap: 14px;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

body.single-product #reviews .commentlist > .review,
body.single-product #reviews .commentlist > .comment {
	display: inline-block;
	width: 100%;
	margin: 0 0 14px !important;
	padding: 12px !important;
	border: 1px solid #ececec !important;
	border-radius: 8px;
	background: #fff;
	box-shadow: none !important;
	float: none !important;
	break-inside: avoid;
	page-break-inside: avoid;
	-webkit-column-break-inside: avoid;
	box-sizing: border-box;
	vertical-align: top;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.single-product #reviews .commentlist > .review:hover,
body.single-product #reviews .commentlist > .comment:hover {
	border-color: #d8d8d8 !important;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
}

body.single-product #reviews .comment_container {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

body.single-product #reviews .comment-text {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

body.single-product #reviews .avatar,
body.single-product #reviews img.avatar {
	display: none !important;
}

body.single-product #reviews .meta {
	order: 2;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	line-height: 1.35;
}

body.single-product #reviews .star-rating {
	order: 3;
}

body.single-product #reviews .description {
	order: 4;
}

body.single-product #reviews .fi-review-photos {
	order: 1;
	margin-top: 0;
	margin-bottom: 4px;
}

body.single-product #reviews .woocommerce-review__author {
	font-size: 14px;
	font-weight: 700;
	color: #111;
}

body.single-product #reviews .woocommerce-review__dash {
	display: none;
}

body.single-product #reviews .woocommerce-review__published-date {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	color: #8a8f94;
	font-weight: 400;
}

body.single-product #reviews .woocommerce-review__verified {
	font-size: 0;
	color: transparent;
}

body.single-product #reviews .woocommerce-review__verified::before {
	content: "";
	display: inline-block;
	width: 12px;
	height: 12px;
	margin-left: 4px;
	vertical-align: middle;
	background: #111;
	border-radius: 50%;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center / 8px 8px no-repeat;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center / 8px 8px no-repeat;
}

body.single-product #reviews .description,
body.single-product #reviews .comment-text {
	font-size: 13px;
	line-height: 1.5;
	color: #333;
}

body.single-product #reviews .description p {
	margin: 0 0 4px;
}

.fi-review-photos {
	position: relative;
	display: block;
	margin: 0;
}

.fi-review-photo {
	display: block;
	overflow: hidden;
	border-radius: 6px;
	background: #f5f5f5;
}

.fi-review-photo.is-extra {
	display: none;
}

.fi-review-photo img {
	display: block;
	width: 100%;
	height: auto;
	vertical-align: middle;
}

.fi-review-photo-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 3px 7px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.72);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	pointer-events: none;
}

/* —— Loox-style review detail modal —— */
body.fi-rm-open {
	overflow: hidden;
}

.fi-rm {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px 12px;
	background: rgba(40, 40, 40, 0.72);
	opacity: 0;
	transition: opacity 0.18s ease;
	box-sizing: border-box;
}

.fi-rm.is-open {
	opacity: 1;
}

.fi-rm__dialog {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
	width: min(820px, 92vw);
	height: min(520px, 78vh);
	max-height: 78vh;
	background: #111;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
	transform: translateY(8px);
	transition: transform 0.18s ease;
}

.fi-rm.is-open .fi-rm__dialog {
	transform: translateY(0);
}

.fi-rm__dialog--text {
	grid-template-columns: 1fr;
	width: min(420px, 92vw);
	height: auto;
	max-height: min(70vh, 560px);
	background: #fff;
	border-radius: 10px;
}

.fi-rm__dialog--text .fi-rm__close--light {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 3;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: #f0f0f0;
	color: #444;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.fi-rm__dialog--text .fi-rm__close--light:hover {
	background: #e6e6e6;
	color: #111;
}

.fi-rm__dialog--text .fi-rm__side {
	padding: 52px 28px 28px;
	overflow: auto;
	max-height: inherit;
}

.fi-rm__dialog--text .fi-rm__head {
	align-items: center;
	margin-bottom: 8px;
}

.fi-rm__dialog--text .fi-rm__author {
	font-size: 18px;
}

.fi-rm__dialog--text .fi-rm__meta-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 16px;
}

.fi-rm__dialog--text .fi-rm__meta-row .fi-rm__stars {
	margin: 0;
}

.fi-rm__dialog--text .fi-rm__date {
	font-size: 13px;
	color: #8a8f94;
}

.fi-rm__dialog--text .fi-rm__body {
	font-size: 15px;
	line-height: 1.7;
}

.fi-rm__media {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #0d0d0d;
	min-height: 0;
	min-width: 0;
}

.fi-rm__close {
	position: absolute;
	top: 10px;
	left: 12px;
	z-index: 3;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.9;
}

.fi-rm__close:hover {
	opacity: 1;
}

.fi-rm__close--light {
	position: absolute;
	top: 8px;
	right: 10px;
	left: auto;
	color: #333;
}

.fi-rm__stage {
	position: relative;
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	min-width: 0;
	padding: 28px 40px 60px;
	box-sizing: border-box;
}

.fi-rm__main {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: center;
	/* Never upscale past natural pixel size — avoids blur. */
	image-rendering: auto;
}

.fi-rm__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	backdrop-filter: blur(2px);
}

.fi-rm__nav:hover {
	background: rgba(255, 255, 255, 0.28);
}

.fi-rm__nav--prev {
	left: 10px;
}

.fi-rm__nav--next {
	right: 10px;
}

.fi-rm__thumbs {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 12px;
	z-index: 2;
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 0 12px;
	flex: 0 0 auto;
	pointer-events: none;
}

.fi-rm__thumb {
	pointer-events: auto;
	display: block;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 2px;
	background: #2a2224;
	overflow: hidden;
	cursor: pointer;
	opacity: 0.78;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.fi-rm__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.fi-rm__thumb.is-active {
	border-color: #fff;
	opacity: 1;
}

.fi-rm__side {
	position: relative;
	background: #fff;
	padding: 22px 22px 24px;
	overflow: auto;
	font-family: Outfit, "Segoe UI", sans-serif;
}

.fi-rm__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.fi-rm__who {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	min-width: 0;
}

.fi-rm__author {
	font-size: 16px;
	font-weight: 700;
	color: #111;
	line-height: 1.2;
}

.fi-rm__verified {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
	color: #111;
	line-height: 1;
}

.fi-rm__verified svg {
	display: block;
	flex: 0 0 auto;
}

.fi-rm__info {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	margin-left: 2px;
	border: 1px solid #999;
	border-radius: 50%;
	font-size: 10px;
	font-weight: 700;
	font-style: normal;
	color: #666;
	line-height: 1;
	cursor: help;
}

.fi-rm__date {
	flex: 0 0 auto;
	font-size: 13px;
	color: #8a8f94;
	line-height: 1.2;
	white-space: nowrap;
}

.fi-rm__stars {
	display: flex;
	gap: 2px;
	margin: 0 0 14px;
	color: #e8c24a;
}

.fi-rm__star {
	color: #ddd;
}

.fi-rm__star.is-on {
	color: #e8c24a;
}

.fi-rm__body {
	font-size: 14px;
	line-height: 1.65;
	color: #222;
	white-space: pre-wrap;
}

.fi-rm__mark {
	background: #fff3a0;
	color: inherit;
	padding: 0 1px;
}

@media (max-width: 820px) {
	.fi-rm {
		padding: 0;
		align-items: stretch;
	}

	.fi-rm__dialog:not(.fi-rm__dialog--text) {
		width: 100%;
		height: 100%;
		max-height: none;
		border-radius: 0;
		grid-template-columns: 1fr;
		grid-template-rows: minmax(48vh, 1.1fr) minmax(0, 0.95fr);
	}

	.fi-rm__dialog--text {
		width: min(420px, 94vw);
		height: auto;
		max-height: 80vh;
		margin: auto;
		border-radius: 10px;
	}

	.fi-rm:has(.fi-rm__dialog--text) {
		padding: 24px 12px;
		align-items: center;
	}

	.fi-rm__stage {
		padding: 28px 40px 64px;
	}

	.fi-rm__dialog:not(.fi-rm__dialog--text) .fi-rm__side {
		padding: 20px 18px 28px;
	}
}

/* Legacy lightbox (unused) kept inert */
.fi-review-lb {
	display: none !important;
}

body.single-product #reviews .comment-reply-title,
body.single-product #review_form_wrapper {
	margin-top: 28px;
}

@media (max-width: 1200px) {
	body.single-product #reviews .commentlist {
		column-count: 4;
	}
}

@media (max-width: 900px) {
	body.single-product .fi-reviews-section {
		padding-left: 16px;
		padding-right: 16px;
	}

	body.single-product #reviews .commentlist {
		column-count: 3;
	}
}

@media (max-width: 700px) {
	body.single-product #reviews .commentlist {
		column-count: 2;
	}
}

@media (max-width: 480px) {
	body.single-product #reviews .commentlist {
		column-count: 1;
	}
}

