/* ═══════════════════════════════════════════════════
   WooCommerce Reviews for Elementor — Frontend Styles
   ═══════════════════════════════════════════════════ */

/* ── Reset / base ──────────────────────────────────── */
.wre-wrapper *,
.wre-wrapper *::before,
.wre-wrapper *::after {
	box-sizing: border-box;
}

.wre-empty {
	color: #9CA3AF;
	font-style: italic;
	text-align: center;
	padding: 32px 0;
}

/* ── Card base ─────────────────────────────────────── */
.wre-card {
	background: #ffffff;
	padding: 28px;
	border-radius: 12px;
	border: 1px solid #E5E7EB;
	transition: transform 0.22s ease, box-shadow 0.22s ease;
	display: flex;
	flex-direction: column;
	gap: 0;
	position: relative;
}

.wre-card--hover:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(0,0,0,.10);
}

/* ── Card header ───────────────────────────────────── */
.wre-card-header {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 14px;
}

/* ── Avatar ────────────────────────────────────────── */
.wre-avatar {
	flex-shrink: 0;
}

.wre-avatar img,
.wre-avatar-placeholder {
	width: 48px;
	height: 48px;
	object-fit: cover;
	display: block;
}

.wre-avatar--circle img,
.wre-avatar--circle .wre-avatar-placeholder {
	border-radius: 50%;
}

.wre-avatar--rounded img,
.wre-avatar--rounded .wre-avatar-placeholder {
	border-radius: 8px;
}

.wre-avatar--square img,
.wre-avatar--square .wre-avatar-placeholder {
	border-radius: 0;
}

