/**
 * Import Review to Mocowiz — front-end review styling.
 *
 * Scoped to the WooCommerce reviews area so nothing leaks into the rest of the
 * theme. `!important` appears only where WooCommerce's own stylesheet sets the
 * same property with equal-or-higher specificity (avatar sizing, star colour).
 */

:root {
	--irmw-gold: #f5a623;
	--irmw-gold-soft: #ffd479;
	--irmw-star-empty: #dfe3e8;
	--irmw-ink: #1f2933;
	--irmw-muted: #6b7280;
	--irmw-line: #e5e7eb;
	--irmw-surface: #ffffff;
	--irmw-surface-alt: #f7f8fa;
}

/* ------------------------------------------------------------------ *
 * Gold stars — match the rating shown up in the product summary
 * ------------------------------------------------------------------ */

#reviews .star-rating span::before,
.woocommerce-Reviews .star-rating span::before,
.irmw-summary .star-rating span::before {
	color: var(--irmw-gold) !important;
}

#reviews .star-rating::before,
.woocommerce-Reviews .star-rating::before,
.irmw-summary .star-rating::before {
	color: var(--irmw-star-empty) !important;
}

/* ------------------------------------------------------------------ *
 * Round reviewer avatars
 * ------------------------------------------------------------------ */

#reviews .commentlist img.avatar,
.woocommerce-Reviews .commentlist img.avatar,
#reviews #comments ol.commentlist li img.avatar {
	width: 56px !important;
	height: 56px !important;
	padding: 0 !important;
	border: 1px solid var(--irmw-line) !important;
	border-radius: 50% !important;
	object-fit: cover;
	background: var(--irmw-surface-alt);
	box-shadow: none;
}

/* ------------------------------------------------------------------ *
 * Rating summary card
 * ------------------------------------------------------------------ */

.irmw-summary {
	display: grid;
	grid-template-columns: minmax(140px, auto) minmax(0, 1fr);
	gap: 12px 32px;
	align-items: center;
	margin: 0 0 28px;
	padding: 22px 24px;
	background: var(--irmw-surface);
	border: 1px solid var(--irmw-line);
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.irmw-summary__score {
	text-align: center;
	padding-right: 24px;
	border-right: 1px solid var(--irmw-line);
}

.irmw-summary__avg {
	font-size: 42px;
	font-weight: 700;
	line-height: 1.05;
	color: var(--irmw-ink);
}

.irmw-summary__stars {
	display: flex;
	justify-content: center;
	margin: 6px 0 4px;
}

/* Own SVG stars — one row, each star independently filled.
   Deliberately NOT WooCommerce's font-glyph technique, which needs its "star"
   webfont and renders as two overlapping rows when a theme does not load it. */

.irmw-stars {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	font-size: 18px;
	line-height: 1;
}

.irmw-star {
	position: relative;
	display: block;
	width: 1em;
	height: 1em;
	flex: 0 0 auto;
}

.irmw-star__bg,
.irmw-star__fg {
	display: block;
	height: 1em;
	line-height: 0;
}

.irmw-star__bg {
	width: 1em;
	color: var(--irmw-star-empty);
}

/* The gold layer is clipped by its own width, so a half star is exactly half.
   Its <svg> keeps the full 1em width, which is what makes the clip work. */
.irmw-star__fg {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	color: var(--irmw-gold);
}

.irmw-star svg {
	width: 1em;
	height: 1em;
	display: block;
	fill: currentColor;
}

.irmw-summary__count {
	font-size: 13px;
	color: var(--irmw-muted);
}

/* Star breakdown ---------------------------------------------------- */

.irmw-summary__bars {
	margin: 0;
	padding: 0;
	list-style: none;
}

.irmw-summary__bars li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.irmw-summary__bars li::before {
	content: none;
}

.irmw-bar {
	display: grid;
	grid-template-columns: 62px minmax(0, 1fr) 44px;
	align-items: center;
	gap: 12px;
	padding: 5px 8px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--irmw-muted);
	transition: background 0.15s ease, color 0.15s ease;
}

.irmw-bar:hover,
.irmw-bar:focus-visible {
	background: var(--irmw-surface-alt);
	color: var(--irmw-ink);
	text-decoration: none;
}

.irmw-bar.is-active {
	background: rgba(245, 166, 35, 0.12);
	color: var(--irmw-ink);
	font-weight: 600;
}

.irmw-bar__label {
	font-size: 13px;
	white-space: nowrap;
}

.irmw-bar__track {
	position: relative;
	height: 9px;
	border-radius: 999px;
	background: #eceff3;
	overflow: hidden;
}

.irmw-bar__fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--irmw-gold-soft), var(--irmw-gold));
	transition: width 0.3s ease;
}

.irmw-bar__pct {
	font-size: 13px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* Active-filter notice ---------------------------------------------- */

.irmw-summary__active {
	grid-column: 1 / -1;
	margin: 4px 0 0;
	padding-top: 14px;
	border-top: 1px solid var(--irmw-line);
	font-size: 13px;
	color: var(--irmw-ink);
}

.irmw-summary__clear {
	margin-left: 10px;
	font-weight: 600;
	color: #b26a00;
	text-decoration: underline;
}

@media (max-width: 600px) {
	.irmw-summary {
		grid-template-columns: 1fr;
		gap: 16px;
		padding: 18px;
	}

	.irmw-summary__score {
		padding-right: 0;
		padding-bottom: 16px;
		border-right: 0;
		border-bottom: 1px solid var(--irmw-line);
	}

	.irmw-bar {
		grid-template-columns: 56px minmax(0, 1fr) 40px;
		gap: 10px;
	}
}

/* ------------------------------------------------------------------ *
 * Review photos / videos
 * ------------------------------------------------------------------ */

.irmw-media {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 10px 0 2px;
}

.irmw-media__item {
	position: relative;
	width: 80px;
	height: 80px;
	padding: 0;
	margin: 0;
	border: 1px solid var(--irmw-line);
	border-radius: 8px;
	overflow: hidden;
	background: var(--irmw-surface-alt);
	cursor: zoom-in;
	line-height: 0;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.irmw-media__item:hover {
	border-color: var(--irmw-gold);
	transform: translateY(-1px);
}

.irmw-media__item img,
.irmw-media__item video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	border-radius: 0;
}

.irmw-media__item--video {
	cursor: pointer;
}

.irmw-media__play {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	color: #fff;
	text-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
	pointer-events: none;
}

/* Lightbox ----------------------------------------------------------- */

.irmw-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.86);
}

.irmw-lightbox img,
.irmw-lightbox video {
	max-width: 92vw;
	max-height: 86vh;
	border-radius: 6px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.irmw-lightbox__close {
	position: absolute;
	top: 14px;
	right: 18px;
	width: 40px;
	height: 40px;
	padding: 0;
	font-size: 26px;
	line-height: 1;
	color: #fff;
	background: rgba(255, 255, 255, 0.14);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.irmw-lightbox__close:hover {
	background: rgba(255, 255, 255, 0.26);
}
