/*
 * Elementor Shop Reviews Page — mirrors the xsmokehub Reviews page
 * (Reviews.tsx): a rating summary card (average, star row, count, clickable
 * distribution bars that filter the grid) next to a "Share Your Experience"
 * CTA (heading + "Write a Review" button), a grid of real WooCommerce reviews
 * (verified badge, photo thumbnails, author initials, product, date), a
 * review-submission modal and an image lightbox.
 * The Elementor controls override these defaults via generated CSS.
 */

/* ---- Wrapper ---- */
.esrp-wrap {
	width: 100%;
}

/* ---- Summary + CTA row ---- */
.esrp-summary-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	column-gap: 40px;
	row-gap: 24px;
	margin-bottom: 56px;
}

.esrp-summary-row.esrp-no-summary {
	grid-template-columns: minmax(0, 1fr);
	margin-bottom: 40px;
}

/* ---- Rating summary card (Reviews.tsx "Summary") ---- */
.esrp-summary {
	box-sizing: border-box;
	padding: 32px;
	background-color: #f5f5f5;
	border-radius: 16px;
}

.esrp-summary-head {
	text-align: center;
	margin-bottom: 24px;
}

.esrp-summary-avg {
	margin: 0 0 4px;
	font-family: 'Jost', sans-serif;
	font-size: 60px;
	font-weight: 600;
	line-height: 1;
	color: #222222;
}

.esrp-summary-count {
	margin: 8px 0 0;
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.4;
	color: #888888;
}

.esrp-summary-dist {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.esrp-dist-row {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.esrp-dist-label {
	width: 16px;
	text-align: right;
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	font-weight: 400;
	line-height: 1;
	color: #888888;
	flex-shrink: 0;
}

.esrp-dist-star {
	flex-shrink: 0;
}

.esrp-dist-bar {
	flex: 1;
	height: 6px;
	border-radius: 999px;
	background-color: #e5e5e5;
	overflow: hidden;
}

.esrp-dist-fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background-color: #222222;
}

.esrp-dist-pct {
	width: 32px;
	text-align: right;
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	font-weight: 400;
	line-height: 1;
	color: #888888;
	flex-shrink: 0;
}

/* ---- CTA ("Share Your Experience") ---- */
.esrp-cta {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
}

.esrp-cta-title {
	margin: 0 0 12px;
	font-family: 'DM Serif Display', serif;
	font-size: 30px;
	font-weight: 400;
	line-height: 1.2;
	color: #222222;
}

.esrp-cta-desc {
	margin: 0 0 24px;
	max-width: 448px;
	font-family: 'Jost', sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.625;
	color: #666666;
}

.esrp-write-btn {
	display: inline-block;
	padding: 14px 28px;
	border: 0;
	border-radius: 12px;
	background-color: #222222;
	color: #ffffff;
	font-family: 'Jost', sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.esrp-write-btn:hover {
	background-color: #000000;
}

/* ---- Filter indicator ---- */
.esrp-filter-indicator {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 24px;
}

.esrp-filter-info {
	font-family: 'Jost', sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 1;
	color: #888888;
}

.esrp-filter-clear {
	padding: 0;
	border: 0;
	background: transparent;
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	font-weight: 500;
	line-height: 1;
	color: #222222;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

/* ---- Reviews grid ---- */
.esrp-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr)); /* fallback; Elementor overrides */
	column-gap: 24px;
	row-gap: 24px;
}

/* ---- Review card ---- */
.esrp-review-card {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 24px;
	background-color: #f5f5f5;
	border-radius: 16px;
}

.esrp-card-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

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

.esrp-verified {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #4caf50;
	font-family: 'Jost', sans-serif;
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}

.esrp-verified svg {
	flex-shrink: 0;
}

.esrp-review-text {
	margin: 0;
	flex: 1;
	font-family: 'Jost', sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.625;
	color: #444444;
}

/* Photo thumbnails */
.esrp-card-images {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
}

.esrp-thumb {
	aspect-ratio: 1 / 1;
	padding: 0;
	border: 0;
	border-radius: 8px;
	overflow: hidden;
	background-color: #ededed;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.esrp-thumb:hover {
	opacity: 0.9;
}

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

/* Card footer */
.esrp-card-footer {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 8px;
	border-top: 1px solid #e5e5e5;
}

.esrp-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	background-color: #222222;
	flex-shrink: 0;
}

.esrp-avatar span {
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	color: #ffffff;
}

.esrp-card-meta {
	flex: 1;
	min-width: 0;
}