.wre-avatar-placeholder {
	background: linear-gradient(135deg, #818CF8 0%, #6366F1 100%);
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	user-select: none;
}

/* ── Meta (name + date) ────────────────────────────── */
.wre-meta {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.wre-author {
	font-weight: 600;
	font-size: 0.9375rem;
	color: #111827;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wre-date {
	font-size: 0.8125rem;
	color: #9CA3AF;
}

/* ── Stars ─────────────────────────────────────────── */
.wre-stars {
	font-size: 18px;
	line-height: 1;
	letter-spacing: 0.05em;
	margin-bottom: 10px;
	display: block;
}

.wre-star-filled { color: #F59E0B; }
.wre-star-empty  { color: #D1D5DB; }

/* ── Review title ──────────────────────────────────── */
.wre-review-title {
	margin: 0 0 8px;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #111827;
	line-height: 1.4;
}

/* ── Content ───────────────────────────────────────── */
.wre-content {
	font-size: 0.9375rem;
	color: #374151;
	line-height: 1.65;
	margin-top: 12px;
	flex: 1;
}

/* ── Read more ─────────────────────────────────────── */
.wre-read-more {
	background: none;
	border: none;
	padding: 0;
	margin-top: 6px;
	font-size: 0.875rem;
	color: #6366F1;
	cursor: pointer;
	font-family: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wre-read-more:hover {
	opacity: 0.75;
}

/* ── Verified badge ────────────────────────────────── */
.wre-verified {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 0.75rem;
	font-weight: 500;
	color: #059669;
	background: #ECFDF5;
	padding: 2px 8px;
	border-radius: 99px;
	margin-top: 2px;
	align-self: flex-start;
}

/* ── Product name link ─────────────────────────────── */
.wre-product-name {
	display: inline-block;
	margin-top: 14px;
	font-size: 0.8125rem;
	color: #6B7280;
	text-decoration: none;
	border-top: 1px solid #F3F4F6;
	padding-top: 12px;
	width: 100%;
	transition: color 0.15s;
}

.wre-product-name:hover {
	color: #111827;
}

.wre-product-name::before {
	content: '📦 ';
	font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════
   GRID LAYOUT
   ═══════════════════════════════════════════════════ */

.wre-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

/* ═══════════════════════════════════════════════════
   LIST LAYOUT
   ═══════════════════════════════════════════════════ */

.wre-list {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.wre-mode-list .wre-card {
	flex-direction: row;
	gap: 20px;
	align-items: flex-start;
}

.wre-mode-list .wre-card .wre-card-header {
	flex-direction: column;
	align-items: center;
	text-align: center;
	flex-shrink: 0;
	width: 80px;
	margin-bottom: 0;
}

.wre-mode-list .wre-card .wre-meta {
	align-items: center;
}

/* Everything after the header fills the remaining width */
.wre-mode-list .wre-card > *:not(.wre-card-header) {
	min-width: 0;
	flex: 1 1 auto;
}

/* In list mode, non-header children should not grow independently;
   wrap them in a column flow */
.wre-mode-list .wre-card {
	display: grid;
	grid-template-columns: 80px 1fr;
	grid-template-rows: auto;
}

.wre-mode-list .wre-card .wre-card-header {
	grid-column: 1;
	grid-row: 1 / -1; /* span all rows so avatar stays centred */
	align-self: start;
}

/* ═══════════════════════════════════════════════════
   MASONRY LAYOUT
   ═══════════════════════════════════════════════════ */

.wre-masonry {
	columns: 3;
	column-gap: 24px;
}

.wre-masonry .wre-card {
	break-inside: avoid;
	margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════
   CAROUSEL LAYOUT
   ═══════════════════════════════════════════════════ */

.wre-mode-carousel {
	position: relative;
	/* Overflow is intentionally visible here so the arrow buttons
	   positioned at ±20px outside the track edge are not clipped.
	   The track viewport itself is clipped via .wre-carousel-viewport. */
}

.wre-carousel-viewport {
	overflow: hidden;
	width: 100%;
}

.wre-carousel-track {
	display: flex;
	gap: 24px;
	transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	will-change: transform;
	align-items: stretch;
}

.wre-mode-carousel .wre-card {
	flex: 0 0 auto;
	/* width set by JS based on slides count */
}

/* ─────────────────────────────────────────────────────
   Fix: Elementor's widget container can add overflow:hidden
   which clips arrows that extend beyond the track.
   We override it specifically for this widget.
   ───────────────────────────────────────────────────── */
.elementor-widget-wre_reviews .elementor-widget-container {
	overflow: visible !important;
}

/* ═══════════════════════════════════════════════════
   CAROUSEL LAYOUT
   ═══════════════════════════════════════════════════ */

.wre-mode-carousel {
	position: relative;
}

/* Inside mode (default) — arrows sit over the edge cards */
.wre-mode-carousel.wre-arrows-inside {
	/* no extra padding needed, arrows overlay the track */
}

/* Outside mode — expand the wrapper to make room for arrows.
   The amount matches the default arrow size (44px) ÷ 2 + gap. */
.wre-mode-carousel.wre-arrows-outside {
	padding-left: 32px;
	padding-right: 32px;
}

.wre-carousel-viewport {
	overflow: hidden;
	width: 100%;
	/* Small vertical overflow room so box-shadow on cards isn't clipped */
	padding: 4px 0;
	margin: -4px 0;
}

.wre-carousel-track {
	display: flex;
	gap: 24px;
	transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	will-change: transform;
	align-items: stretch;
}

.wre-mode-carousel .wre-card {
	flex: 0 0 auto;
	/* width set by JS */
}

/* ── Arrows ────────────────────────────────────────── */

.wre-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: #ffffff;
	border: 1px solid #E5E7EB;
	color: #374151;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
	line-height: 1;
	/* Prevent text-selection flicker on fast clicks */
	user-select: none;
}

.wre-arrow:hover {
	background-color: #374151;
	color: #ffffff;
	border-color: #374151;
}

.wre-arrow:focus-visible {
	outline: 2px solid #6366F1;
	outline-offset: 2px;
}

.wre-arrow:disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

/* Inside placement (default) — arrows sit inside the viewport bounds */
.wre-arrows-inside .wre-arrow-prev { left: 12px;  }
.wre-arrows-inside .wre-arrow-next { right: 12px; }

/* Outside placement — arrows sit beyond the viewport */
.wre-arrows-outside .wre-arrow-prev { left: 0;  transform: translateX(-50%) translateY(-50%); }
.wre-arrows-outside .wre-arrow-next { right: 0; transform: translateX(50%)  translateY(-50%); }

/* ── Dots ──────────────────────────────────────────── */

.wre-dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 20px;
	flex-wrap: wrap;
}

.wre-dot {
	width: 8px;
	height: 8px;
	background-color: #D1D5DB;
	border: none;
	padding: 0;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.25s ease, width 0.25s ease, opacity 0.2s ease;
	flex-shrink: 0;
}

.wre-dot:focus-visible {
	outline: 2px solid #6366F1;
	outline-offset: 2px;
}

.wre-dot.is-active {
	background-color: #6366F1;
	transform: scale(1.35);
}

/* Shape: circle (default) */
.wre-dots-shape-circle .wre-dot         { border-radius: 50%; }
.wre-dots-shape-circle .wre-dot.is-active { border-radius: 50%; }

/* Shape: rounded */
.wre-dots-shape-rounded .wre-dot        { border-radius: 4px; }

/* Shape: square */
.wre-dots-shape-square .wre-dot         { border-radius: 0; }

/* Shape: pill — inactive stays small circle, active widens into a pill */
.wre-dots-shape-pill .wre-dot           { border-radius: 99px; }
.wre-dots-shape-pill .wre-dot.is-active {
	border-radius: 99px;
	width: 24px;   /* overridden by Elementor control if set */
	transform: none; /* pill expands width instead of scaling */
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════ */

@media (max-width: 1024px) {
	.wre-grid          { grid-template-columns: repeat(2, 1fr); }
	.wre-masonry       { columns: 2; }
}

@media (max-width: 767px) {
	.wre-grid          { grid-template-columns: 1fr; }
	.wre-masonry       { columns: 1; }
	.wre-mode-list .wre-card { flex-direction: column; }
	.wre-mode-list .wre-card .wre-card-header { flex-direction: row; width: auto; text-align: left; align-items: flex-start; }
	.wre-mode-list .wre-card .wre-meta { align-items: flex-start; }
	.wre-arrow-prev { left: -8px; }
	.wre-arrow-next { right: -8px; }
}
