/**
 * WAC Google Reviews - frontend styles.
 * Layout-only rules live here; colors/sizes exposed as Elementor style
 * controls are applied inline via the widget's `selectors`.
 */

.wac-greviews {
	position: relative;
}

/* Kept as a block so the alignment control's `text-align` reaches both the
   title and the inline-flex summary row. */
.wac-greviews__head {
	text-align: center;
}

.wac-greviews__title {
	margin: 0;
	font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
	font-weight: 600;
	line-height: 1.2;
}

/* Optional aggregate rating line under the title. */
.wac-greviews__summary {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 12px;
}

.wac-greviews__score {
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1;
}

.wac-greviews__count {
	font-size: 0.8rem;
	opacity: 0.75;
}

/* ------------------------------------------------------------------
 * Stars - a grey row with a gold row clipped over it, so fractional
 * aggregate ratings render without extra markup.
 * ---------------------------------------------------------------- */
.wac-greviews__stars {
	--wac-star-size: 15px;
	--wac-star-gap: 2px;
	--wac-star-on: #FBBC04;
	--wac-star-off: #DADCE0;

	position: relative;
	display: inline-block;
	line-height: 0;
	white-space: nowrap;
}

.wac-greviews__stars-off,
.wac-greviews__stars-on {
	display: block;
	white-space: nowrap;
	font-size: 0;
}

.wac-greviews__stars-on {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	overflow: hidden;
}

.wac-greviews__stars svg {
	display: inline-block;
	vertical-align: top;
	width: var(--wac-star-size);
	height: var(--wac-star-size);
	margin-right: var(--wac-star-gap);
	fill: var(--wac-star-off);
}

/* No trailing gap, so the clipped width percentage maps exactly onto the stars. */
.wac-greviews__stars svg:last-child {
	margin-right: 0;
}

.wac-greviews__stars-on svg {
	fill: var(--wac-star-on);
}

/* ------------------------------------------------------------------
 * Carousel
 * ---------------------------------------------------------------- */
.wac-greviews__carousel {
	position: relative;
}

.wac-greviews__viewport {
	overflow: hidden;
}

.wac-greviews__slide {
	height: auto;
	align-self: stretch;
}

/* Equal Card Heights off: each card shrinks to its own content. */
.wac-greviews:not(.wac-greviews--equal) .wac-greviews__slide {
	align-self: flex-start;
}

.wac-greviews:not(.wac-greviews--equal) .wac-greview-card {
	height: auto;
}

.wac-greviews__carousel.is-locked .wac-greviews__arrow,
.wac-greviews__carousel.is-locked .wac-greviews__pagination {
	display: none;
}

/* ------------------------------------------------------------------
 * Card
 * ---------------------------------------------------------------- */
.wac-greview-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
}

.wac-greview-card__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}

.wac-greview-card__avatar {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	color: #fff;
	font-weight: 600;
	line-height: 1;
	text-transform: uppercase;
	overflow: hidden;
}

.wac-greview-card__avatar--photo {
	display: block;
	object-fit: cover;
}

.wac-greview-card__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.wac-greview-card__author {
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wac-greview-card__date {
	font-size: 0.75rem;
	line-height: 1.25;
}

/* `align-self` keeps the stars shrink-to-fit inside the column flex card;
   stretched, the overlay's width percentage would measure the whole card. */
.wac-greview-card .wac-greviews__stars {
	align-self: flex-start;
	margin-bottom: 12px;
}

.wac-greview-card__body {
	flex: 1;
}

.wac-greview-card__text {
	margin: 0;
	font-size: 0.82rem;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.wac-greview-card__more {
	display: inline-block;
	margin: 2px 0 0;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 0.82rem;
	line-height: 1.6;
	text-decoration: underline;
	cursor: pointer;
}

.wac-greview-card__more:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Google attribution footer */
.wac-greview-card__footer {
	margin-top: 16px;
}

.wac-greview-card__footer,
.wac-greview-card__footer-link {
	display: flex;
	align-items: center;
	gap: 8px;
	color: inherit;
	text-decoration: none;
}

.wac-greview-card__glogo {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
}

.wac-greview-card__posted {
	display: flex;
	flex-direction: column;
	font-size: 0.7rem;
	line-height: 1.35;
}

.wac-greview-card__brand {
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1.3;
}

/* ------------------------------------------------------------------
 * Navigation
 * ---------------------------------------------------------------- */
.wac-greviews__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity 0.2s ease;
}

.wac-greviews__arrow--prev {
	left: -50px;
}

.wac-greviews__arrow--next {
	right: -50px;
}

.wac-greviews__arrow.swiper-button-disabled {
	opacity: 0.3;
	cursor: default;
}

.wac-greviews__pagination {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 24px;
}

.wac-greviews__pagination .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	margin: 0;
	opacity: 1;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

/* Editor-only messages */
.wac-greviews--notice {
	padding: 20px;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
	font-size: 0.85rem;
}

.wac-greviews__editor-note {
	margin: 12px 0 0;
	font-size: 0.75rem;
	opacity: 0.7;
}

@media (max-width: 1024px) {
	.wac-greviews__arrow--prev {
		left: -14px;
	}

	.wac-greviews__arrow--next {
		right: -14px;
	}
}

@media (max-width: 767px) {
	.wac-greviews__arrow {
		display: none;
	}
}
