/**
 * Reggal Reviews — Frontend styles.
 */

/* ==========================================================================
   Base — inherit body font size everywhere
   ========================================================================== */

.rr-reviews-section,
.rr-reviews-section * {
	font-size: inherit;
}

/* ==========================================================================
   Full width — force Bricks & parent containers to 100%
   ========================================================================== */

.brxe-product-reviews,
.brxe-product-reviews > div,
.rr-reviews-section {
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
}

/* ==========================================================================
   Overview container
   ========================================================================== */

.rr-reviews-overview {
	width: 100%;
	max-width: 100%;
	padding: 0 0 1.5rem;
	margin-bottom: 2rem;
	box-sizing: border-box;
}

/* ---------- Content grid ---------- */

.rr-reviews-overview__content {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0;
	align-items: start;
}

/* ---------- Rating block (left) ---------- */

.rr-reviews-overview__rating-block {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding-right: 2.5rem;
}

.rr-reviews-overview__score-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.15rem;
}

.rr-reviews-overview__score {
	font-size: 3rem;
	font-weight: 700;
	line-height: 1;
}

/* ---------- Inline SVG stars ---------- */

.rr-reviews-overview__stars-inline {
	display: flex;
	gap: 2px;
	align-items: center;
}

.rr-star-icon {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: #f5a623;
	stroke-width: 2;
}

.rr-star-icon--filled {
	fill: #f5a623;
}

.rr-reviews-overview__count {
	color: #666;
	margin-bottom: 0;
}

.rr-reviews-overview__write-btn {
	display: inline-block;
	border: 2px solid #333;
	background: transparent;
	padding: 0.6rem 1.5rem;
	font-weight: 600;
	cursor: pointer;
	margin-top: 1rem;
	text-decoration: none;
	color: #333;
	line-height: 1.4;
	font-family: inherit;
	transition: background 0.2s, color 0.2s;
}

.rr-reviews-overview__write-btn:hover,
.rr-reviews-overview__write-btn:focus {
	background: #333;
	color: #fff;
	text-decoration: none;
}

/* ---------- Rating bars (right) ---------- */

.rr-reviews-overview__bars {
	display: flex;
	flex-direction: column;
	justify-content: center;
	border-left: 1px solid #e0e0e0;
	padding-left: 2.5rem;
}

.rr-rating-bar {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.5rem;
}

.rr-rating-bar:last-child {
	margin-bottom: 0;
}

.rr-rating-bar__label {
	font-weight: 700;
	min-width: 2.5rem;
	text-align: right;
}

.rr-rating-bar__track {
	flex: 1;
	height: 12px;
	background: #e0e0e0;
	border-radius: 0;
	overflow: hidden;
}

.rr-rating-bar__fill {
	height: 100%;
	background: #f5a623;
	border-radius: 0;
	transition: width 0.3s ease;
}

.rr-rating-bar__count {
	min-width: 7rem;
	color: #666;
	white-space: nowrap;
}

/* ==========================================================================
   Criteria section
   ========================================================================== */

.rr-reviews-overview__criteria {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid #e0e0e0;
}

.rr-reviews-overview__criteria h3 {
	font-weight: 700;
	font-size: 1.15em;
	margin: 0 0 0.3rem;
	line-height: 1.4;
}

.rr-reviews-overview__criteria p {
	color: #666;
	margin: 0 0 1rem;
}

.rr-criteria-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.rr-criteria-tag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	flex: 1 1 0;
	padding: 0.85rem 1.75rem;
	border: 1px solid #e0e0e0;
	border-radius: 0;
	background: #fff;
	cursor: pointer;
	font-weight: 500;
	font-family: inherit;
	color: #333;
	line-height: 1.4;
	transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.rr-criteria-tag:hover {
	border-color: #333;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.rr-criteria-tag.active {
	border-color: #4caf50;
	background: #f0faf0;
}

