/*
 * Reviews Management - review slider.
 * Every rule is scoped to .grm-widget and resets the properties themes and page builders
 * commonly override, so the widget looks the same everywhere.
 */

.grm-widget {
	/* Style preset variables (light background is the default). */
	--grm-card-bg: #f4f4f4;
	--grm-text: #1f1f1f;
	--grm-name: #000;
	--grm-muted: #6f6f6f;
	--grm-border: transparent;
	--grm-border-width: 0px;
	--grm-shadow: none;
	--grm-star: #f6bb06;
	--grm-star-off: #d6d6d6;
	--grm-verified: #4285f4;
	--grm-arrow-bg: #fff;
	--grm-arrow-color: #555;
	--grm-arrow-border: #dcdcdc;
	--grm-gap: 18px;
	--grm-pad: 22px;

	/* Values set from the settings page (overridden inline). */
	--grm-pv-base: 3;
	--grm-lines: 4;
	--grm-font-size: 15px;
	--grm-radius: 12px;

	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 6px 22px 10px;
	font-size: var(--grm-font-size);
	line-height: 1.55;
	letter-spacing: normal;
	text-align: left;
	text-transform: none;
	color: var(--grm-text);
	direction: ltr;
}

.grm-widget.grm-font-poppins {
	font-family: "GRM Poppins", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.grm-widget.grm-font-inherit {
	font-family: inherit;
}

.grm-widget *,
.grm-widget *::before,
.grm-widget *::after {
	box-sizing: border-box;
}

.grm-widget svg {
	display: block;
	flex: none;
	max-width: none;
	overflow: visible;
}

/* ---------- Slider ---------- */

.grm-viewport {
	overflow: hidden;
	width: 100%;
	container-type: inline-size;
	container-name: grm;
	touch-action: pan-y;
	padding: 8px 4px 14px;
	margin: -8px -4px -14px;
}

.grm-track {
	--grm-pv: var(--grm-pv-base);
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: var(--grm-gap);
	margin: 0;
	padding: 0;
	transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
	will-change: transform;
}

@container grm (max-width: 899px) {
	.grm-track {
		--grm-pv: min(2, var(--grm-pv-base));
	}
}

@container grm (max-width: 559px) {
	.grm-track {
		--grm-pv: 1;
	}
}

.grm-widget.grm-dragging .grm-track {
	transition: none;
}

@media (prefers-reduced-motion: reduce) {
	.grm-track {
		transition: none;
	}
}

/* ---------- Card ---------- */

.grm-card {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 0 0 calc((100% - (var(--grm-pv) - 1) * var(--grm-gap)) / var(--grm-pv));
	min-width: 0;
	min-height: var(--grm-card-min, 0);
	margin: 0;
	padding: var(--grm-pad);
	background: var(--grm-card-bg);
	border: var(--grm-border-width) solid var(--grm-border);
	border-radius: var(--grm-radius);
	box-shadow: var(--grm-shadow);
	color: var(--grm-text);
	user-select: none;
	-webkit-user-select: none;
}

.grm-card-head {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-right: 30px;
	min-height: 44px;
}

.grm-avatar {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	background: #e9e9e9;
	color: #fff;
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
}

.grm-avatar img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: none;
}

.grm-meta {
	min-width: 0;
}

.grm-name {
	margin: 0;
	color: var(--grm-name);
	font-size: 1.04em;
	font-weight: 600;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.grm-date {
	margin: 1px 0 0;
	color: var(--grm-muted);
	font-size: 0.9em;
	line-height: 1.35;
}

.grm-google {
	position: absolute;
	top: var(--grm-pad);
	right: var(--grm-pad);
	line-height: 0;
}

.grm-google svg {
	width: 24px;
	height: 24px;
}

.grm-rating {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 14px 0 8px;
}

.grm-stars {
	display: inline-flex;
	gap: 1px;
	color: var(--grm-star);
	line-height: 0;
}

.grm-star {
	width: 1.33em;
	height: 1.33em;
	max-width: 22px;
	max-height: 22px;
}

.grm-star-off {
	color: var(--grm-star-off);
}

.grm-verified {
	display: inline-flex;
	color: var(--grm-verified);
	line-height: 0;
}

.grm-verified svg {
	width: 18px;
	height: 18px;
}

.grm-text {
	margin: 0;
	color: var(--grm-text);
	font-size: 1em;
	line-height: 1.6;
	white-space: pre-line;
	overflow-wrap: anywhere;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--grm-lines);
	line-clamp: var(--grm-lines);
	overflow: hidden;
	/* Reserve the same text height on every card so all cards have one fixed size. */
	min-height: calc(var(--grm-lines) * 1.6em);
}

