/* =========================================================
   WC Reviews & Q&A Pro — Frontend Styles
   ========================================================= */

:root {
	--wcrqp-star-color: #f5a623;
	--wcrqp-accent-color: #f5a623;
	--wcrqp-text: #1f2328;
	--wcrqp-text-muted: #6b7280;
	--wcrqp-border: #e5e7eb;
	--wcrqp-bg-card: #ffffff;
	--wcrqp-bg-soft: #f9fafb;
	--wcrqp-verified: #1a9e5c;
	--wcrqp-radius: 12px;
	--wcrqp-radius-sm: 8px;
	--wcrqp-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
	--wcrqp-shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
}

.wcrqp-reviews-tab, .wcrqp-homepage-widget, .wcrqp-qa-section {
	color: var(--wcrqp-text);
	font-size: 15px;
	line-height: 1.55;
}

.wcrqp-reviews-tab *, .wcrqp-homepage-widget *, .wcrqp-qa-section * { box-sizing: border-box; }

/* ---------- Buttons ---------- */
.wcrqp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background: var(--wcrqp-accent-color);
	color: #fff;
	border: none;
	border-radius: var(--wcrqp-radius-sm);
	padding: 11px 22px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.wcrqp-btn:hover { opacity: .92; box-shadow: var(--wcrqp-shadow-md); }
.wcrqp-btn:active { transform: translateY(1px); }
.wcrqp-btn-small { padding: 7px 14px; font-size: 13px; }
.wcrqp-btn.wcrqp-btn-outline {
	background: transparent;
	color: var(--wcrqp-accent-color);
	border: 1px solid var(--wcrqp-accent-color);
}

/* ---------- Star rating (display) ---------- */
.wcrqp-star-rating { display: inline-flex; align-items: center; gap: 2px; color: var(--wcrqp-star-color); }
.wcrqp-star { width: 16px; height: 16px; fill: currentColor; }
.wcrqp-star-empty { fill: none; stroke: currentColor; stroke-width: 1.2; opacity: .45; }
.wcrqp-star-glyph { color: var(--wcrqp-star-color); }

/* ---------- Review count next to WooCommerce's native star rating
   (shop loop / category grid / homepage product blocks) ---------- */
.star-rating { display: inline-flex !important; align-items: center; vertical-align: middle; }
.wcrqp-loop-review-count {
	display: inline-block;
	margin-left: 6px;
	font-size: 12.5px;
	font-weight: 500;
	color: var(--wcrqp-text-muted);
	white-space: nowrap;
	vertical-align: middle;
}

/* ---------- Rating summary block ---------- */
.wcrqp-summary {
	display: grid;
	grid-template-columns: 200px 1fr 180px;
	gap: 32px;
	align-items: center;
	padding: 28px;
	background: var(--wcrqp-bg-soft);
	border: 1px solid var(--wcrqp-border);
	border-radius: var(--wcrqp-radius);
	margin-bottom: 28px;
}
.wcrqp-summary-score { text-align: center; }
.wcrqp-avg-number { font-size: 42px; font-weight: 800; line-height: 1; color: var(--wcrqp-text); }
.wcrqp-summary-score .wcrqp-star-rating { justify-content: center; margin: 8px 0 6px; }
.wcrqp-summary-score .wcrqp-star { width: 18px; height: 18px; }
.wcrqp-total-count { font-size: 13px; color: var(--wcrqp-text-muted); }

.wcrqp-summary-bars { display: flex; flex-direction: column; gap: 6px; }
.wcrqp-bar-row { display: grid; grid-template-columns: 42px 1fr 32px; align-items: center; gap: 10px; font-size: 13px; color: var(--wcrqp-text-muted); }
.wcrqp-bar-track { position: relative; height: 8px; background: #e9ebee; border-radius: 6px; overflow: hidden; }
.wcrqp-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--wcrqp-star-color); border-radius: 6px; transition: width .4s ease; }
.wcrqp-bar-count { text-align: right; }
.wcrqp-no-reviews-msg { color: var(--wcrqp-text-muted); font-style: italic; margin: 0; }

