/* Smart Google Reviews – scoped, theme-proof styles. */
.sgr-widget {
	--sgr-accent: #1a73e8;
	--sgr-text: #1f2937;
	--sgr-muted: #6b7280;
	--sgr-card-bg: #ffffff;
	--sgr-border: #e5e7eb;
	--sgr-star: #fbbc04;
	--sgr-star-off: #e5e7eb;
	--sgr-radius: 16px;
	--sgr-gap: 20px;
	--sgr-ease: cubic-bezier(.22, 1, .36, 1);
	--sgr-lines: 5;

	position: relative;
	width: 100%;
	color: var(--sgr-text);
	font-family: inherit;
	line-height: 1.55;
	text-align: left;
}
.sgr-widget *, .sgr-widget *::before, .sgr-widget *::after { box-sizing: border-box; }
.sgr-widget .sgr-title { margin: 0 0 18px; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.2; color: var(--sgr-text); }
.sgr-widget .sgr-notice { padding: 14px 16px; border: 1px dashed var(--sgr-border); border-radius: 10px; color: var(--sgr-muted); }

/* ---------- Stars ---------- */
.sgr-widget .sgr-stars { position: relative; display: inline-block; line-height: 0; white-space: nowrap; vertical-align: middle; }
.sgr-widget .sgr-stars svg { width: 18px; height: 18px; margin-right: 2px; }
.sgr-widget .sgr-stars-off svg { fill: var(--sgr-star-off); }
.sgr-widget .sgr-stars-on { position: absolute; top: 0; left: 0; overflow: hidden; white-space: nowrap; }
.sgr-widget .sgr-stars-on svg { fill: var(--sgr-star); }

/* ---------- Summary (rating counter) ---------- */
.sgr-widget .sgr-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 28px;
	margin: 0 0 24px;
	padding: 20px 24px;
	background: var(--sgr-card-bg);
	border: 1px solid var(--sgr-border);
	border-radius: var(--sgr-radius);
	box-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 10px 28px -14px rgba(17, 24, 39, .18);
}
.sgr-widget .sgr-summary-brand { display: flex; align-items: center; gap: 12px; }
.sgr-widget .sgr-summary-label { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.sgr-widget .sgr-summary-name { color: var(--sgr-muted); font-size: .9rem; }
.sgr-widget .sgr-summary-score { display: flex; align-items: center; gap: 14px; }
.sgr-widget .sgr-rating-num {
	font-size: clamp(2.4rem, 5vw, 3.2rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.02em;
	color: var(--sgr-text);
	font-variant-numeric: tabular-nums;
}
.sgr-widget .sgr-summary .sgr-stars svg { width: 22px; height: 22px; }
.sgr-widget .sgr-summary-total { margin-top: 4px; color: var(--sgr-muted); font-size: .9rem; }
.sgr-widget .sgr-summary-total .sgr-counter { font-weight: 700; color: var(--sgr-text); font-variant-numeric: tabular-nums; }
.sgr-widget .sgr-write {
	display: inline-flex;
	align-items: center;
	padding: 11px 20px;
	border-radius: 999px;
	background: var(--sgr-accent);
	color: #fff !important;
	font-weight: 600;
	font-size: .95rem;
	line-height: 1.2;
	text-decoration: none !important;
	box-shadow: 0 8px 18px -10px var(--sgr-accent);
	transition: transform .2s var(--sgr-ease), filter .2s;
}
.sgr-widget .sgr-write:hover { transform: translateY(-1px); filter: brightness(1.06); }
@media (max-width: 640px) {
	.sgr-widget .sgr-summary { flex-direction: column; align-items: flex-start; }
	.sgr-widget .sgr-write { width: 100%; justify-content: center; }
}

/* ---------- Card ---------- */
.sgr-widget .sgr-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	height: 100%;
	margin: 0;
	padding: 22px;
	background: var(--sgr-card-bg);
	border: 1px solid var(--sgr-border);
	border-radius: var(--sgr-radius);
	box-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 10px 24px -16px rgba(17, 24, 39, .22);
	transition: transform .35s var(--sgr-ease), box-shadow .35s var(--sgr-ease);
}
.sgr-widget .sgr-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(17, 24, 39, .05), 0 18px 34px -18px rgba(17, 24, 39, .3); }
.sgr-widget .sgr-card-head { display: flex; align-items: center; gap: 12px; }
.sgr-widget .sgr-avatar {
	position: relative;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: 700;
	font-size: 1.1rem;
}
.sgr-widget .sgr-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 50%; }
.sgr-widget .sgr-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sgr-widget .sgr-name { font-weight: 700; color: var(--sgr-text) !important; text-decoration: none !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sgr-widget a.sgr-name:hover { color: var(--sgr-accent) !important; }
.sgr-widget .sgr-date { font-size: .82rem; color: var(--sgr-muted); }
.sgr-widget .sgr-card-head .sgr-g { flex: 0 0 auto; }
.sgr-widget .sgr-text {
	position: relative;
	color: var(--sgr-text);
	font-size: .95rem;
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--sgr-lines);
	line-clamp: var(--sgr-lines);
}
.sgr-widget .sgr-text p { margin: 0; }
.sgr-widget .sgr-card.is-expanded .sgr-text { display: block; -webkit-line-clamp: unset; line-clamp: unset; }
.sgr-widget .sgr-card .sgr-more {
	align-self: flex-start;
	min-height: 0 !important;
	margin: -4px 0 0;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	color: var(--sgr-accent) !important;
	font: inherit;
	font-size: .88rem;
	font-weight: 600;
	cursor: pointer;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
}
.sgr-widget .sgr-card .sgr-more:hover, .sgr-widget .sgr-card .sgr-more:focus { background: transparent !important; color: var(--sgr-accent) !important; text-decoration: underline; }
.sgr-widget .sgr-more[hidden] { display: none; }
.sgr-widget .sgr-loc { margin-top: auto; display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--sgr-muted); }
.sgr-widget .sgr-loc svg { width: 14px; height: 14px; fill: var(--sgr-accent); }