.rr-criteria-tag__icon {
	width: 22px;
	height: 22px;
	color: #4caf50;
	flex-shrink: 0;
}

/* ==========================================================================
   Reviews list
   ========================================================================== */

.rr-reviews-list {
	list-style: none;
	padding: 0;
	margin: 0;
	width: 100%;
}

/* ==========================================================================
   Individual review styling
   ========================================================================== */

.rr-review-item {
	display: grid;
	grid-template-columns: 52px 1fr;
	gap: 0 1rem;
	align-items: start;
	padding: 1.5rem 0;
	border-bottom: 1px solid #eee;
}

.rr-review-item:last-child {
	border-bottom: none;
}

/* Avatar */
.rr-review-item__avatar {
	grid-row: 1 / -1;
	grid-column: 1;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: 700;
	font-size: 1.1rem;
	letter-spacing: 0.5px;
	flex-shrink: 0;
}

/* Content area */
.rr-review-item__content {
	grid-row: 1 / -1;
	grid-column: 2;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0;
}

/* Header: meta + rating */
.rr-review-item__header {
	grid-column: 1 / -1;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.rr-review-item__meta {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
}

.rr-review-item__author {
	font-weight: 700;
	color: #222;
}

.rr-review-item__dash {
	color: #bbb;
}

.rr-review-item__date {
	color: #888;
}

/* Rating — "5.0 ★" */
.rr-review-rating {
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

.rr-review-rating__value {
	font-weight: 700;
	color: #333;
}

.rr-review-rating__star {
	width: 24px;
	height: 24px;
	fill: #f5a623;
	stroke: none;
}

/* Review text */
.rr-review-item__text {
	grid-column: 1 / -1;
	margin: 0.4rem 0 0;
}

.rr-review-item__text p {
	margin: 0;
	line-height: 1.65;
	color: #333;
}

/* ==========================================================================
   Review criteria tags (below each review)
   ========================================================================== */

.rr-review-criteria {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.rr-review-criteria .rr-review-tag {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.25rem 0.65rem;
	background: #f5f5f5;
	border-radius: 0;
	font-size: 0.8em;
	color: #666;
	line-height: 1.4;
}

/* ==========================================================================
   Load more button
   ========================================================================== */

.rr-load-more-wrap {
	text-align: center;
	padding: 1.5rem 0;
}

.rr-load-more {
	display: inline-block;
	padding: 0.7rem 2rem;
	border: 2px solid #333;
	background: transparent;
	color: #333;
	font-weight: 600;
	font-family: inherit;
	font-size: inherit;
	cursor: pointer;
	border-radius: 0;
	transition: background 0.2s, color 0.2s;
}

.rr-load-more:hover {
	background: #333;
	color: #fff;
}

.rr-load-more:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ==========================================================================
   Loading state
   ========================================================================== */

.rr-loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
	.rr-reviews-overview__content {
		grid-template-columns: 1fr;
	}

	.rr-reviews-overview__rating-block {
		padding-right: 0;
		padding-bottom: 1.5rem;
	}

	.rr-reviews-overview__bars {
		border-left: none;
		padding-left: 0;
		border-top: 1px solid #e0e0e0;
		padding-top: 1.5rem;
	}

	.rr-criteria-tags {
		flex-direction: column;
	}

	.rr-criteria-tag {
		width: 100%;
		flex: auto;
	}
}

/* ==========================================================================
   Review modal
   ========================================================================== */

.rr-modal[aria-hidden="true"] {
	display: none;
}

.rr-modal[aria-hidden="false"] {
	display: flex;
}

body.rr-modal-open {
	overflow: hidden;
}

.rr-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

/* ---------- Overlay ---------- */

.rr-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

/* ---------- Container ---------- */

.rr-modal__container {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 0;
	width: 100%;
	max-width: 480px;
	padding: 2rem;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
	animation: rr-modal-in 0.2s ease-out;
}

@keyframes rr-modal-in {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* ---------- Close button ---------- */

.rr-modal__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 32px;
	height: 32px;
	border: none;
	background: none;
	font-size: 1.5rem;
	line-height: 1;
	color: #999;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background 0.15s, color 0.15s;
	padding: 0;
}

.rr-modal__close:hover {
	background: #f5f5f5;
	color: #333;
}

/* ---------- Title ---------- */

.rr-modal__title {
	font-size: 1.25em;
	font-weight: 700;
	margin: 0 0 1.5rem;
	padding-right: 2rem;
}

/* ---------- Form fields ---------- */

.rr-modal__field {
	margin-bottom: 1rem;
}

.rr-modal__field label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35rem;
	color: #333;
}

.rr-modal__field label .required {
	color: #e53e3e;
}

.rr-modal__field input[type="text"],
.rr-modal__field input[type="email"],
.rr-modal__field textarea {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid #d0d0d0;
	border-radius: 0;
	font-family: inherit;
	font-size: inherit;
	transition: border-color 0.15s;
	background: #fff;
	box-sizing: border-box;
}

.rr-modal__field input:focus,
.rr-modal__field textarea:focus {
	outline: none;
	border-color: #333;
}

.rr-modal__field textarea {
	resize: vertical;
	min-height: 80px;
}

/* ---------- Star rating ---------- */

.rr-modal__stars-field {
	margin-bottom: 1.25rem;
}

.rr-modal__stars {
	display: flex;
	gap: 0.25rem;
	margin-top: 0.25rem;
}

.rr-modal__star {
	width: 32px;
	height: 32px;
	cursor: pointer;
	color: #d0d0d0;
	transition: color 0.1s, transform 0.1s;
	fill: none;
}

.rr-modal__star:hover {
	transform: scale(1.1);
}

.rr-modal__star.active {
	color: #f5a623;
	fill: #f5a623;
}

/* ---------- Actions ---------- */

.rr-modal__actions {
	margin-top: 1.5rem;
}

.rr-modal__submit {
	width: 100%;
	padding: 0.75rem 1.5rem;
	background: #333;
	color: #fff;
	border: none;
	border-radius: 0;
	font-weight: 600;
	font-family: inherit;
	font-size: inherit;
	cursor: pointer;
	transition: background 0.15s;
}

.rr-modal__submit:hover {
	background: #1a1a1a;
}

.rr-modal__submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ---------- Messages ---------- */

.rr-modal__message {
	min-height: 0;
	margin-top: 0.75rem;
	text-align: center;
	border-radius: 0;
	padding: 0;
	transition: all 0.2s;
}

.rr-modal__message:empty {
	display: none;
}

.rr-modal__message--success {
	display: block;
	padding: 0.6rem 0.75rem;
	background: #f0faf0;
	color: #2e7d32;
}

.rr-modal__message--error {
	display: block;
	padding: 0.6rem 0.75rem;
	background: #fef2f2;
	color: #c62828;
}

/* ---------- Countdown progress bar ---------- */

.rr-modal__progress {
	width: 100%;
	height: 4px;
	background: rgba(0, 0, 0, 0.08);
	border-radius: 0;
	margin-top: 0.6rem;
	overflow: hidden;
}

.rr-modal__countdown {
	display: block;
	margin-top: 0.3rem;
	font-size: 0.85em;
	opacity: 0.8;
}

.rr-modal__progress-bar {
	width: 0;
	height: 100%;
	background: #4caf50;
	border-radius: 0;
	transition: none;
}

.rr-modal__progress-bar--active {
	width: 100%;
	transition: width 5s linear;
}

/* ---------- Modal responsive ---------- */

@media (max-width: 520px) {
	.rr-modal__container {
		padding: 1.5rem;
		border-radius: 0;
		max-width: 100%;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		animation: rr-modal-slide-up 0.25s ease-out;
	}

	@keyframes rr-modal-slide-up {
		from {
			transform: translateY(100%);
		}
		to {
			transform: translateY(0);
		}
	}

	.rr-modal {
		align-items: flex-end;
		padding: 0;
	}
}

/* ==================================================================
 * Photo thumbnails in review items
 * ================================================================*/

.rr-review-photos {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.rr-review-photo-thumb {
	display: block;
	width: 80px;
	height: 80px;
	overflow: hidden;
	border-radius: 6px;
	border: 1px solid #e0e0e0;
	cursor: pointer;
	transition: border-color 0.15s, transform 0.15s;
}

.rr-review-photo-thumb:hover {
	border-color: #333;
	transform: scale( 1.05 );
}

.rr-review-photo-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Compact variant for carousel */
.rr-review-photos--compact {
	margin-top: 0.5rem;
}

.rr-review-photos--compact .rr-review-photo-thumb {
	width: 48px;
	height: 48px;
	border-radius: 4px;
}

/* ==================================================================
 * Photo upload area in modal
 * ================================================================*/

.rr-modal__photos-hint {
	font-weight: 400;
	color: #888;
	font-size: 0.85em;
}

.rr-modal__photos-dropzone {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.35rem;
}

.rr-modal__photos-previews {
	display: contents;
}

.rr-modal__photo-preview {
	position: relative;
	width: 72px;
	height: 72px;
	border-radius: 6px;
	border: 1px solid #d0d0d0;
	overflow: hidden;
}

.rr-modal__photo-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rr-modal__photo-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 20px;
	height: 20px;
	background: rgba( 0, 0, 0, 0.6 );
	color: #fff;
	border: none;
	border-radius: 50%;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.rr-modal__photo-remove:hover {
	background: rgba( 0, 0, 0, 0.85 );
}

.rr-modal__photos-add {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 6px;
	border: 1px dashed #d0d0d0;
	cursor: pointer;
	color: #999;
	font-size: 0.75em;
	gap: 0.2rem;
	transition: border-color 0.15s, color 0.15s;
}

.rr-modal__photos-add:hover {
	border-color: #333;
	color: #333;
}

.rr-modal__photos-add svg {
	width: 20px;
	height: 20px;
}

.rr-modal__photos-input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

/* ==================================================================
 * Lightbox
 * ================================================================*/

.rr-lightbox[aria-hidden="true"] {
	display: none;
}

.rr-lightbox[aria-hidden="false"] {
	display: flex;
}

.rr-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999999;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.rr-lightbox__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.85 );
}

