/**
 * Layali Reviews — curated testimonial slider.
 * Token-bound (--ly-*). Falls back to literal values if the theme isn't active.
 */

/* =============================================================================
   Section shell
   ============================================================================= */

.ly-reviews {
	position: relative;
	width: 100%;
	box-sizing: border-box;
	background-color: var(--ly-color-primary, #53225e);
	color: #ffffff;
	font-family: var(--ly-text-body, 'DM Sans', sans-serif);
}

.ly-reviews__header {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
	padding: 0 16px;
	margin-bottom: 28px;
}

.ly-reviews__title {
	margin: 0;
	font-family: var(--ly-text-heading, 'Bricolage Grotesque', sans-serif);
	font-weight: 700;
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	letter-spacing: -0.01em;
	color: #ffffff;
	line-height: 1.1;
}

.ly-reviews__aggregate {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: #ffffff;
}

.ly-reviews__count {
	font-size: 0.95rem;
	color: #ffffff;
	opacity: 0.92;
}

/* =============================================================================
   Stars
   ============================================================================= */

.ly-reviews__stars {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	color: #f5c518; /* default star color; widget overrides via selector */
	line-height: 0;
}

.ly-reviews__star {
	display: block;
}

/* =============================================================================
   Viewport + track (scroll-snap carousel)
   ============================================================================= */

.ly-reviews__viewport {
	position: relative;
	width: 100%;
}

.ly-reviews__track {
	display: flex;
	gap: 20px;
	padding: 8px 24px 24px;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none; /* Firefox */
}

.ly-reviews__track::-webkit-scrollbar {
	display: none; /* Safari/Chrome */
}

.ly-reviews__empty {
	padding: 32px;
	text-align: center;
	color: rgba(255, 255, 255, 0.8);
	width: 100%;
}

/* =============================================================================
   Card
   ============================================================================= */

.ly-reviews__card {
	flex: 0 0 320px;
	width: 320px;
	box-sizing: border-box;
	background-color: #ffffff;
	color: var(--ly-color-text, #1f1f23);
	border-radius: 16px;
	padding: 20px 22px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	scroll-snap-align: start;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.ly-reviews__card-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.ly-reviews__name-row {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	min-width: 0;
}

.ly-reviews__name {
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--ly-color-text, #1f1f23);
}

.ly-reviews__verified {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 0.8rem;
	color: var(--ly-color-text-muted, #4a4a52);
}

.ly-reviews__verified svg {
	display: block;
}

.ly-reviews__date {
	font-size: 0.8rem;
	color: var(--ly-color-text-muted, #4a4a52);
	white-space: nowrap;
}

.ly-reviews__card-title {
	margin: 0;
	font-family: var(--ly-text-heading, 'Bricolage Grotesque', sans-serif);
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--ly-color-text, #1f1f23);
	line-height: 1.2;
}

.ly-reviews__body {
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--ly-color-text, #1f1f23);
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 5;
	line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ly-reviews__body > p {
	margin: 0 0 0.5em;
}
.ly-reviews__body > p:last-child {
	margin-bottom: 0;
}

.ly-reviews__product {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-top: 12px;
	border-top: 1px solid var(--ly-color-border, #e6e6e8);
}

.ly-reviews__product-thumb {
	width: 32px;
	height: 32px;
	border-radius: 6px;
	overflow: hidden;
	flex-shrink: 0;
	background: var(--ly-color-surface, #fbf5ef);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ly-reviews__product-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ly-reviews__product-name {
	font-size: 0.85rem;
	color: var(--ly-color-text-muted, #4a4a52);
}

/* =============================================================================
   Arrows
   ============================================================================= */

.ly-reviews__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 999px;
	background: #ffffff;
	color: var(--ly-color-primary, #53225e);
	border: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
	z-index: 2;
	transition: transform 150ms ease, opacity 150ms ease;
}

.ly-reviews__arrow:hover {
	transform: translateY(-50%) scale(1.05);
}

.ly-reviews__arrow:disabled {
	opacity: 0;
	pointer-events: none;
}

.ly-reviews__arrow--prev {
	left: 8px;
}

.ly-reviews__arrow--next {
	right: 8px;
}

/* =============================================================================
   Reduced motion
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
	.ly-reviews__track {
		scroll-behavior: auto;
	}
	.ly-reviews__arrow {
		transition: none;
	}
}

/* =============================================================================
   Mobile
   ============================================================================= */

/* Touch devices of ANY width (tablets included): arrows off — swipe is the
   affordance. (hover:none + pointer:coarse = touch-first device.) */
@media (hover: none) and (pointer: coarse) {
	.ly-reviews__arrow {
		display: none !important;
	}
}

@media (max-width: 640px) {
	.ly-reviews__arrow {
		display: none !important;
	}
	/* One card per view, CENTERED, with an even ~20px peek of the
	   neighbors on each side (the swipe affordance). !important because
	   Elementor's card-width control emits a higher-specificity fixed
	   width (default 320px) that otherwise overrides mobile sizing —
	   320px on a 390px screen left thin awkward slivers of the adjacent
	   cards at the edges. The control's MOBILE breakpoint is therefore
	   intentionally inert for the slider; the viewport-derived width IS
	   the mobile design. Scoped to the track so the standalone
	   Card_Widget (same .ly-reviews__card class, no track ancestor) keeps
	   sizing to its own container instead of the viewport. */
	.ly-reviews__track > .ly-reviews__card {
		flex-basis: calc( 100vw - 72px ) !important;
		width: calc( 100vw - 72px ) !important;
		scroll-snap-align: center;
	}
	.ly-reviews__track {
		padding-left: 16px;
		padding-right: 16px;
		scroll-padding: 0 16px;
	}
}

/* =============================================================================
   Single-card widget (Card_Widget) — sits inside a mega menu, sidebar, etc.
   Reuses .ly-reviews__card markup; this block adds wrapper-only adjustments
   (full-width, clamped body) without affecting the slider variant.
   ============================================================================= */

.ly-review-card-widget {
	display: block;
	width: 100%;
}

.ly-review-card-widget .ly-reviews__card {
	flex: 0 0 auto;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 20px;
	box-sizing: border-box;
	border-radius: 16px;
	background-color: #faf6f1;
	box-shadow: none;
}

.ly-review-card-widget .ly-reviews__card-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 8px;
}

/* Every text element inherits from .ly-reviews__card's `color` (the Elementor
   text-color control writes there) and varies only by opacity. Setting an
   explicit rgba() here would override the widget control and look broken. */
.ly-review-card-widget .ly-reviews__date {
	white-space: nowrap;
	font-size: 0.78rem;
	color: inherit;
	opacity: 0.6;
}

.ly-review-card-widget .ly-reviews__name {
	font-weight: 600;
	font-size: 0.95rem;
	color: inherit;
}

/* "Verified buyer" label + product name in footer — slider's base rules set
   them to --ly-color-text-muted (dark gray) which becomes invisible on a
   dark card. Inherit instead so the widget text-color control covers them. */
.ly-review-card-widget .ly-reviews__verified,
.ly-review-card-widget .ly-reviews__verified-label {
	color: inherit;
	opacity: 0.75;
}

.ly-review-card-widget .ly-reviews__product-name {
	color: inherit;
	opacity: 0.78;
}

.ly-review-card-widget .ly-reviews__card-title {
	margin: 6px 0 4px;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.3;
	color: inherit;
}

.ly-review-card-widget .ly-reviews__body {
	font-size: 0.88rem;
	line-height: 1.45;
	color: inherit;
	opacity: 0.82;
}

.ly-review-card-widget .ly-reviews__body p {
	margin: 0;
}

/* Clamp body to N lines using --ly-review-card-clamp set inline on the
   wrapper. Set by the Elementor "Clamp body to N lines" control. */
.ly-review-card-widget .ly-reviews__card--clamped .ly-reviews__body {
	display: -webkit-box;
	-webkit-line-clamp: var( --ly-review-card-clamp, 4 );
	line-clamp: var( --ly-review-card-clamp, 4 );
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ly-review-card-widget .ly-reviews__product {
	margin-top: 14px;
	padding-top: 12px;
	/* Fallback for browsers without color-mix() support (Safari < 16.4 / iOS
	   < 16.4). Modern engines parse the color-mix() declaration second and
	   override; older engines silently drop it and keep the rgba above. */
	border-top: 1px solid rgba( 0, 0, 0, 0.12 );
	border-top: 1px solid color-mix( in srgb, currentColor 15%, transparent );
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 0.85rem;
	color: inherit;
	opacity: 0.78;
}

.ly-review-card-widget .ly-reviews__product-thumb img {
	width: 36px;
	height: 36px;
	object-fit: cover;
	border-radius: 8px;
}

.ly-review-card-widget--empty {
	padding: 24px;
	border: 1px dashed rgba( 0, 0, 0, 0.15 );
	border-radius: 12px;
	text-align: center;
	color: rgba( 31, 31, 35, 0.6 );
	font-size: 0.9rem;
}