/* Single review per view: larger, centred testimonial look */
.sgr-widget.sgr-pv-1 .sgr-card { padding: clamp(24px, 4vw, 40px); align-items: center; text-align: center; }
.sgr-widget.sgr-pv-1 .sgr-card-head { flex-direction: column; gap: 8px; }
.sgr-widget.sgr-pv-1 .sgr-who { align-items: center; }
.sgr-widget.sgr-pv-1 .sgr-card-head .sgr-g { display: none; }
.sgr-widget.sgr-pv-1 .sgr-avatar { flex-basis: 64px; width: 64px; height: 64px; font-size: 1.5rem; }
.sgr-widget.sgr-pv-1 .sgr-stars svg { width: 22px; height: 22px; }
.sgr-widget.sgr-pv-1 .sgr-text { font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 760px; --sgr-lines: 6; }
.sgr-widget.sgr-pv-1 .sgr-more, .sgr-widget.sgr-pv-1 .sgr-loc { align-self: center; margin-top: 0; }

/* ---------- Grid ---------- */
.sgr-widget .sgr-grid { display: grid; grid-template-columns: repeat(var(--sgr-pv), minmax(0, 1fr)); gap: var(--sgr-gap); }
/* Grid columns follow the widget's own width (container queries), like the slider. */
.sgr-widget.sgr-layout-grid { container-type: inline-size; }
@container (max-width: 999px) { .sgr-widget.sgr-pv-4 .sgr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 819px) { .sgr-widget.sgr-pv-3 .sgr-grid, .sgr-widget.sgr-pv-4 .sgr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 559px) { .sgr-widget .sgr-grid { grid-template-columns: 1fr; } }
@supports not (container-type: inline-size) {
	@media (max-width: 1000px) { .sgr-widget.sgr-pv-4 .sgr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
	@media (max-width: 820px) { .sgr-widget.sgr-pv-3 .sgr-grid, .sgr-widget.sgr-pv-4 .sgr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
	@media (max-width: 560px) { .sgr-widget .sgr-grid { grid-template-columns: 1fr; } }
}

/* ---------- Slider ---------- */
.sgr-widget .sgr-slider { position: relative; outline: none; padding: 0 0 4px; }
.sgr-widget .sgr-slider:focus-visible { outline: 3px solid color-mix(in srgb, var(--sgr-accent) 40%, transparent); outline-offset: 6px; border-radius: var(--sgr-radius); }
.sgr-widget .sgr-viewport { overflow: hidden; padding: 6px 4px 18px; margin: -6px -4px -18px; touch-action: pan-y; }
.sgr-widget .sgr-track {
	display: flex;
	gap: var(--sgr-gap);
	transition: transform .7s var(--sgr-ease);
	will-change: transform;
	cursor: grab;
}
.sgr-widget .sgr-track.is-dragging { transition: none; cursor: grabbing; user-select: none; }
.sgr-widget .sgr-slide {
	flex: 0 0 calc((100% - (var(--sgr-cur-pv, var(--sgr-pv)) - 1) * var(--sgr-gap)) / var(--sgr-cur-pv, var(--sgr-pv)));
	min-width: 0;
	display: flex;
}
.sgr-widget .sgr-slide > .sgr-card { width: 100%; }
/* Before JS runs: no horizontal overflow flash */
.sgr-widget .sgr-slider:not(.is-ready) .sgr-slide:nth-child(n+5) { visibility: hidden; }

.sgr-widget .sgr-nav {
	position: absolute;
	top: calc(50% - 28px);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	min-height: 0 !important;
	border-radius: 50% !important;
	border: 1px solid var(--sgr-border) !important;
	background: var(--sgr-card-bg) !important;
	color: var(--sgr-text) !important;
	box-shadow: 0 6px 18px -8px rgba(17, 24, 39, .35);
	cursor: pointer;
	transition: background-color .2s, color .2s, opacity .2s, transform .2s var(--sgr-ease);
}
.sgr-widget .sgr-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sgr-widget .sgr-nav:hover, .sgr-widget .sgr-nav:focus-visible { background: var(--sgr-accent) !important; color: #fff !important; border-color: var(--sgr-accent) !important; }
.sgr-widget .sgr-nav[disabled] { opacity: 0; pointer-events: none; }
.sgr-widget .sgr-prev { left: -22px; }
.sgr-widget .sgr-next { right: -22px; }
/* Narrower screens: arrows move to a bottom bar beside the dots (never over the text). */
@media (max-width: 1100px) {
	.sgr-widget .sgr-slider:not(.no-nav) { padding-bottom: 58px; }
	.sgr-widget .sgr-nav { top: auto; bottom: 0; width: 40px; height: 40px; }
	.sgr-widget .sgr-prev { left: 0; }
	.sgr-widget .sgr-next { right: 0; }
	.sgr-widget .sgr-dots { position: absolute; left: 52px; right: 52px; bottom: 0; height: 40px; margin: 0; align-items: center; }
}
.sgr-widget .sgr-slider.no-nav .sgr-nav, .sgr-widget .sgr-slider.no-nav .sgr-dots { display: none; }

.sgr-widget .sgr-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.sgr-widget .sgr-dot {
	width: 9px;
	height: 9px;
	margin: 0;
	padding: 0;
	min-height: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: var(--sgr-star-off) !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: width .35s var(--sgr-ease), background-color .35s;
}
.sgr-widget .sgr-dot[aria-selected="true"] { width: 26px; background: var(--sgr-accent) !important; }

@media (prefers-reduced-motion: reduce) {
	.sgr-widget .sgr-track, .sgr-widget .sgr-card, .sgr-widget .sgr-dot { transition: none !important; }
}

/* ---------- Branch rating cards (layout="branches") ---------- */
.sgr-widget.sgr-layout-branches .sgr-slide { display: flex; }
.sgr-widget .sgr-branch { display: flex; flex-direction: column; width: 100%; container-type: inline-size; }
.sgr-widget .sgr-branch-name {
	margin: 0 0 10px;
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
	color: var(--sgr-text);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}
.sgr-widget .sgr-branch-card {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 18px;
	flex: 1;
	margin: 0;
	padding: 22px 24px;
	background: var(--sgr-card-bg);
	border: 1px solid var(--sgr-border);
	border-radius: var(--sgr-radius);
	box-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 10px 28px -14px rgba(17, 24, 39, .18);
}
.sgr-widget .sgr-branch-head { display: flex; align-items: flex-start; gap: 10px; }
.sgr-widget .sgr-branch-head .sgr-g { flex: 0 0 auto; margin-top: 1px; }
.sgr-widget .sgr-branch-address { margin: 4px 0 0; color: var(--sgr-muted); font-size: .9rem; line-height: 1.55; }
.sgr-widget .sgr-branch-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 16px; }
.sgr-widget .sgr-branch .sgr-rating-num { font-size: clamp(2.2rem, 4vw, 3rem); }
.sgr-widget .sgr-branch .sgr-stars svg { width: 20px; height: 20px; }
.sgr-widget .sgr-branch .sgr-write { flex: 0 0 auto; }
@container (max-width: 380px) {
	.sgr-widget .sgr-branch-foot { flex-direction: column; align-items: stretch; }
	.sgr-widget .sgr-branch .sgr-write { justify-content: center; }
}
@media (max-width: 640px) {
	.sgr-widget.sgr-layout-branches .sgr-write { width: auto; }
}

/* Always use the full width of the section (Elementor flex containers otherwise shrink the widget to its content). */
.elementor-widget-sgr_google_reviews,
.elementor-widget-shortcode:has(.sgr-widget),
.wp-block-shortcode:has(.sgr-widget),
.wp-block-smart-google-reviews-reviews {
	width: 100% !important;
	max-width: 100% !important;
	flex: 1 1 100% !important;
	align-self: stretch !important;
}
.elementor-widget-sgr_google_reviews > .elementor-widget-container,
.elementor-widget-shortcode:has(.sgr-widget) > .elementor-widget-container { width: 100%; }