.rr-lightbox__content {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 90vw;
	max-height: 90vh;
}

.rr-lightbox__image {
	max-width: 90vw;
	max-height: 85vh;
	object-fit: contain;
	display: block;
	border-radius: 4px;
}

.rr-lightbox__close {
	position: fixed;
	top: 1rem;
	right: 1rem;
	width: 40px;
	height: 40px;
	background: rgba( 255, 255, 255, 0.15 );
	border: none;
	color: #fff;
	font-size: 1.75rem;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	transition: background 0.15s;
}

.rr-lightbox__close:hover {
	background: rgba( 255, 255, 255, 0.3 );
}

.rr-lightbox__prev,
.rr-lightbox__next {
	position: fixed;
	top: 50%;
	transform: translateY( -50% );
	width: 40px;
	height: 40px;
	background: rgba( 255, 255, 255, 0.15 );
	border: none;
	color: #fff;
	font-size: 2rem;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	transition: background 0.15s;
}

.rr-lightbox__prev:hover,
.rr-lightbox__next:hover {
	background: rgba( 255, 255, 255, 0.3 );
}

.rr-lightbox__prev {
	left: 1rem;
}

.rr-lightbox__next {
	right: 1rem;
}

.rr-lightbox__counter {
	position: fixed;
	bottom: 1rem;
	left: 50%;
	transform: translateX( -50% );
	color: #fff;
	font-size: 0.9em;
	z-index: 2;
}

body.rr-lightbox-open {
	overflow: hidden;
}
