/**
 * Blocksy Reviews Plus — Card & grid styles.
 *
 * Mirrors the look of blocksy-reviews-plus-preview.html /
 * blocksy-reviews-plus-preview-popup.html.
 */

.br-clearfix::after { content: ''; display: table; clear: both; }

.br-grid, .br-grid *,
.br-style-detailed-list, .br-style-detailed-list *,
.br-reviews-ajax, .br-reviews-ajax *,
.br-paginated, .br-paginated *,
.br-review-form-wrap, .br-review-form-wrap *,
.br-thanks-overlay, .br-thanks-overlay * {
	box-sizing: border-box;
}
.br-grid > .br-card,
.br-style-detailed-list > .br-review-detailed {
	margin: 0;
	max-width: none;
	float: none;
}

/* ── Grid wrapper ───────────────────────────────── */
.br-grid {
	display: grid;
	gap: 20px;
	align-items: start;
	grid-template-columns: repeat(var(--br-cols, 3), minmax(0, 1fr));
}
.br-grid[data-columns="1"] { --br-cols: 1; }
.br-grid[data-columns="2"] { --br-cols: 2; }
.br-grid[data-columns="3"] { --br-cols: 3; }
.br-grid[data-columns="4"] { --br-cols: 4; }
.br-grid[data-columns="5"] { --br-cols: 5; }
.br-grid[data-columns="6"] { --br-cols: 6; }
.br-grid[data-columns-mobile="1"] { --br-cols-m: 1; }
.br-grid[data-columns-mobile="2"] { --br-cols-m: 2; }
.br-grid[data-columns-mobile="3"] { --br-cols-m: 3; }
.br-grid[data-columns-mobile="4"] { --br-cols-m: 4; }
.br-grid[data-columns-mobile="5"] { --br-cols-m: 5; }
.br-grid[data-columns-mobile="6"] { --br-cols-m: 6; }
@media (max-width: 768px) {
	.br-grid.br-grid[data-columns] {
		--br-cols: var(--br-cols-m, 1);
		grid-template-columns: repeat(var(--br-cols-m, 1), minmax(0, 1fr));
		gap: 12px;
	}
	.br-grid .br-card-body { padding: 10px 12px; gap: 6px; }
	.br-grid .br-card-name-row { font-size: 13px; gap: 4px; }
	.br-grid .br-card-verified { margin-left: 0; font-size: 11px; padding: 2px 6px; }
	.br-grid .br-card-excerpt { font-size: 12px; }
}

/* ── Card ────────────────────────────────────────── */
.br-grid .br-card,
.br-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: auto;
	align-self: start;
	cursor: pointer;
	color: #111827;
	transition: box-shadow .15s ease, transform .15s ease;
}
.br-card:hover {
	box-shadow: 0 8px 24px rgba(0,0,0,.06);
	transform: translateY(-2px);
}
.br-style-minimal { border: none; box-shadow: none; background: transparent; }
.br-style-minimal .br-card { border: none; box-shadow: none; background: transparent; }
.br-style-bordered .br-card { border: 2px solid #111827; }

.br-card-thumb {
	background: #f3f4f6;
	position: relative;
	overflow: hidden;
	width: 100%;
	aspect-ratio: var(--br-thumb-ratio, 4 / 3);
}
.br-card-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	position: absolute;
	inset: 0;
}
.br-card-thumb .br-thumb-badge {
	position: absolute; top: 10px; left: 10px;
	background: rgba(255,255,255,.92);
	color: #111827;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	z-index: 1;
}
.br-card-thumb .br-card-thumb-empty {
	display: flex; align-items: center; justify-content: center;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	color: #9ca3af; font-size: 13px;
}

