/**
 * WooCommerce Reviews Archive — frontend styles.
 *
 * Base layout + default color values (mirroring the Figma spec). Elementor
 * style controls inject their own values via `{{WRAPPER}}` selectors and take
 * precedence, so these defaults serve as a safe fallback and define the layout.
 */

.wcwr-reviews {
	--wcwr-green: #1a5c3a;
	--wcwr-ink: #101828;
	--wcwr-cream: #f5f0e8;
	--wcwr-gold: #c8a878;
	font-family: 'Jost', sans-serif;
}

/* -------------------------------------------------------------------------
 * Rating summary bar
 * ---------------------------------------------------------------------- */
.wcwr-rating-summary {
	background-color: var(--wcwr-cream);
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	padding: 28px 24px;
}

.wcwr-rating-summary__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: center;
	max-width: 1280px;
	margin: 0 auto;
}

.wcwr-rating-filter {
	display: flex;
	align-items: center;
	gap: 10px;
	background-color: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.1);
	padding: 8px 16px;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.wcwr-rating-filter:hover {
	border-color: var(--wcwr-green);
}

.wcwr-rating-filter__num {
	font-family: 'Cormorant Garamond', serif;
	font-weight: 500;
	font-size: 15px;
	line-height: 1.5;
	color: #000000;
	min-width: 10px;
	text-align: center;
}

.wcwr-rating-filter .wcwr-star {
	width: 11px;
	height: 11px;
	flex: 0 0 auto;
}

.wcwr-rating-filter__bar {
	width: 80px;
	height: 3px;
	border-radius: 2px;
	background-color: rgba(0, 0, 0, 0.08);
	overflow: hidden;
	flex: 0 0 auto;
}

.wcwr-rating-filter__fill {
	display: block;
	height: 100%;
	background-color: var(--wcwr-green);
}

.wcwr-rating-filter__count {
	font-weight: 300;
	font-size: 10px;
	line-height: 15px;
	letter-spacing: 0.4px;
	color: #aaaaaa;
}

/* -------------------------------------------------------------------------
 * Main layout
 * ---------------------------------------------------------------------- */
.wcwr-main {
	padding: 48px 40px;
}

.wcwr-grid {
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 48px;
	max-width: 1280px;
	margin: 0 auto;
	align-items: start;
}

/* -------------------------------------------------------------------------
 * Sidebar filters
 * ---------------------------------------------------------------------- */
.wcwr-sidebar {
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.wcwr-filter-title {
	margin: 0;
	font-weight: 500;
	font-size: 10px;
	line-height: 15px;
	letter-spacing: 2.8px;
	text-transform: uppercase;
	color: #000000;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	padding-bottom: 10px;
}

.wcwr-filter-list {
	list-style: none;
	margin: 0;
	padding: 14px 0 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.wcwr-filter-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	background: none;
	border: 0;
	padding: 8px 0;
	margin: 0;
	cursor: pointer;
	text-align: left;
	font-weight: 300;
	font-size: 13px;
	line-height: 19.5px;
	letter-spacing: 0.52px;
	color: #555555;
	transition: color 0.15s ease;
}

.wcwr-filter-item:hover {
	color: var(--wcwr-green);
}

.wcwr-filter-item.is-active {
	font-weight: 500;
	color: var(--wcwr-green);
}

.wcwr-filter-dot {
	display: none;
	width: 6px;
	height: 6px;
	border-radius: 3px;
	background-color: var(--wcwr-green);
}

.wcwr-filter-item.is-active .wcwr-filter-dot {
	display: block;
}

/* Filter toggle button + drawer chrome — hidden on desktop. */
.wcwr-filter-toggle {
	display: none;
}

.wcwr-sidebar__header {
	display: none;
}

.wcwr-overlay {
	display: none;
}

/* -------------------------------------------------------------------------
 * Toolbar (count + sort)
 * ---------------------------------------------------------------------- */
.wcwr-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	padding-bottom: 16px;
}

.wcwr-count {
	margin: 0;
	font-weight: 300;
	font-size: 13px;
	line-height: 19.5px;
	letter-spacing: 0.52px;
	color: #888888;
}

.wcwr-sort {
	display: flex;
	align-items: center;
	gap: 6px;
}

.wcwr-sort-label {
	font-weight: 300;
	font-size: 11px;
	line-height: 16.5px;
	letter-spacing: 0.88px;
	color: #aaaaaa;
}

.wcwr-sort-btn {
	font-weight: 300;
	font-size: 11px;
	line-height: 16.5px;
	letter-spacing: 0.88px;
	text-transform: capitalize;
	text-align: center;
	color: #666666;
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.12);
	padding: 5px 12px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.wcwr-sort-btn.is-active {
	background-color: var(--wcwr-ink);
	border-color: var(--wcwr-ink);
	color: #ffffff;
	font-weight: 500;
}

/* -------------------------------------------------------------------------
 * Review list + cards
 * ---------------------------------------------------------------------- */
.wcwr-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding-top: 24px;
}