.grm-card.grm-expanded .grm-text {
	display: block;
	-webkit-line-clamp: unset;
	line-clamp: none;
	overflow: visible;
}

/* While "Read more" / "Hide" animates, the text box height is animated by JavaScript. */
.grm-card.grm-animating .grm-text {
	display: block;
	-webkit-line-clamp: unset;
	line-clamp: none;
	overflow: hidden;
}

/* "Read more" / "Hide" - reset every theme and builder button style. */
.grm-widget .grm-more {
	all: unset;
	display: inline-block;
	align-self: flex-start;
	margin-top: 10px;
	color: var(--grm-muted);
	font-family: inherit;
	font-size: 0.93em;
	line-height: 1.4;
	cursor: pointer;
}

.grm-widget .grm-more[hidden] {
	display: none;
}

.grm-widget .grm-more:hover {
	text-decoration: underline;
}

.grm-widget .grm-more:focus-visible {
	outline: 2px solid var(--grm-verified);
	outline-offset: 2px;
	border-radius: 2px;
}

/* ---------- Arrows ---------- */

.grm-widget .grm-arrow {
	all: unset;
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin-top: -18px;
	border: 1px solid var(--grm-arrow-border);
	border-radius: 50%;
	background: var(--grm-arrow-bg);
	color: var(--grm-arrow-color);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

.grm-widget .grm-arrow:hover {
	background: #f5f5f5;
	color: #222;
}

.grm-widget .grm-arrow:focus-visible {
	outline: 2px solid var(--grm-verified);
	outline-offset: 2px;
}

.grm-widget .grm-prev {
	left: 2px;
}

.grm-widget .grm-next {
	right: 2px;
}

.grm-widget:not(.grm-ready) .grm-arrow,
.grm-widget.grm-no-nav .grm-arrow,
.grm-widget.grm-hide-arrows .grm-arrow {
	display: none;
}

.grm-widget.grm-hide-arrows {
	padding-left: 0;
	padding-right: 0;
}

/* ---------- Visibility options ---------- */

.grm-hide-google .grm-google,
.grm-hide-verified .grm-verified,
.grm-hide-photo .grm-avatar {
	display: none;
}

.grm-hide-google .grm-card-head {
	padding-right: 0;
}

.grm-hide-photo .grm-card-head {
	min-height: 0;
}

/* ---------- Style presets ---------- */

.grm-style-drop-shadow {
	--grm-card-bg: #fff;
	--grm-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.grm-style-light-border {
	--grm-card-bg: #fff;
	--grm-border: #e2e2e2;
	--grm-border-width: 1px;
}

.grm-style-minimal {
	--grm-card-bg: transparent;
	--grm-pad: 8px;
}

.grm-style-soft {
	--grm-card-bg: #fff;
	--grm-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

.grm-style-light-contrast {
	--grm-card-bg: #fff;
	--grm-border: #1f1f1f;
	--grm-border-width: 2px;
	--grm-text: #111;
	--grm-muted: #555;
}

.grm-style-luxury {
	--grm-card-bg: #fffdf8;
	--grm-border: #c9a45c;
	--grm-border-width: 1px;
	--grm-star: #c9a45c;
	--grm-verified: #b38b45;
	--grm-name: #3a2f1c;
	--grm-text: #3f3a33;
	--grm-arrow-color: #a8843e;
	--grm-arrow-border: #e3cfa5;
}

.grm-style-dark-background {
	--grm-card-bg: #222;
	--grm-text: #e9e9e9;
	--grm-name: #fff;
	--grm-muted: #a8a8a8;
	--grm-star-off: #4b4b4b;
	--grm-arrow-bg: #2c2c2c;
	--grm-arrow-color: #ddd;
	--grm-arrow-border: #444;
}

.grm-style-minimal-dark {
	--grm-card-bg: transparent;
	--grm-text: #e9e9e9;
	--grm-name: #fff;
	--grm-muted: #a8a8a8;
	--grm-star-off: #4b4b4b;
	--grm-pad: 8px;
	--grm-arrow-bg: #2c2c2c;
	--grm-arrow-color: #ddd;
	--grm-arrow-border: #444;
}

.grm-style-dark-luxury {
	--grm-card-bg: #141414;
	--grm-border: #c9a45c;
	--grm-border-width: 1px;
	--grm-text: #e6e1d8;
	--grm-name: #f3e6c8;
	--grm-muted: #a3988a;
	--grm-star: #d4af61;
	--grm-star-off: #4a4234;
	--grm-verified: #d4af61;
	--grm-arrow-bg: #1c1c1c;
	--grm-arrow-color: #d4af61;
	--grm-arrow-border: #5c4c2c;
}

.grm-style-dark-background .grm-arrow:hover,
.grm-style-minimal-dark .grm-arrow:hover,
.grm-style-dark-luxury .grm-arrow:hover {
	background: #383838;
	color: #fff;
}

.grm-empty {
	padding: 12px 16px;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
	color: #50575e;
	font-size: 14px;
}

/* =========================================================
 * Grid layout ([grm_reviews_grid]). The card design is shared with the slider.
 * ========================================================= */

.grm-widget.grm-layout-grid {
	--grm-cols: 3;
	--grm-btn-bg: #f1f1f1;
	--grm-btn-text: #1f1f1f;
	--grm-btn-border: transparent;
	padding: 0;
	container-type: inline-size;
	container-name: grmgrid;
}

.grm-grid {
	--grm-cols-now: var(--grm-cols);
	display: grid;
	grid-template-columns: repeat(var(--grm-cols-now), minmax(0, 1fr));
	gap: 16px;
	align-items: start;
	margin: 0;
	padding: 0;
}

@container grmgrid (max-width: 899px) {
	.grm-grid {
		--grm-cols-now: min(2, var(--grm-cols));
	}
}

@container grmgrid (max-width: 559px) {
	.grm-grid {
		--grm-cols-now: 1;
	}
}

.grm-layout-grid .grm-card {
	flex: none;
	width: auto;
	user-select: text;
	-webkit-user-select: text;
}

.grm-layout-grid .grm-card.grm-is-hidden {
	display: none;
}

.grm-grid-footer {
	display: flex;
	justify-content: center;
	margin-top: 18px;
}

.grm-grid-footer[hidden] {
	display: none;
}

.grm-widget .grm-load-more {
	all: unset;
	display: inline-block;
	padding: 10px 20px;
	border: 1px solid var(--grm-btn-border);
	border-radius: 8px;
	background: var(--grm-btn-bg);
	color: var(--grm-btn-text);
	font-family: inherit;
	font-size: 0.93em;
	font-weight: 500;
	line-height: 1.4;
	text-align: center;
	cursor: pointer;
	transition: filter 0.2s;
}

.grm-widget .grm-load-more:hover {
	filter: brightness(0.95);
}

.grm-widget .grm-load-more:focus-visible {
	outline: 2px solid var(--grm-verified);
	outline-offset: 2px;
}

/* Load more button colours per style (overridden by the Grid settings). */
.grm-layout-grid.grm-style-drop-shadow,
.grm-layout-grid.grm-style-soft {
	--grm-btn-bg: #fff;
	--grm-btn-border: #e2e2e2;
}

.grm-layout-grid.grm-style-light-border,
.grm-layout-grid.grm-style-minimal {
	--grm-btn-bg: #fff;
	--grm-btn-border: #d6d6d6;
}

.grm-layout-grid.grm-style-light-contrast {
	--grm-btn-bg: #fff;
	--grm-btn-text: #111;
	--grm-btn-border: #1f1f1f;
}

.grm-layout-grid.grm-style-luxury {
	--grm-btn-bg: #fffdf8;
	--grm-btn-text: #3a2f1c;
	--grm-btn-border: #c9a45c;
}

.grm-layout-grid.grm-style-dark-background,
.grm-layout-grid.grm-style-minimal-dark {
	--grm-btn-bg: #2c2c2c;
	--grm-btn-text: #eee;
	--grm-btn-border: #444;
}

.grm-layout-grid.grm-style-dark-luxury {
	--grm-btn-bg: #1c1c1c;
	--grm-btn-text: #f3e6c8;
	--grm-btn-border: #5c4c2c;
}

.grm-layout-grid.grm-style-dark-background .grm-load-more:hover,
.grm-layout-grid.grm-style-minimal-dark .grm-load-more:hover,
.grm-layout-grid.grm-style-dark-luxury .grm-load-more:hover {
	filter: brightness(1.2);
}