.wcrqp-summary-cta { text-align: right; }

@media (max-width: 720px) {
	.wcrqp-summary { grid-template-columns: 1fr; text-align: center; gap: 16px; }
	.wcrqp-summary-cta { text-align: center; }
}

/* ---------- Review form ---------- */
.wcrqp-review-form-wrapper, .wcrqp-qa-form-wrapper { margin-bottom: 28px; }
.wcrqp-review-form-card {
	background: var(--wcrqp-bg-card);
	border: 1px solid var(--wcrqp-border);
	border-radius: var(--wcrqp-radius);
	padding: 24px;
	box-shadow: var(--wcrqp-shadow);
}
.wcrqp-review-form-card h3 { margin-top: 0; }

.wcrqp-field { margin: 0 0 16px; }
.wcrqp-field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.wcrqp-field .required { color: #e0245e; }
.wcrqp-field-note { font-weight: 400; color: var(--wcrqp-text-muted); font-size: 12px; margin-left: 4px; }
.wcrqp-field input[type="text"],
.wcrqp-field input[type="email"],
.wcrqp-field input[type="url"],
.wcrqp-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--wcrqp-border);
	border-radius: var(--wcrqp-radius-sm);
	font-size: 14px;
	font-family: inherit;
	background: #fff;
}
.wcrqp-field textarea { resize: vertical; }
.wcrqp-field input:focus, .wcrqp-field textarea:focus { outline: none; border-color: var(--wcrqp-accent-color); box-shadow: 0 0 0 3px rgba(245,166,35,.15); }
.wcrqp-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .wcrqp-field-row { grid-template-columns: 1fr; } }

/* Star input (form) — radio buttons rendered right-to-left, styled as clickable stars */
.wcrqp-star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.wcrqp-star-input input { position: absolute; opacity: 0; width: 0; height: 0; }
.wcrqp-star-input label {
	font-size: 30px;
	line-height: 1;
	color: #d9dce1;
	cursor: pointer;
	transition: color .1s ease;
}
.wcrqp-star-input input:checked ~ label,
.wcrqp-star-input label:hover,
.wcrqp-star-input label:hover ~ label { color: var(--wcrqp-star-color); }

.wcrqp-media-preview { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.wcrqp-media-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--wcrqp-border); }