.esrp-review-name {
	margin: 0 0 2px;
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	color: #222222;
}

.esrp-review-product {
	margin: 0;
	font-family: 'Jost', sans-serif;
	font-size: 10px;
	font-weight: 400;
	line-height: 1.4;
	color: #888888;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.esrp-review-date {
	font-family: 'Jost', sans-serif;
	font-size: 10px;
	font-weight: 400;
	line-height: 1;
	color: #bbbbbb;
	flex-shrink: 0;
}

/* Empty state */
.esrp-empty {
	text-align: center;
	padding: 64px 0;
}

.esrp-empty-emoji {
	margin: 0 0 12px;
	font-size: 36px;
	line-height: 1;
}

.esrp-empty-text {
	margin: 0;
	font-family: 'Jost', sans-serif;
	font-size: 14px;
	color: #888888;
}

/* ---- Write a Review modal ---- */
.esrp-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99990;
	align-items: center;
	justify-content: center;
	padding: 16px;
	overflow-y: auto;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.esrp-modal.is-open {
	display: flex;
}

.esrp-modal-box {
	width: 100%;
	max-width: 512px;
	max-height: 90vh;
	overflow-y: auto;
	margin: 32px 0;
	padding: 32px;
	background-color: #ffffff;
	border-radius: 16px;
	box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.esrp-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 24px;
}

.esrp-modal-title {
	margin: 0;
	font-family: 'DM Serif Display', serif;
	font-size: 24px;
	font-weight: 400;
	line-height: 1.2;
	color: #222222;
}

.esrp-modal-close {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: #888888;
	cursor: pointer;
	transition: color 0.2s ease;
}

.esrp-modal-close:hover {
	color: #222222;
}

/* Form */
.esrp-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.esrp-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media (max-width: 480px) {
	.esrp-field-row {
		grid-template-columns: 1fr;
	}
}

.esrp-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.esrp-field label {
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	font-weight: 500;
	color: #888888;
}

.esrp-field input[type="text"],
.esrp-field textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 12px 16px;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	background-color: #ffffff;
	font-family: 'Jost', sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	color: #222222;
	transition: border-color 0.2s ease;
}

.esrp-field textarea {
	resize: none;
}

.esrp-field input:focus,
.esrp-field textarea:focus {
	outline: none;
	border-color: #222222;
}

.esrp-rating-row {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 22px;
}

.esrp-form-stars {
	display: inline-flex;
	gap: 4px;
}

.esrp-form-stars button {
	display: flex;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	transition: transform 0.15s ease;
}

.esrp-form-stars button:hover {
	transform: scale(1.1);
}

.esrp-rating-label {
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	color: #888888;
}

/* Upload area */
.esrp-upload-opt {
	color: #bbbbbb;
}