.wcwr-card {
	background-color: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.06);
	padding: 32px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.wcwr-card__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.wcwr-card__author {
	display: flex;
	align-items: center;
	gap: 14px;
}

.wcwr-avatar {
	width: 44px;
	height: 44px;
	border-radius: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	font-weight: 500;
	font-size: 13px;
	letter-spacing: 0.52px;
	flex: 0 0 auto;
}

.wcwr-card__meta {
	display: flex;
	flex-direction: column;
}

.wcwr-card__name-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.wcwr-name {
	font-weight: 500;
	font-size: 13px;
	line-height: 19.5px;
	letter-spacing: 0.52px;
	color: #000000;
}

.wcwr-verified {
	font-weight: 500;
	font-size: 9px;
	line-height: 13.5px;
	letter-spacing: 1.26px;
	text-transform: uppercase;
	color: var(--wcwr-green);
	border: 1px solid var(--wcwr-green);
	padding: 2px 6px;
}

.wcwr-location {
	font-weight: 300;
	font-size: 11px;
	line-height: 16.5px;
	letter-spacing: 0.44px;
	color: #aaaaaa;
	padding-top: 2px;
}

.wcwr-card__rating {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	flex: 0 0 auto;
}

.wcwr-stars {
	display: flex;
	gap: 2px;
}

.wcwr-star--filled {
	color: var(--wcwr-gold);
}

.wcwr-star--empty {
	color: #dddddd;
}

.wcwr-date {
	font-weight: 300;
	font-size: 10px;
	line-height: 15px;
	letter-spacing: 0.4px;
	color: #bbbbbb;
	text-align: right;
}

.wcwr-card__purchased {
	display: flex;
	align-items: center;
	gap: 6px;
}

.wcwr-purchased-label {
	font-weight: 500;
	font-size: 9px;
	line-height: 13.5px;
	letter-spacing: 1.62px;
	text-transform: uppercase;
	color: #666666;
}

.wcwr-product-link {
	font-family: 'Cormorant Garamond', serif;
	font-weight: 500;
	font-size: 14px;
	line-height: 21px;
	letter-spacing: 0.28px;
	color: #000000;
	text-decoration: none;
	border-bottom: 1px solid rgba(0, 0, 0, 0.15);
	transition: border-color 0.15s ease;
}

.wcwr-product-link:hover {
	border-color: var(--wcwr-green);
	color: var(--wcwr-green);
}

.wcwr-card__body {
	display: flex;
	flex-direction: column;
}

.wcwr-title {
	margin: 0 0 0 0;
	font-family: 'Cormorant Garamond', serif;
	font-weight: 500;
	font-size: 18px;
	line-height: 23.4px;
	letter-spacing: 0.18px;
	color: #000000;
}

.wcwr-content {
	margin: 0;
	padding-top: 10px;
	font-weight: 300;
	font-size: 13px;
	line-height: 24px;
	letter-spacing: 0.39px;
	color: #555555;
}

.wcwr-card__body .wcwr-title + .wcwr-content {
	padding-top: 0;
}

.wcwr-card__images {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wcwr-image {
	display: block;
	background-color: var(--wcwr-cream);
	overflow: hidden;
	line-height: 0;
}

.wcwr-image img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	display: block;
}

.wcwr-card__footer {
	display: flex;
	align-items: center;
	gap: 10px;
	border-top: 1px solid rgba(0, 0, 0, 0.05);
	padding-top: 8px;
}

.wcwr-helpful-count {
	font-weight: 300;
	font-size: 11px;
	line-height: 16.5px;
	letter-spacing: 0.44px;
	color: #aaaaaa;
}

.wcwr-helpful-btn {
	font-weight: 400;
	font-size: 11px;
	line-height: 16.5px;
	letter-spacing: 0.66px;
	color: #666666;
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.15);
	padding: 3px 10px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.wcwr-helpful-btn:hover {
	border-color: var(--wcwr-green);
	color: var(--wcwr-green);
}

.wcwr-helpful-btn.is-voted {
	color: var(--wcwr-green);
	border-color: var(--wcwr-green);
}

/* -------------------------------------------------------------------------
 * Load more
 * ---------------------------------------------------------------------- */
.wcwr-load-more-wrap {
	display: flex;
	justify-content: center;
	padding-top: 32px;
}