.br-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.br-grid .br-card-name-row,
.br-card-name-row {
	display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
	font-size: 15px; font-weight: 700; color: #111827;
}
.br-card-name-prefix { font-weight: 400; color: #6b7280; margin-right: 2px; }
.br-grid .br-card-name-redacted,
.br-card-name-redacted {
	color: #111827;
	-webkit-text-fill-color: #111827;
}

.br-card-verified {
	display: inline-flex; align-items: center; gap: 4px;
	font-size: 12px; font-weight: 500; color: #065f46;
	background: #ecfdf5;
	padding: 3px 8px;
	border-radius: 999px;
	margin-left: auto;
}
.br-card-verified .br-check {
	width: 14px; height: 14px; border-radius: 50%;
	background: #10b981; color: #fff;
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 9px; font-weight: 700;
}

.br-card-rating {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #6b7280;
	white-space: nowrap;
}
.br-card-rating > span { white-space: nowrap; flex: 0 0 auto; }
.br-card-rating-num { font-variant-numeric: tabular-nums; }

.br-grid .br-card-excerpt,
.br-card-excerpt,
.br-grid .br-card p.br-card-excerpt {
	font-size: 13px; line-height: 1.55; color: #4b5563;
	-webkit-text-fill-color: #4b5563;
	opacity: 1;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.br-card-actions { margin-top: auto; display: flex; gap: 8px; padding-top: 8px; }

/* ── Buttons ─────────────────────────────────────── */
.br-btn {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 6px;
	border: 1px solid var(--theme-button-background, #111827);
	background: var(--theme-button-background, #111827);
	color: var(--theme-button-text, #fff);
	font-size: 13px;
	cursor: pointer;
	font-family: inherit;
	text-decoration: none;
}
.br-btn:hover { opacity: .92; }
.br-btn--ghost {
	background: transparent;
	color: var(--theme-button-background, #111827);
}

.br-empty, .br-error {
	padding: 12px;
	border: 1px solid #d63638;
	background: #fff0f0;
	color: #a00;
	border-radius: 6px;
}

/* ── Star widget (card / popup summary) ──────────── */
.br-stars {
	display: inline-flex;
	flex-wrap: nowrap;
	align-items: center;
	white-space: nowrap;
	flex: 0 0 auto;
	letter-spacing: 1px;
	font-size: 14px;
	color: #f59e0b;
}
.br-stars .br-star { display: inline-block; color: #fbbf24; opacity: .35; }
.br-stars .br-star.on, .br-stars .br-star.is-on { opacity: 1; }
.br-stars.outline .br-star {
	-webkit-text-stroke: 1.5px #f59e0b;
	color: transparent;
}
.br-stars.outline .br-star.on, .br-stars.outline .br-star.is-on { color: #f59e0b; }

/* ── Pagination (server-rendered) ────────────────── */
.br-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.br-page-link {
	padding: 6px 12px;
	border-radius: 6px;
	border: 1px solid var(--theme-palette-color-3, #e5e7eb);
	color: var(--theme-palette-color-4, #6b7280);
	text-decoration: none;
	font-size: 13px;
}
.br-page-link:hover { background: #f3f4f6; }
.br-page-link.is-current {
	background: var(--theme-button-background, #111827);
	color: var(--theme-button-text, #fff);
	border-color: var(--theme-button-background, #111827);
}
.br-page-gap { color: var(--theme-palette-color-4, #6b7280); padding: 6px 4px; }

/* ── AJAX shell wrapper ──────────────────────────── */
.br-reviews-ajax { min-height: 240px; position: relative; }
.br-ajax-loading {
	padding: 40px;
	text-align: center;
	color: var(--theme-palette-color-4, #6b7280);
}
.br-loader {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: currentColor;
}
.br-loader-svg { display: block; animation: br-loader-spin .8s linear infinite; }
@keyframes br-loader-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.br-loader-svg { animation: none; }
}
.br-reviews-ajax.is-loading .br-ajax-loading { opacity: .85; }

/* ── Detailed review list (page-by-page mode) ────── */
.br-review-detailed {
	padding: 24px 0;
	border-bottom: 1px solid var(--theme-palette-color-3, #e5e7eb);
}
.br-review-detailed:last-child { border-bottom: none; }
.br-review-detailed .br-review-header {
	display: flex; align-items: center; gap: 12px;
	margin-bottom: 12px;
}
.br-review-detailed .br-review-avatar {
	width: 48px; height: 48px; border-radius: 50%;
	background: linear-gradient(135deg, #a78bfa 0%, #6d28d9 100%);
	color: #fff;
	display: inline-flex; align-items: center; justify-content: center;
	font-weight: 600; font-size: 18px;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(109, 40, 217, .2);
}
.br-review-detailed .br-review-avatar.is-1 { background: linear-gradient(135deg,#fb923c,#ea580c); box-shadow:0 2px 8px rgba(234,88,12,.2); }
.br-review-detailed .br-review-avatar.is-2 { background: linear-gradient(135deg,#34d399,#059669); box-shadow:0 2px 8px rgba(5,150,105,.2); }
.br-review-detailed .br-review-avatar.is-3 { background: linear-gradient(135deg,#f472b6,#db2777); box-shadow:0 2px 8px rgba(219,39,119,.2); }
.br-review-detailed .br-review-avatar.is-4 { background: linear-gradient(135deg,#60a5fa,#2563eb); box-shadow:0 2px 8px rgba(37,99,235,.2); }
.br-review-detailed .br-review-avatar.is-5 { background: linear-gradient(135deg,#fbbf24,#d97706); box-shadow:0 2px 8px rgba(217,119,6,.2); }
.br-review-detailed .br-review-name { font-weight: 700; font-size: 18px; color: #111827; flex: 1; }
.br-review-detailed .br-review-name-prefix { font-weight: 400; color: #6b7280; margin-right: 4px; }
.br-review-detailed .br-review-stars {
	font-size: 20px; margin: 6px 0 14px;
	letter-spacing: 2px; line-height: 1;
}
.br-review-detailed .br-review-stars .br-star {
	display: inline-block; color: #fbbf24; opacity: .35;
}
.br-review-detailed .br-review-stars .br-star.on { opacity: 1; }
.br-review-detailed .br-review-title {
	margin: 0 0 10px; font-size: 22px; font-weight: 700;
	letter-spacing: -.01em; color: #111827; line-height: 1.3;
}
.br-review-detailed .br-review-content {
	font-size: 15px; line-height: 1.65; color: #374151;
	margin: 0 0 14px; white-space: pre-wrap;
}
.br-review-detailed .br-review-meta {
	display: flex; align-items: center; gap: 10px;
	font-size: 14px; color: #6b7280; margin-bottom: 16px;
	flex-wrap: wrap;
}
.br-review-detailed .br-review-meta .br-meta-dot { color: #d1d5db; }
.br-review-detailed .br-review-verified {
	display: inline-flex; align-items: center; gap: 6px;
	color: #111827; font-weight: 500;
}
.br-review-detailed .br-review-verified .br-check {
	width: 20px; height: 20px; border-radius: 50%;
	background: #10b981; color: #fff;
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.br-review-detailed .br-review-photos {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px; margin-bottom: 16px; max-width: 480px;
}
.br-review-detailed .br-review-photos.cols-2 { grid-template-columns: repeat(2, 1fr); max-width: 320px; }
.br-review-detailed .br-review-photos.cols-1 { grid-template-columns: 1fr; max-width: 200px; }
.br-review-detailed .br-review-photos .br-photo {
	aspect-ratio: 1/1; border-radius: 10px;
	background: #f3f4f6; overflow: hidden; cursor: zoom-in;
	border: 1px solid var(--theme-palette-color-3, #e5e7eb);
	background-size: cover; background-position: center;
}
.br-review-detailed .br-review-photos .br-photo img {
	width: 100%; height: 100%; object-fit: cover; display: block;
}
.br-review-detailed .br-review-footer {
	display: flex; align-items: center; gap: 16px;
	font-size: 14px; color: #4b5563;
}
.br-review-detailed .br-vote-btn {
	display: inline-flex; align-items: center; gap: 5px;
	background: transparent; border: 0; color: #4b5563;
	cursor: pointer; padding: 4px 6px; border-radius: 6px;
	font-size: 14px; font-family: inherit;
}
.br-review-detailed .br-vote-btn:hover { background: #f3f4f6; }
.br-review-detailed .br-vote-btn.is-up.is-active { color: #10b981; }
.br-review-detailed .br-vote-btn.is-down.is-active { color: #ef4444; }
.br-review-detailed .br-vote-icon-wrap {
	position: relative;
	width: 15px; height: 15px;
	display: inline-flex; align-items: center; justify-content: center;
	flex-shrink: 0;
}
.br-review-detailed .br-vote-icon,
.br-review-detailed .br-vote-loader {
	width: 15px; height: 15px;
	display: block;
}
.br-review-detailed .br-vote-loader { display: none; }
.br-review-detailed .br-vote-btn.is-loading .br-vote-icon { display: none; }
.br-review-detailed .br-vote-btn.is-loading .br-vote-loader {
	display: block;
	animation: br-vote-spin .8s linear infinite;
}
@keyframes br-vote-spin { to { transform: rotate(360deg); } }
.br-review-detailed .br-vote-count { color: var(--theme-palette-color-4, #6b7280); font-variant-numeric: tabular-nums; }

/* ── List container (mode = detailed, page-by-page) ─ */
.br-style-detailed-list > .br-review-detailed:first-child { padding-top: 0; }
.br-style-detailed-list > .br-review-detailed:last-child { padding-bottom: 0; }

/* ── Review form ─────────────────────────────────── */
.br-review-form-wrap {
	max-width: 560px;
	margin: 24px auto;
	padding: 24px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.br-rf-back {
	align-self: flex-start;
	background: none;
	border: 0;
	color: #6b7280;
	cursor: pointer;
	font-size: 14px;
	text-decoration: none;
}
.br-rf-stepper {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #6b7280;
}
.br-rf-step { display: inline-flex; align-items: center; gap: 6px; }
.br-rf-step.is-active { color: #111827; font-weight: 600; }
.br-rf-step.is-done { color: #059669; }
.br-rf-num {
	width: 22px; height: 22px; border-radius: 50%;
	background: #f3f4f6; display: inline-flex; align-items: center; justify-content: center;
	font-size: 12px;
}
.br-rf-step.is-active .br-rf-num { background: #111827; color: #fff; }
.br-rf-product { display: flex; gap: 12px; align-items: center; }
.br-rf-product-img {
	width: 72px; height: 72px; border-radius: 12px;
	background-size: cover; background-position: center; background-color: #f3f4f6;
	flex-shrink: 0;
}
.br-rf-product-name { font-weight: 700; font-size: 16px; }
.br-rf-product-price { color: #6b7280; font-size: 14px; }
.br-rf-title { margin: 8px 0 0; font-size: 26px; text-align: center; }
.br-rf-subtitle { margin: 0; color: #6b7280; font-size: 14px; text-align: center; }
.br-rf-stars { display: flex; gap: 6px; font-size: 36px; justify-content: center; }
.br-rf-stars button {
	background: none; border: 0; cursor: pointer; line-height: 1; padding: 0;
	font-family: inherit; font-size: 36px;
	color: transparent;
	-webkit-text-stroke: 1.5px #f59e0b;
}
.br-rf-stars button.is-on,
.br-rf-stars button.is-hover {
	color: #f59e0b;
	-webkit-text-stroke: 0;
}
.br-rf-fields { display: flex; flex-direction: column; gap: 10px; }
.br-rf-title-input, .br-rf-content {
	width: 100%; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px;
	font: inherit;
}
.br-rf-content { min-height: 120px; resize: vertical; }
.br-rf-photos-label { display: flex; justify-content: space-between; font-size: 13px; color: #6b7280; }
.br-rf-photos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; position: relative; }
.br-rf-photos-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}
.br-rf-photo-slot, .br-rf-photo-preview {
	width: 88px; height: 88px; border-radius: 12px; border: 1px dashed #d1d5db;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: 4px; background: #f9fafb; color: #6b7280; cursor: pointer; font-size: 12px;
	position: relative; overflow: hidden;
}
.br-rf-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.br-rf-photo-remove {
	position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0;
	border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; cursor: pointer;
}
.br-rf-submit {
	width: 100%; padding: 12px 16px; border: 0; border-radius: 10px;
	background: #111827; color: #fff; font-weight: 600; cursor: pointer; font-size: 15px;
}
.br-rf-submit:hover { background: #374151; }

.br-thanks-overlay {
	position: relative; max-width: 480px; margin: 32px auto;
}
.br-thanks-card {
	background: #fff; border-radius: 18px; padding: 28px; position: relative;
	box-shadow: 0 12px 36px rgba(0,0,0,.08); overflow: hidden;
}
.br-thanks-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.br-thanks-pct {
	position: absolute; font-weight: 700; color: #f3f4f6; line-height: 1; user-select: none;
}
.br-thanks-pct-tr { top: -50px; right: -20px; font-size: 200px; }
.br-thanks-pct-bl { bottom: -40px; left: -15px; font-size: 130px; }
.br-thanks-label {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 6px 12px; background: #f9fafb; border: 1px solid #e5e7eb;
	border-radius: 999px; font-size: 12px; font-weight: 500; color: #374151;
}
.br-thanks-close {
	position: absolute; top: 12px; right: 12px; border: 0; background: #f3f4f6;
	width: 32px; height: 32px; border-radius: 50%; cursor: pointer; z-index: 2;
}
.br-thanks-headline { margin: 12px 0; font-size: 56px; letter-spacing: -.04em; }
.br-thanks-text { color: #4b5563; line-height: 1.6; }
.br-thanks-coupon-label { font-size: 13px; color: #6b7280; margin: 12px 0 6px; }
.br-thanks-coupon {
	display: flex; align-items: center; gap: 10px;
	background: #047857; color: #fff; border-radius: 10px; padding: 12px 16px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700;
}
.br-thanks-coupon code { background: none; color: inherit; font-size: 18px; }
.br-thanks-copy {
	margin-left: auto; background: rgba(255,255,255,.15); color: #fff; border: 0;
	border-radius: 8px; padding: 6px 10px; cursor: pointer;
}
.br-thanks-shop {
	display: block; margin-top: 16px; background: #111827; color: #fff;
	text-align: center; text-decoration: none; padding: 12px; border-radius: 10px; font-weight: 600;
}
.br-thanks-foot { text-align: center; margin-top: 12px; }
.br-thanks-link { color: #111827; }