.esrp-upload-btn {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	max-width: 100%;
	padding: 24px 16px;
	border: 2px dashed #e5e5e5;
	border-radius: 12px;
	background: transparent;
	text-align: center;
	overflow: hidden;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.esrp-upload-btn:hover {
	border-color: #222222;
}

.esrp-upload-btn svg {
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	color: #bbbbbb;
	transition: color 0.2s ease;
}

.esrp-upload-btn:hover svg {
	color: #888888;
}

.esrp-upload-title {
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	font-weight: 500;
	color: #888888;
}

.esrp-upload-hint {
	font-family: 'Jost', sans-serif;
	font-size: 10px;
	color: #bbbbbb;
}

.esrp-uploaded {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.esrp-upload-thumb {
	position: relative;
	width: 64px;
	height: 64px;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid #e5e5e5;
}

.esrp-upload-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.esrp-upload-remove {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: rgba(0, 0, 0, 0.5);
	color: #ffffff;
	opacity: 0;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.esrp-upload-thumb:hover .esrp-upload-remove {
	opacity: 1;
}

.esrp-form-error {
	margin: 0;
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	color: #d32f2f;
}

.esrp-form-actions {
	display: flex;
	gap: 12px;
}

.esrp-modal-cancel,
.esrp-submit {
	flex: 1;
	padding: 12px 16px;
	border-radius: 12px;
	font-family: 'Jost', sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.esrp-modal-cancel {
	border: 1px solid #e5e5e5;
	background: transparent;
	color: #888888;
}

.esrp-modal-cancel:hover {
	border-color: #222222;
	color: #222222;
}

.esrp-submit {
	border: 0;
	background-color: #222222;
	color: #ffffff;
}

.esrp-submit:hover {
	background-color: #000000;
}

.esrp-submit:disabled {
	opacity: 0.6;
	cursor: default;
}

/* Thank-you panel */
.esrp-modal-thanks {
	text-align: center;
	padding: 32px 0;
}

.esrp-thanks-emoji {
	margin: 0 0 16px;
	font-size: 36px;
	line-height: 1;
}

.esrp-thanks-title {
	margin: 0 0 8px;
	font-family: 'DM Serif Display', serif;
	font-size: 24px;
	font-weight: 400;
	line-height: 1.2;
	color: #222222;
}

.esrp-thanks-text {
	margin: 0 0 24px;
	font-family: 'Jost', sans-serif;
	font-size: 14px;
	color: #888888;
}

.esrp-thanks-close {
	display: inline-block;
	padding: 12px 32px;
	border: 0;
	border-radius: 12px;
	background-color: #222222;
	color: #ffffff;
	font-family: 'Jost', sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.esrp-thanks-close:hover {
	background-color: #000000;
}

/* ---- Image lightbox ---- */
.esrp-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.92);
}

.esrp-lightbox.is-open {
	display: flex;
}

.esrp-lb-img {
	max-width: 100%;
	max-height: 80vh;
	object-fit: contain;
	border-radius: 16px;
	box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.esrp-lb-close,
.esrp-lb-prev,
.esrp-lb-next {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.1);
	color: #ffffff;
	cursor: pointer;
	transition: background-color 0.2s ease;
	z-index: 1;
}

.esrp-lb-close:hover,
.esrp-lb-prev:hover,
.esrp-lb-next:hover {
	background: rgba(255, 255, 255, 0.2);
}

.esrp-lb-close {
	top: 20px;
	right: 20px;
}

.esrp-lb-prev {
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
}

.esrp-lb-next {
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
}

.esrp-lb-dots {
	position: absolute;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 8px;
}

.esrp-lb-dot {
	width: 6px;
	height: 6px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.4);
	cursor: pointer;
	transition: background-color 0.2s ease, width 0.2s ease;
}

.esrp-lb-dot.is-active {
	width: 16px;
	background: #ffffff;
}

/* ---- Native (Minimog) review form upload field + review-list photos ---- */
.esrp-native-upload label {
	display: block;
	margin: 0 0 8px;
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	font-weight: 500;
	color: #888888;
}

.esrp-upload-err {
	display: none;
	margin: 8px 0 0;
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	color: #d32f2f;
}

.esrp-native-thumbs {
	margin-top: 8px;
}

/* ---- Responsive: tablet 2 columns, mobile 1 column ---- */
@media (max-width: 1024px) {
	.esrp-summary-row {
		grid-template-columns: minmax(0, 1fr);
		margin-bottom: 40px;
	}

	.esrp-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 767px) {
	.esrp-grid {
		grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
	}
}

/* ---- Product autocomplete (write-review modal) ---- */
.esrp-product-fixed {
	margin: 0;
	font-family: 'Jost', sans-serif;
	font-size: 13px;
	color: #888888;
}
.esrp-product-fixed strong {
	font-weight: 600;
	color: #222222;
}
.esrp-product-pick {
	position: relative;
}
.esrp-product-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 40;
	margin-top: 4px;
	max-height: 220px;
	overflow-y: auto;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	background: #ffffff;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}
.esrp-product-results[hidden] {
	display: none;
}
.esrp-product-result {
	display: block;
	width: 100%;
	padding: 10px 16px;
	border: 0;
	background: transparent;
	text-align: left;
	font-family: 'Jost', sans-serif;
	font-size: 13px;
	color: #222222;
	cursor: pointer;
}
.esrp-product-result + .esrp-product-result {
	border-top: 1px solid #f2f2f2;
}
.esrp-product-result:hover {
	background: #f5f5f5;
}
.esrp-product-hint {
	font-family: 'Jost', sans-serif;
	font-size: 10px;
	color: #bbbbbb;
}

/* ---- Pagination ---- */
.esrp-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
.esrp-pagination:not(:empty) {
	margin-top: 40px;
}
.esrp-page-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 12px;
	border: 1px solid #e5e5e5;
	border-radius: 999px;
	background: #ffffff;
	color: #666666;
	font-family: 'Jost', sans-serif;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.esrp-page-btn:hover {
	border-color: #222222;
	color: #222222;
}
.esrp-page-btn.is-active {
	background: #222222;
	border-color: #222222;
	color: #ffffff;
}
.esrp-page-btn:disabled {
	opacity: 0.4;
	cursor: default;
}
.esrp-page-dots {
	min-width: 20px;
	text-align: center;
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	color: #888888;
}