.wcrqp-submit-row { margin-bottom: 0; }
.wcrqp-form-message { font-size: 13px; padding: 8px 12px; border-radius: 6px; margin-top: 10px; }
.wcrqp-form-message.wcrqp-success { background: #e7f8ef; color: var(--wcrqp-verified); }
.wcrqp-form-message.wcrqp-error { background: #fdeaea; color: #c0392b; }

/* ---------- Review list ---------- */
.wcrqp-review-list { list-style: none; margin: 0; padding: 0; }
.wcrqp-review-item {
	background: var(--wcrqp-bg-card);
	border: 1px solid var(--wcrqp-border);
	border-radius: var(--wcrqp-radius);
	padding: 20px 22px;
	margin-bottom: 16px;
}
.wcrqp-review-header { display: flex; gap: 12px; align-items: flex-start; }
.wcrqp-review-header.wcrqp-no-avatar { display: block; }
.wcrqp-avatar-img { border-radius: 50%; display: block; }
.wcrqp-review-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wcrqp-review-author { font-weight: 700; font-size: 15.5px; }
.wcrqp-review-stars-row { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.wcrqp-review-date { font-size: 12.5px; color: var(--wcrqp-text-muted); }

.wcrqp-verified-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #e7f8ef;
	color: var(--wcrqp-verified);
	font-size: 11.5px;
	font-weight: 700;
	padding: 3px 9px;
	border-radius: 20px;
	text-transform: uppercase;
	letter-spacing: .02em;
}
.wcrqp-check-icon { width: 11px; height: 11px; fill: currentColor; }

.wcrqp-review-body { margin-top: 10px; padding-left: 0; }
.wcrqp-review-body p { margin: 0 0 10px; color: var(--wcrqp-text); }

.wcrqp-review-media { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.wcrqp-media-thumb {
	width: 76px; height: 76px; border-radius: 8px; overflow: hidden; display: block;
	border: 1px solid var(--wcrqp-border); position: relative;
}
.wcrqp-media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wcrqp-video-thumb { background: #111; display: flex; align-items: center; justify-content: center; }
.wcrqp-play-icon { color: #fff; font-size: 20px; }

/* ---------- Lightbox ---------- */
.wcrqp-lightbox-overlay {
	position: fixed; inset: 0; background: rgba(10,10,12,.9);
	display: flex; align-items: center; justify-content: center;
	z-index: 100000; padding: 24px;
}
.wcrqp-lightbox-content { max-width: 90vw; max-height: 88vh; }
.wcrqp-lightbox-content img, .wcrqp-lightbox-content video, .wcrqp-lightbox-content iframe {
	max-width: 90vw; max-height: 88vh; border-radius: 8px; display: block;
}
.wcrqp-lightbox-close {
	position: absolute; top: 20px; right: 28px; color: #fff; font-size: 32px;
	background: none; border: none; cursor: pointer; line-height: 1;
}

/* ---------- Pagination ---------- */
.wcrqp-pagination { text-align: center; margin: 20px 0; }
.wcrqp-pagination ul { list-style: none; display: inline-flex; gap: 6px; padding: 0; margin: 0; }
.wcrqp-pagination a, .wcrqp-pagination span {
	display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--wcrqp-border);
	color: var(--wcrqp-text); text-decoration: none; font-size: 13px;
}
.wcrqp-pagination .current { background: var(--wcrqp-accent-color); border-color: var(--wcrqp-accent-color); color: #fff; }

/* =========================================================
   Q&A section
   ========================================================= */
.wcrqp-qa-section { margin-top: 40px; border-top: 1px solid var(--wcrqp-border); padding-top: 32px; }
.wcrqp-qa-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.wcrqp-qa-header h3 { margin: 0; }
.wcrqp-qa-count { color: var(--wcrqp-text-muted); font-weight: 400; }

.wcrqp-qa-item { border: 1px solid var(--wcrqp-border); border-radius: var(--wcrqp-radius); padding: 18px 20px; margin-bottom: 14px; background: var(--wcrqp-bg-card); }
.wcrqp-qa-question, .wcrqp-qa-answer { display: flex; gap: 12px; align-items: flex-start; }
.wcrqp-qa-answers { margin-top: 12px; padding-left: 30px; border-left: 2px solid var(--wcrqp-border); margin-left: 15px; display: flex; flex-direction: column; gap: 12px; }
.wcrqp-qa-icon {
	flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-weight: 700; font-size: 12px; color: #fff;
}
.wcrqp-qa-icon-q { background: var(--wcrqp-text); }
.wcrqp-qa-icon-a { background: var(--wcrqp-accent-color); }
.wcrqp-qa-question-text, .wcrqp-qa-answer-text { margin: 0 0 4px; font-weight: 500; }
.wcrqp-qa-question-meta { margin: 0; font-size: 12.5px; color: var(--wcrqp-text-muted); }
.wcrqp-store-badge { background: var(--wcrqp-accent-color); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; margin-left: 4px; }
.wcrqp-store-reply { background: #fff8ef; border-radius: 8px; padding: 8px; margin: -8px; }

.wcrqp-answer-toggle-btn {
	background: none; border: none; color: var(--wcrqp-accent-color); font-weight: 600;
	font-size: 13px; cursor: pointer; padding: 10px 0 0; margin-left: 38px;
}
.wcrqp-answer-form { margin-top: 10px; margin-left: 38px; display: flex; flex-direction: column; gap: 8px; max-width: 480px; }
.wcrqp-answer-form textarea, .wcrqp-answer-form input[type="text"] {
	padding: 9px 11px; border: 1px solid var(--wcrqp-border); border-radius: 6px; font-family: inherit; font-size: 13.5px;
}
.wcrqp-no-questions-msg { color: var(--wcrqp-text-muted); font-style: italic; }
.wcrqp-load-more-wrapper { text-align: center; margin-top: 16px; }

/* =========================================================
   Homepage / shortcode widget
   ========================================================= */
.wcrqp-homepage-widget { padding: 20px 0; max-width: 100%; overflow: hidden; box-sizing: border-box; }
.wcrqp-widget-title { text-align: center; font-size: 28px; margin: 0 0 28px; }

.wcrqp-layout-grid .wcrqp-widget-track {
	display: grid !important;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
	gap: 20px !important;
}
.wcrqp-layout-list .wcrqp-widget-track { display: flex !important; flex-direction: column !important; gap: 14px !important; }

.wcrqp-layout-carousel { position: relative; }
.wcrqp-layout-carousel .wcrqp-widget-track {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	gap: 20px !important;
	overflow-x: auto !important;
	overflow-y: hidden !important;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	padding-bottom: 10px;
	-webkit-overflow-scrolling: touch;
}
.wcrqp-layout-carousel .wcrqp-widget-track::-webkit-scrollbar { height: 6px; }
.wcrqp-layout-carousel .wcrqp-widget-track::-webkit-scrollbar-thumb { background: var(--wcrqp-border); border-radius: 6px; }
.wcrqp-layout-carousel .wcrqp-widget-card {
	flex: 0 0 280px !important;
	max-width: 280px !important;
	width: 280px !important;
	scroll-snap-align: start;
}

/* Mobile: some themes force flex-wrap / flex-direction / block display on
   small screens with their own !important rules, which can flip this
   carousel back to a vertical stack. Re-assert the horizontal layout at
   common mobile breakpoints with higher-specificity selectors so it wins
   regardless of theme CSS load order. */
@media (max-width: 900px) {
	html body .wcrqp-homepage-widget.wcrqp-layout-carousel .wcrqp-widget-track,
	html body .wcrqp-layout-carousel .wcrqp-widget-track {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		overflow-x: auto !important;
		width: 100% !important;
	}
	html body .wcrqp-layout-carousel .wcrqp-widget-card {
		display: flex !important;
		flex: 0 0 240px !important;
		width: 240px !important;
		max-width: 240px !important;
		min-width: 240px !important;
	}
	html body .wcrqp-layout-carousel .wcrqp-widget-media {
		height: 180px !important;
	}
}
.wcrqp-widget-nav { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.wcrqp-widget-nav button {
	width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--wcrqp-border);
	background: #fff; cursor: pointer; font-size: 16px;
}
.wcrqp-widget-nav button:hover { background: var(--wcrqp-bg-soft); }

.wcrqp-widget-card {
	background: var(--wcrqp-bg-card);
	border: 1px solid var(--wcrqp-border);
	border-radius: var(--wcrqp-radius);
	padding: 20px;
	box-shadow: var(--wcrqp-shadow);
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 320px !important;
	width: 100% !important;
	box-sizing: border-box;
}
.wcrqp-widget-card-header { display: flex; align-items: center; gap: 10px; }
.wcrqp-widget-card-header.wcrqp-no-avatar { display: block; }
.wcrqp-widget-author { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.wcrqp-widget-card-header .wcrqp-star { width: 14px; height: 14px; }
.wcrqp-widget-media {
	width: 100% !important;
	height: 220px !important;
	max-width: 100% !important;
	overflow: hidden;
	border-radius: 8px;
	background: var(--wcrqp-bg-soft);
}
.wcrqp-widget-media img {
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	object-fit: cover !important;
	display: block;
	border-radius: 8px;
	margin: 0 !important;
}
.wcrqp-widget-text { font-size: 14px; color: var(--wcrqp-text); margin: 0; flex-grow: 1; }
.wcrqp-widget-product-link {
	display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--wcrqp-text);
	border-top: 1px solid var(--wcrqp-border); padding-top: 10px; font-size: 13px; font-weight: 600;
}
.wcrqp-widget-product-link img { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; }
.wcrqp-widget-verified { align-self: flex-start; }

@media (max-width: 480px) {
	.wcrqp-widget-title { font-size: 22px; }
}