.wcwr-load-more {
	background-color: var(--wcwr-ink);
	border: 1px solid var(--wcwr-ink);
	color: #ffffff;
	font-weight: 500;
	font-size: 11px;
	line-height: 16.5px;
	letter-spacing: 0.88px;
	text-transform: capitalize;
	padding: 8px 28px;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.wcwr-load-more:hover {
	opacity: 0.88;
}

.wcwr-load-more.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.wcwr-empty {
	margin: 0;
	padding-top: 24px;
	color: #888888;
	font-size: 13px;
}

/* -------------------------------------------------------------------------
 * Responsive
 * ---------------------------------------------------------------------- */
@media (max-width: 991px) {
	.wcwr-grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.wcwr-sidebar {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 24px;
	}

	.wcwr-filter-group {
		flex: 1 1 200px;
	}
}

@media (max-width: 767px) {
	.wcwr-main {
		padding: 32px 20px;
	}

	.wcwr-rating-summary {
		padding: 20px 16px;
	}

	.wcwr-rating-filter {
		padding: 8px 12px;
	}

	.wcwr-rating-filter__bar {
		width: 56px;
	}

	.wcwr-card {
		padding: 20px;
	}

	.wcwr-filter-toggle {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		background: #ffffff;
		border: 1px solid rgba(0, 0, 0, 0.12);
		padding: 8px 16px;
		margin-bottom: 16px;
		font-size: 13px;
		color: #333333;
		cursor: pointer;
	}

	.wcwr-filter-toggle__icon {
		display: flex;
		flex-direction: column;
		gap: 4px;
		width: 18px;
	}

	.wcwr-filter-toggle__icon span {
		display: block;
		height: 2px;
		background: currentColor;
	}

	.wcwr-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		width: 85%;
		max-width: 320px;
		height: 100vh;
		height: 100dvh;
		margin: 0;
		background: #ffffff;
		z-index: 1001;
		transform: translateX(-100%);
		transition: transform 0.3s ease;
		overflow-y: auto;
		padding: 20px 24px;
		flex-direction: column;
		flex-wrap: nowrap;
		gap: 24px;
	}

	.wcwr-filter-group {
		flex: 0 0 auto;
		width: 100%;
	}

	.wcwr-reviews.drawer-open .wcwr-sidebar {
		transform: translateX(0);
	}

	.wcwr-sidebar__header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding-bottom: 16px;
		border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	}

	.wcwr-sidebar__title {
		font-size: 13px;
		font-weight: 500;
		letter-spacing: 1.4px;
		text-transform: uppercase;
		color: #000000;
	}

	.wcwr-sidebar__close {
		border: 0;
		background: none;
		padding: 0;
		font-size: 26px;
		line-height: 1;
		color: #333333;
		cursor: pointer;
	}

	.wcwr-overlay {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.4);
		z-index: 1000;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s ease, visibility 0.3s ease;
	}

	.wcwr-reviews.drawer-open .wcwr-overlay {
		opacity: 1;
		visibility: visible;
	}

	.wcwr-toolbar {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* -------------------------------------------------------------------------
 * Theme overrides — Minimog (and similar themes) style buttons globally with
 * rounded corners and a dark hover background. The Figma design uses square
 * corners and no dark hover, so force those away for every widget button.
 * ---------------------------------------------------------------------- */
.wcwr-reviews button,
.wcwr-reviews .wcwr-rating-filter,
.wcwr-reviews .wcwr-sort-btn,
.wcwr-reviews .wcwr-filter-item,
.wcwr-reviews .wcwr-helpful-btn,
.wcwr-reviews .wcwr-load-more {
	border-radius: 0 !important;
	-webkit-border-radius: 0 !important;
	border-top-left-radius: 0 !important;
	border-top-right-radius: 0 !important;
	border-bottom-left-radius: 0 !important;
	border-bottom-right-radius: 0 !important;
	box-shadow: none !important;
}

.wcwr-reviews .wcwr-rating-filter:not(.is-active):hover,
.wcwr-reviews .wcwr-rating-filter:not(.is-active):focus {
	background-color: #ffffff !important;
	color: #000000 !important;
}

/* Active rating filter — dark background + white text, matching the Sort active state. */
.wcwr-reviews .wcwr-rating-filter.is-active {
	background-color: var(--wcwr-ink) !important;
	border-color: var(--wcwr-ink) !important;
}

.wcwr-reviews .wcwr-rating-filter.is-active .wcwr-rating-filter__num,
.wcwr-reviews .wcwr-rating-filter.is-active .wcwr-rating-filter__count {
	color: #ffffff !important;
}

.wcwr-reviews .wcwr-rating-filter.is-active .wcwr-rating-filter__bar {
	background-color: rgba(255, 255, 255, 0.24) !important;
}

.wcwr-reviews .wcwr-rating-filter.is-active .wcwr-rating-filter__fill {
	background-color: #ffffff !important;
}

.wcwr-reviews .wcwr-sort-btn:hover,
.wcwr-reviews .wcwr-sort-btn:focus {
	background-color: #ffffff !important;
	color: #666666 !important;
}

.wcwr-reviews .wcwr-sort-btn.is-active:hover,
.wcwr-reviews .wcwr-sort-btn.is-active:focus {
	background-color: var(--wcwr-ink) !important;
	color: #ffffff !important;
}

.wcwr-reviews .wcwr-filter-item:hover,
.wcwr-reviews .wcwr-filter-item:focus {
	background: transparent !important;
}

.wcwr-reviews .wcwr-helpful-btn:hover,
.wcwr-reviews .wcwr-helpful-btn:focus {
	background-color: #ffffff !important;
}

.wcwr-reviews .wcwr-load-more:hover,
.wcwr-reviews .wcwr-load-more:focus {
	background-color: var(--wcwr-ink) !important;
	color: #ffffff !important;
}
