/**
 * WooCommerce Product Reviews Pro — Modern UI skin
 *
 * Restyles the review list, replies, rating stars, and vote (like/dislike)
 * buttons with a cleaner, modern look. Loaded after
 * wc-product-reviews-pro-frontend.min.css so these rules take precedence;
 * it only adds/overrides presentation, it does not change any markup,
 * classes, or behaviour.
 *
 * @since 1.17.5
 */

#reviews {
	--rp-accent: #00b778;
	--rp-accent-dark: #049a64;
	--rp-danger: #e64c4c;
	--rp-text: #29323a;
	--rp-text-muted: #767f88;
	--rp-border: #e7e9ec;
	--rp-card-bg: #ffffff;
	--rp-card-shadow: 0 2px 10px rgba(20, 25, 30, 0.06);
	--rp-card-shadow-hover: 0 6px 20px rgba(20, 25, 30, 0.10);
	--rp-radius: 14px;
	--rp-radius-sm: 8px;
}

/* ---------------------------------------------------------------------
 * Review / contribution cards
 * ------------------------------------------------------------------- */

#reviews #comments,
#reviews .commentlist {
	list-style: none;
	margin: 0;
	padding: 0;
}

#reviews #comments li.comment,
#reviews .commentlist > li {
	list-style: none;
	background: var(--rp-card-bg);
	border: 1px solid var(--rp-border);
	border-radius: var(--rp-radius);
	box-shadow: var(--rp-card-shadow);
	padding: 18px 20px;
	margin: 0 0 16px;
	transition: box-shadow .2s ease, transform .2s ease;
}

/* the card's own border already separates reviews - remove the theme/WC
   default divider line so it doesn't double up with the card border */
#reviews #comments li.comment,
#reviews .commentlist li {
	border-bottom: none !important;
}

#reviews #comments li.comment:hover,
#reviews .commentlist > li:hover {
	box-shadow: var(--rp-card-shadow-hover);
}

/* nested replies get a lighter, indented treatment instead of a heavy border */
#reviews #comments .children {
	list-style: none;
	margin: 14px 0 0;
	padding: 0 18px 0 0;
	border-right: 0;
}

#reviews #comments .children li.comment {
	background: #fafbfc;
	box-shadow: none;
	border-color: var(--rp-border);
}

/* ---------------------------------------------------------------------
 * Reply card (a shop reply to a review, contribution.php) - the same
 * explicit display/direction/float approach as the review card above,
 * for the same reason: predictable regardless of the active theme's CSS.
 * ------------------------------------------------------------------- */

#reviews .wc-product-reviews-pro-reply-card__inner {
	display: block !important;
	direction: rtl !important;
	float: none !important;
	position: relative;
	margin-bottom: 20px;
	background: linear-gradient(135deg, #f4fffa 0%, #ffffff 72%) !important;
	border: 1px solid rgba(0, 183, 120, .24);
	border-right: 4px solid var(--rp-accent);
	border-radius: var(--rp-radius-sm);
	padding: 15px 16px;
	box-shadow: 0 3px 12px rgba(0, 112, 73, .08);
}

#reviews .wc-product-reviews-pro-reply-card__header {
	display: flex !important;
	direction: rtl !important;
	align-items: center !important;
	justify-content: space-between !important;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}

#reviews .wc-product-reviews-pro-reply-card__label {
	display: inline-flex;
	align-items: center;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--rp-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

#reviews .wc-product-reviews-pro-reply-card__business {
	display: inline-flex !important;
	align-items: center;
	gap: 8px;
	background: rgba(0, 183, 120, .1);
	color: var(--rp-accent-dark);
	border-radius: 999px;
	padding: 4px 4px 4px 14px;
	font-size: 13px;
	float: none !important;
}

#reviews .wc-product-reviews-pro-reply-card__business .business-avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	flex: 0 0 auto;
	margin: 0 !important;
}

#reviews .wc-product-reviews-pro-reply-card__business strong {
	font-weight: 700;
}

/* the "X out of Y people found this helpful" note (karma.php) */
#reviews .wc-product-reviews-pro-reply-card__inner .contribution-karma {
	margin: 0 !important;
	font-size: 12px;
	color: var(--rp-text-muted);
}

#reviews .wc-product-reviews-pro-reply-card__body {
	margin-right: 0 !important;
}

#reviews .wc-product-reviews-pro-reply-card__body .description {
	font-size: 14px;
	line-height: 1.75;
	color: var(--rp-text);
}

#reviews #comments .children > li.comment {
	background: transparent !important;
	border: 0 !important;
	padding: 0 !important;
	margin: 12px 0 0 !important;
}

#reviews .wprp-submit-loader {
	display: inline-block;
	width: 17px;
	height: 17px;
	margin: 0 9px;
	vertical-align: middle;
	border: 2px solid rgba(0, 183, 120, .25);
	border-top-color: var(--rp-accent);
	border-radius: 50%;
	animation: wprp-submit-spin .65s linear infinite;
}

@keyframes wprp-submit-spin {
	to { transform: rotate(360deg); }
}

#reviews .comment_container {
	/* superseded by the more specific/important .wc-product-reviews-pro-card__inner
	   rule right below (same element - .comment_container is kept as a class
	   too, for anything elsewhere that still targets it) */
	display: block;
}

/* ---------------------------------------------------------------------
 * Card header: avatar + author/badge/date on one side, star rating +
 * "would you recommend this" qualifier on the other.
 *
 * This whole block sets display/direction/float explicitly (with
 * !important on the structural properties) on every level, rather than
 * relying on inheriting direction: rtl or hoping the theme's own CSS
 * doesn't also target these same elements - that assumption is what broke
 * this card's layout on some sites before.
 * ------------------------------------------------------------------- */

#reviews .wc-product-reviews-pro-card__inner {
	display: block !important;
	direction: rtl !important;
	float: none !important;
	position: static !important;
}

#reviews .wc-product-reviews-pro-card__header {
	display: flex !important;
	direction: rtl !important;
	flex-direction: row !important;
	flex-wrap: wrap !important;
	align-items: flex-start !important;
	justify-content: space-between !important;
	gap: 10px;
	width: 100%;
	float: none !important;
}

/* avatar + name/badge/date - first in DOM, so it's the rightmost group */
#reviews .wc-product-reviews-pro-card__author-col {
	display: flex !important;
	direction: rtl !important;
	flex-direction: row !important;
	align-items: flex-start !important;
	gap: 10px;
	flex: 0 1 auto;
	min-width: 0;
	float: none !important;
}

#reviews .wc-product-reviews-pro-card__author-col img.avatar,
#reviews .wc-product-reviews-pro-card__author-col .wc-product-reviews-pro-avatar-link {
	flex: 0 0 auto;
	float: none !important;
	position: static !important;
	margin: 0 !important;
}

#reviews .wc-product-reviews-pro-card__author-info {
	display: block !important;
	text-align: right;
	min-width: 0;
}

/* the markup here (p.meta > strong.woocommerce-review__author, dash,
   time.woocommerce-review__published-date) comes from WooCommerce core's
   own woocommerce_review_meta hook (see meta.php) - restyled here via CSS
   rather than replacing that hook's output, so a theme or plugin hooked
   into it (e.g. to restrict who can see the exact review date) still
   works as before */
#reviews .wc-product-reviews-pro-card__author-info p.meta {
	margin: 0;
	display: block;
	font-size: 12.5px;
	color: var(--rp-text-muted);
}

#reviews .wc-product-reviews-pro-card__author-info .woocommerce-review__author {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 3px;
	font-weight: 600;
	color: var(--rp-text);
	font-size: 15px;
	line-height: 1.4;
}

/* the "-" separator only made sense when name and date sat on one line */
#reviews .wc-product-reviews-pro-card__author-info .woocommerce-review__dash {
	display: none;
}

#reviews .wc-product-reviews-pro-card__author-info .woocommerce-review__published-date {
	display: block;
	line-height: 1.4;
}

/* the badge is appended right after the author name/link by
   WC_Product_Reviews_Pro_User_Badges (via the comment_author filter) -
   forced onto its own line here regardless, a plain block box inside
   inline content reliably wraps in every browser without depending on
   any flex/grid behaviour up the tree */
#reviews .wc-product-reviews-pro-card__author-info .woocommerce-review__author .contribution-badge {
	display: inline-flex;
	width: fit-content;
	margin: 0 !important;
}

/* Some themes replace WooCommerce's .woocommerce-review__author markup
   with span[itemprop="name"]. Target that equivalent structure too, so the
   user badge always occupies its own line beneath the author name. */
#reviews .wc-product-reviews-pro-card__author-info [itemprop="name"] {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 3px;
}

#reviews .wc-product-reviews-pro-card__author-info [itemprop="name"] > .contribution-badge {
	display: inline-flex;
	width: fit-content;
	margin: 0 !important;
}

/* star rating + qualifier - second in DOM, so it's the leftmost group.
   text-align: left (not the RTL "start"/right default) so both the star
   rating and the qualifier pill hug the left edge of their column. */
#reviews .wc-product-reviews-pro-card__rating-col {
	display: block !important;
	flex: 0 1 auto;
	min-width: 0;
	float: none !important;
	text-align: left;
}

#reviews .wc-product-reviews-pro-card__rating-col .wc-product-reviews-pro-review-rating {
	display: block;
	margin-bottom: 6px;
}

/* WooCommerce core floats .star-rating by default - neutralized here so
   the text-align: left above reliably positions it instead */
#reviews .wc-product-reviews-pro-card__rating-col .star-rating {
	float: none !important;
	display: inline-block;
}

/* the "would you recommend this?" qualifier pill (contribution-review-qualifiers.php)
   is a plain block-level <p> - forced explicitly here since some themes
   apply a float/inline-block to bare <p> elements inside WooCommerce's
   review markup, which would otherwise pull it out of this column. Sized
   to fit its own text (not the full column width), to keep its pill shape. */
#reviews .contribution-review-qualifiers,
#reviews .contribution-review-qualifiers p {
	display: block !important;
	float: none !important;
	clear: both !important;
	width: fit-content !important;
	max-width: 100%;
	margin: 0 !important;
	text-align: right;
	box-sizing: border-box;
	white-space: normal;
	overflow-wrap: break-word;
}

#reviews .wc-product-reviews-pro-card__inner img.avatar,
#reviews .wc-product-reviews-pro-card__inner .business-avatar {
	border-radius: 50%;
	width: 48px;
	height: 48px;
	object-fit: cover;
	border: 1px solid var(--rp-border);
}

#reviews .wc-product-reviews-pro-avatar-fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	border: 1px solid var(--rp-border);
	border-radius: 50%;
	background: var(--rp-accent);
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	font-family: inherit !important;
}

#reviews .wc-product-reviews-pro-card__inner .business-avatar {
	border-radius: 10px;
}

#reviews .wc-product-reviews-pro-avatar-link {
	display: block;
	line-height: 0;
}

#reviews .wc-product-reviews-pro-author-link {
	color: inherit;
	text-decoration: none;
}

#reviews .wc-product-reviews-pro-author-link:hover {
	color: var(--rp-accent-dark);
	text-decoration: underline;
}

#reviews .wc-product-reviews-pro-card__divider {
	border: none;
	border-top: 1px solid var(--rp-border);
	margin: 14px 0;
}

#reviews p.meta[style] {
	/* the "awaiting approval" notice keeps its accent color from inline styles,
	   just soften the shape to match the rest of the modern skin */
	border-radius: var(--rp-radius-sm) !important;
	font-size: 13px;
}

#reviews .wc-product-reviews-pro-card__body {
	/* the base stylesheet still reserves margin-right for where the avatar
	   used to sit via float, in the old layout - not needed any more, the
	   avatar now lives inside the header row above */
	margin-right: 0 !important;
}

/* ---------------------------------------------------------------------
 * Title + rating
 * ------------------------------------------------------------------- */

#reviews .contribution-title.review-title {
	font-size: 16px;
	font-weight: 700;
	color: var(--rp-text);
	margin: 6px 0 8px;
}

#reviews .star-rating {
	font-size: 15px;
}

/* color-only tweaks - WooCommerce/theme CSS already handles the icon font,
   sizing, and pseudo-element content correctly; we must not redeclare
   "content" or "font-family" here, or the star glyphs can break (render as
   literal fallback letters instead of stars) */
#reviews .star-rating::before {
	color: #dfe1e4;
}

/* rating-based color: red for a 1-star rating, up through green for 5 stars.
   WooCommerce always renders the filled portion as inline "width: X%" (X =
   rating/5*100), so we can target each rating value directly without
   needing to touch the review markup. Ratings in this plugin are always
   whole numbers 1-5, so only these five exact widths ever occur. */
#reviews .star-rating span[style*="width:20%"]::before,
#reviews .star-rating span[style*="width: 20%"]::before {
	color: #e53e3e !important;
}

#reviews .star-rating span[style*="width:40%"]::before,
#reviews .star-rating span[style*="width: 40%"]::before {
	color: #f2994a !important;
}

#reviews .star-rating span[style*="width:60%"]::before,
#reviews .star-rating span[style*="width: 60%"]::before {
	color: #f2c94c !important;
}

#reviews .star-rating span[style*="width:80%"]::before,
#reviews .star-rating span[style*="width: 80%"]::before {
	color: #a3d977 !important;
}

#reviews .star-rating span[style*="width:100%"]::before,
#reviews .star-rating span[style*="width: 100%"]::before {
	color: #27ae60 !important;
}

/* ---------------------------------------------------------------------
 * Content + attachments
 * ------------------------------------------------------------------- */

#reviews .description,
#reviews .comment_container .description p {
	color: var(--rp-text);
	font-size: 14.5px;
	line-height: 1.7;
	margin: 4px 0 10px;
}

#reviews .comment_container img:not(.avatar):not(.business-avatar) {
	max-width: 220px;
	border-radius: var(--rp-radius-sm);
	box-shadow: 0 2px 8px rgba(0,0,0,.12);
	margin: 6px 6px 6px 0;
	transition: transform .2s ease;
}

#reviews .comment_container img:not(.avatar):not(.business-avatar):hover {
	transform: scale(1.03);
}

#reviews p.attachment-removed {
	color: var(--rp-text-muted);
	font-style: italic;
	font-size: 13px;
}

/* ---------------------------------------------------------------------
 * Helpfulness / karma line
 * ------------------------------------------------------------------- */

#reviews .contribution-karma {
	display: block;
	color: var(--rp-text-muted);
	font-size: 12.5px;
	margin: 0 0 6px !important;
}

/* ---------------------------------------------------------------------
 * Actions row: vote (like/dislike), edit, flag
 * ------------------------------------------------------------------- */

#reviews .wc-product-reviews-pro-actions-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	margin: 12px 0 0;
}

#reviews .wc-product-reviews-pro-actions-votes,
#reviews .wc-product-reviews-pro-actions-secondary {
	display: flex;
	align-items: center;
	gap: 4px;
}

/* vote (like/dislike) buttons */
#reviews .contribution-actions a.vote {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #f4f5f6;
	color: var(--rp-text-muted) !important;
	font-size: 1em !important;
	transition: background .15s ease, color .15s ease, transform .1s ease;
}

#reviews .contribution-actions a.vote:hover {
	background: #eef1f3;
	transform: translateY(-1px);
}

#reviews .contribution-actions a.vote.vote-up.done {
	background: rgba(0, 183, 120, .12);
	color: var(--rp-accent-dark) !important;
}

#reviews .contribution-actions a.vote.vote-down.done {
	background: rgba(230, 76, 76, .12);
	color: var(--rp-danger) !important;
}

#reviews .contribution-actions .vote-count {
	font-size: 12.5px;
	color: var(--rp-text-muted);
	margin: 0 2px 0 10px !important;
}

/* edit / flag as small pill-style text buttons */
#reviews .contribution-actions a.edit-comment,
#reviews .contribution-actions a.js-toggle-flag-form {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 30px;
	padding: 0 12px;
	border-radius: 999px;
	background: #f4f5f6;
	color: var(--rp-text-muted) !important;
	font-size: 12.5px !important;
	text-decoration: none;
	transition: background .15s ease, color .15s ease;
}

#reviews .contribution-actions a.edit-comment:hover,
#reviews .contribution-actions a.js-toggle-flag-form:hover {
	background: #eef1f3;
	color: var(--rp-text) !important;
}

#reviews .contribution-actions a.js-toggle-flag-form.done {
	background: rgba(230, 76, 76, .12);
	color: var(--rp-danger) !important;
}

#reviews .contribution-actions a.edit-comment .edit-icon {
	font-size: 16px !important;
	line-height: 1;
}

#reviews .contribution-actions .feedback {
	font-size: 12.5px;
	border-radius: 999px;
	padding: 2px 10px;
	background: #f4f5f6;
}

#reviews .contribution-actions .feedback:empty {
	display: none;
	padding: 0;
}

#reviews .contribution-actions .feedback.error {
	background: rgba(230, 76, 76, .12);
}

/* ---------------------------------------------------------------------
 * Flag form
 * ------------------------------------------------------------------- */

#reviews .contribution-flag-form {
	background: #fafbfc;
	border: 1px solid var(--rp-border);
	border-radius: var(--rp-radius-sm);
	padding: 14px 16px;
	margin-top: 10px;
}

#reviews .contribution-flag-form p {
	margin: 0 0 8px;
	font-size: 13px;
	color: var(--rp-text-muted);
}

#reviews .contribution-flag-form input.input-flag-reason {
	width: 100%;
	border: 1px solid var(--rp-border);
	border-radius: var(--rp-radius-sm);
	padding: 8px 12px;
	font-size: 13.5px;
}

#reviews .contribution-flag-form .button {
	border-radius: 999px;
	background: var(--rp-accent);
	color: #fff;
	border: none;
	padding: 8px 18px;
	font-size: 13px;
	transition: background .15s ease;
}

#reviews .contribution-flag-form .button:hover {
	background: var(--rp-accent-dark);
}

/* ---------------------------------------------------------------------
 * Write-a-review / question / photo / video form
 * ------------------------------------------------------------------- */

#reviews .form-contribution {
	background: var(--rp-card-bg);
	border: 1px solid var(--rp-border);
	border-radius: var(--rp-radius);
	box-shadow: var(--rp-card-shadow);
	padding: 20px 22px;
}

#reviews .form-contribution .form-row label {
	font-weight: 600;
	font-size: 13.5px;
	color: var(--rp-text);
	margin-bottom: 6px;
	display: inline-block;
}

#reviews .form-contribution input.input-text,
#reviews .form-contribution textarea,
#reviews .form-contribution select {
	width: 100%;
	border: 1px solid var(--rp-border);
	border-radius: var(--rp-radius-sm);
	padding: 10px 14px;
	font-size: 14px;
	transition: border-color .15s ease, box-shadow .15s ease;
}

#reviews .form-contribution input.input-text:focus,
#reviews .form-contribution textarea:focus,
#reviews .form-contribution select:focus {
	border-color: var(--rp-accent);
	box-shadow: 0 0 0 3px rgba(0, 183, 120, .12);
	outline: none;
}

#reviews .form-contribution .wc-product-reviews-pro-form-submit-row button,
#reviews .form-contribution .wc-product-reviews-pro-form-submit-row input[type="submit"] {
	border-radius: 999px;
	background: var(--rp-accent);
	color: #fff;
	border: none;
	padding: 10px 26px;
	font-size: 14px;
	font-weight: 600;
	transition: background .15s ease, transform .1s ease;
}

#reviews .form-contribution .wc-product-reviews-pro-form-submit-row button:hover,
#reviews .form-contribution .wc-product-reviews-pro-form-submit-row input[type="submit"]:hover {
	background: var(--rp-accent-dark);
	transform: translateY(-1px);
}

/* disabled until every required field (including the star rating) is
   filled in - see wc-product-reviews-pro-form-fixes.js */
#reviews .form-contribution .wc-product-reviews-pro-form-submit-row button:disabled,
#reviews .form-contribution .wc-product-reviews-pro-form-submit-row input[type="submit"]:disabled,
#reviews .form-contribution .update-review:disabled {
	background: var(--rp-border);
	color: var(--rp-text-muted);
	cursor: not-allowed;
	transform: none;
}

#reviews .wc-product-reviews-pro-validation-error {
	display: block;
	color: var(--rp-danger);
	font-size: 12.5px;
	margin-top: 4px;
}

/* ---------------------------------------------------------------------
 * Review history accordion (older, superseded reviews from the same
 * reviewer, collapsed under their current/latest review)
 * ------------------------------------------------------------------- */

#reviews .wc-product-reviews-pro-history {
	direction: rtl;
	margin: 18px 0 40px;
	padding: 0;
	clear: both;
	float: none;
}

#reviews .wc-product-reviews-pro-history,
#reviews .wc-product-reviews-pro-history * {
	box-sizing: border-box;
}

#reviews .wc-product-reviews-pro-history__toggle {
	display: flex !important;
	direction: rtl;
	align-items: center !important;
	justify-content: flex-start !important;
	width: 100%;
	min-height: 58px;
	gap: 11px;
	background: linear-gradient(135deg, #f3f8f6 0%, #fbfdfc 100%) !important;
	border: 1px solid rgba(0, 112, 73, .14) !important;
	border-right: 4px solid var(--rp-accent) !important;
	border-radius: 12px !important;
	box-shadow: 0 4px 14px rgba(0, 80, 53, .06);
	cursor: pointer;
	font: inherit;
	text-align: right;
	color: var(--rp-text);
	padding: 9px 12px !important;
}

#reviews .wc-product-reviews-pro-history__toggle:hover {
	border-color: rgba(0, 183, 120, .42) !important;
	box-shadow: 0 6px 18px rgba(0, 112, 73, .12);
}

#reviews .wc-product-reviews-pro-history__toggle-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	flex: 0 0 32px;
	border-radius: 10px;
	background: var(--rp-accent);
	color: #fff;
	font-size: 19px;
	line-height: 1;
}

#reviews .wc-product-reviews-pro-history__toggle-copy {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

#reviews .wc-product-reviews-pro-history__toggle-copy strong {
	font-size: 13px;
	font-weight: 700;
	color: var(--rp-text);
}

#reviews .wc-product-reviews-pro-history__toggle-copy small {
	font-size: 11.5px;
	color: var(--rp-text-muted);
}

#reviews .wc-product-reviews-pro-history__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	margin-right: auto;
	border-radius: 50%;
	background: #e5f4ed;
	color: var(--rp-accent-dark);
	transition: transform .2s ease, background-color .2s ease;
	font-size: 11px;
}

#reviews .wc-product-reviews-pro-history__toggle.is-open .wc-product-reviews-pro-history__arrow {
	transform: rotate(180deg);
	background: var(--rp-accent);
	color: #fff;
}

#reviews .wc-product-reviews-pro-history__list {
	display: block;
	margin: 10px 5px 0 0;
	padding: 2px 16px 0 0;
	border-right: 2px solid #cfe7dc;
}

#reviews .wc-product-reviews-pro-history__list[hidden] {
	display: none !important;
}

#reviews .wc-product-reviews-pro-history__item {
	display: block !important;
	position: relative;
	float: none !important;
	clear: both;
	width: 100%;
	margin: 0 0 11px !important;
	padding: 14px 15px !important;
	background: #f9fbfa !important;
	border: 1px solid #e1e9e5 !important;
	border-radius: 10px !important;
	box-shadow: none !important;
	color: var(--rp-text-muted);
	opacity: 1;
	overflow: hidden;
}

#reviews .wc-product-reviews-pro-history__rating,
#reviews .wc-product-reviews-pro-history__qualifiers {
	filter: grayscale(1);
	pointer-events: none;
	opacity: .72;
}

#reviews .wc-product-reviews-pro-history__rating .star-rating {
	float: none !important;
	margin: 0 !important;
	font-size: 13px;
}

#reviews .wc-product-reviews-pro-history__inactive-label,
#reviews .wc-product-reviews-pro-history__qualifiers span {
	display: inline-flex;
	align-items: center;
	border-radius: 999px;
	padding: 2px 7px;
	font-size: 11px;
	background: #eef1f3;
	color: var(--rp-text-muted);
}

#reviews .wc-product-reviews-pro-history__qualifiers {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin: 0 0 8px;
}

#reviews .wc-product-reviews-pro-history__meta {
	display: flex;
	direction: rtl;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 10px;
}

#reviews .wc-product-reviews-pro-history__date {
	font-size: 12px;
	color: var(--rp-text-muted);
}

#reviews .wc-product-reviews-pro-history__votes {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin: -3px 0 10px;
	pointer-events: none;
}

#reviews .wc-product-reviews-pro-history__vote {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	border: 1px solid #e3e9e6;
	border-radius: 999px;
	padding: 3px 8px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.25;
	background: #fff;
}

#reviews .wc-product-reviews-pro-history__vote small {
	font-size: 10px;
	font-weight: 500;
	color: var(--rp-text-muted);
}

#reviews .wc-product-reviews-pro-history__vote--up { color: #16855c; }
#reviews .wc-product-reviews-pro-history__vote--down { color: #bd5a5a; }

#reviews .wc-product-reviews-pro-history__title {
	display: block;
	font-size: 14px;
	color: var(--rp-text);
	margin: 0 0 6px;
}

#reviews .wc-product-reviews-pro-history__content {
	font-size: 13.5px;
	line-height: 1.85;
	color: var(--rp-text-muted);
	word-break: break-word;
}

#reviews .wc-product-reviews-pro-history__content p {
	margin: 0 0 6px;
}

#reviews .wc-product-reviews-pro-history__content p:last-child {
	margin-bottom: 0;
}

#reviews .wc-product-reviews-pro-history__replies {
	margin: 12px 0 0;
	padding: 10px 12px;
	border: 1px solid #dbe9e2;
	border-right: 3px solid #91cdb0;
	border-radius: 8px;
	background: #fff;
}

#reviews .wc-product-reviews-pro-history__reply + .wc-product-reviews-pro-history__reply {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--rp-border);
}

#reviews .wc-product-reviews-pro-history__reply strong {
	display: block;
	margin: 0 0 4px;
	font-size: 12px;
	color: var(--rp-accent-dark);
}

#reviews .wc-product-reviews-pro-history__reply > div {
	font-size: 12.5px;
	line-height: 1.75;
	color: var(--rp-text-muted);
}

#reviews .wc-product-reviews-pro-history__reply p {
	margin: 0 0 5px;
}

#reviews .wc-product-reviews-pro-history__reply p:last-child {
	margin-bottom: 0;
}

/* ---------------------------------------------------------------------
 * Reviewer reputation badges
 * ------------------------------------------------------------------- */

#reviews .contribution-badge {
	border-radius: 999px;
	padding: 2px 10px;
	font-size: 11.5px;
	font-weight: 600;
	vertical-align: middle;
}

#reviews .contribution-badge-professional {
	background: #2a2a72;
	color: #fff;
}

#reviews .contribution-badge-active {
	background: #1e88e5;
	color: #fff;
}

#reviews .contribution-badge-helpful {
	background: #0f9d8c;
	color: #fff;
}

#reviews .contribution-badge-satisfied {
	background: rgba(0, 183, 120, .14);
	color: var(--rp-accent-dark);
}

#reviews .contribution-badge-dissatisfied {
	background: rgba(230, 76, 76, .14);
	color: var(--rp-danger);
}

#reviews .contribution-badge-regular {
	background: #eef1f3;
	color: var(--rp-text-muted);
}

#reviews .contribution-badge-manual {
	background: #f0b429;
	color: #3a2a00;
}

#reviews .contribution-badge-admin {
	background: #666;
	color: #fff;
}

/* badges with a description configured become clickable (see
   WC_Product_Reviews_Pro_User_Badges::build_badge_markup()); the modal
   itself is styled in wc-product-reviews-pro-badge-modal.css, this is just
   the in-card affordance */
#reviews .contribution-badge.wc-product-reviews-pro-badge {
	cursor: pointer;
	transition: filter .15s ease, transform .1s ease;
}

#reviews .contribution-badge.wc-product-reviews-pro-badge:hover {
	filter: brightness(0.94);
	transform: translateY(-1px);
}

/* ---------------------------------------------------------------------
 * Rating stars (the picker used when writing a review), with the
 * 1–5 numbers shown under each star so it's unambiguous which star
 * is being selected.
 * ------------------------------------------------------------------- */

#reviews .star-rating-selector {
	margin-bottom: 26px;
}

#reviews .star-rating-selector fieldset {
	display: flex;
	gap: 6px;
}

#reviews .star-rating-selector:not(:checked) label.checkbox {
	position: relative;
	overflow: visible !important;
	width: 1.6em !important;
	height: 1.6em;
	margin-right: 0 !important;
	font-size: 1.6em !important;
	border-radius: 8px;
	transition: transform .1s ease;
}

#reviews .star-rating-selector:not(:checked) label.checkbox:hover {
	transform: translateY(-2px);
}

/* the visible 1–5 number, centered under each star */
#reviews .star-rating-selector:not(:checked) label.checkbox::after {
	content: attr(data-rating);
	position: absolute;
	left: 0;
	right: 0;
	bottom: -20px;
	text-indent: 0;
	text-align: center;
	font-size: 11px;
	font-weight: 600;
	color: var(--rp-text-muted);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
}

#reviews .star-rating-selector:not(:checked) input:checked ~ label.checkbox::after,
#reviews .star-rating-selector:not(:checked) label.checkbox:hover::after,
#reviews .star-rating-selector:not(:checked) label.checkbox:hover ~ label.checkbox::after {
	color: var(--rp-accent-dark);
}

#reviews .star-rating-selector .star-label {
	display: block;
	font-size: 12.5px;
	color: var(--rp-text-muted);
	margin-top: 4px;
}

/* ---------------------------------------------------------------------
 * Contribution type tabs / switcher
 * ------------------------------------------------------------------- */

#reviews .js-switch-contribution-type {
	border-radius: 999px;
	padding: 6px 16px;
	font-size: 13.5px;
}

#reviews .js-switch-contribution-type.active {
	background: var(--rp-accent);
	color: #fff !important;
}

/* ---------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------- */

/* Keep the reviewer and rating in one header row on phones as well. */
@media (max-width: 767px) {
	#reviews #comments li.comment,
	#reviews .commentlist > li,
	#reviews .form-contribution {
		padding: 14px 14px;
		box-sizing: border-box;
	}

	/* safety net: nothing inside the card - long words, a long qualifier
	   term name, anything - should ever be able to push the card wider
	   than the screen */
	#reviews .wc-product-reviews-pro-card__inner,
	#reviews .wc-product-reviews-pro-card__inner * {
		box-sizing: border-box;
		max-width: 100%;
		overflow-wrap: break-word;
	}

	#reviews #comments .children {
		padding-right: 0;
	}

	#reviews .wc-product-reviews-pro-card__inner {
		overflow: hidden;
	}

	#reviews .contribution-actions a.edit-comment span:not(.edit-icon),
	#reviews .contribution-actions a.js-toggle-flag-form small {
		display: none;
	}

	/* the base stylesheet's default avatar size is a bit large for a
	   narrow mobile card */
	#reviews .wc-product-reviews-pro-card__inner img.avatar,
	#reviews .wc-product-reviews-pro-card__inner .business-avatar {
		width: 2.6em;
		height: 2.6em;
	}

	#reviews .wc-product-reviews-pro-avatar-fallback {
		width: 2.6em !important;
		height: 2.6em !important;
		font-size: 15px;
	}

	#reviews .wc-product-reviews-pro-card__author-info .woocommerce-review__author {
		font-size: 14px;
	}

	/* Mobile header proportions: avatar 15%, author details 45%, rating 40%.
	   The first grid column is on the right because this card is RTL. */
	#reviews .wc-product-reviews-pro-card__header {
		display: grid !important;
		grid-template-columns: 60% 40%;
		align-items: flex-start !important;
		gap: 0;
		margin-bottom: 10px;
	}

	#reviews .wc-product-reviews-pro-card__author-col {
		display: grid !important;
		grid-template-columns: 25% 75%;
		align-items: flex-start !important;
		width: 100% !important;
		max-width: none;
		min-width: 0;
		gap: 0;
	}

	#reviews .wc-product-reviews-pro-card__rating-col {
		width: 100% !important;
		max-width: none;
		min-width: 0;
		text-align: left;
		white-space: normal;
	}

	#reviews .wc-product-reviews-pro-card__rating-col .contribution-review-qualifiers,
	#reviews .wc-product-reviews-pro-card__rating-col .contribution-review-qualifiers p {
		max-width: 100% !important;
		white-space: normal;
		text-align: left;
	}

	#reviews .wc-product-reviews-pro-card__author-col img.avatar,
	#reviews .wc-product-reviews-pro-card__author-col .wc-product-reviews-pro-avatar-fallback {
		width: min(100%, 42px) !important;
		height: auto !important;
		aspect-ratio: 1;
	}

	#reviews .wc-product-reviews-pro-card__author-col .wc-product-reviews-pro-avatar-link {
		width: min(100%, 42px);
	}

	/* tighter vertical rhythm for the stacked name/badge/date on mobile */
	#reviews .wc-product-reviews-pro-card__author-info p.meta {
		line-height: 1.3;
	}

	#reviews .wc-product-reviews-pro-card__author-info .woocommerce-review__author,
	#reviews .wc-product-reviews-pro-card__author-info .woocommerce-review__published-date {
		line-height: 1.3;
	}

	#reviews .wc-product-reviews-pro-card__author-info .woocommerce-review__author .contribution-badge {
		margin-top: 2px !important;
	}

	#reviews .wc-product-reviews-pro-card__rating-col .wc-product-reviews-pro-review-rating {
		margin-bottom: 4px;
	}

	/* a touch smaller on mobile, with room to actually wrap instead of
	   trying to stay on one line */
	#reviews .wc-product-reviews-pro-review-rating .star-rating {
		font-size: 13px;
	}

	#reviews .contribution-review-qualifiers p {
		font-size: 12.5px !important;
		padding: 4px 4px !important;
	}

	/* shrink the rating-picker stars so all 5 (plus their number labels)
	   comfortably fit a narrow screen without overflowing the form */
	#reviews .star-rating-selector {
		margin-bottom: 22px;
	}

	#reviews .star-rating-selector fieldset {
		gap: 3px;
	}

	#reviews .star-rating-selector:not(:checked) label.checkbox {
		width: 1.25em !important;
		height: 1.25em;
		font-size: 1.25em !important;
	}

	#reviews .star-rating-selector:not(:checked) label.checkbox::after {
		bottom: -17px;
		font-size: 10px;
	}
}

/* ---------------------------------------------------------------------
 * Reply form (the "reply to this review" form nested under a review,
 * toggled open via JS - form-contribution + form-contribution_comment)
 * ------------------------------------------------------------------- */

#reviews .form-contribution.form-contribution_comment {
	position: relative;
	direction: rtl;
	background: linear-gradient(135deg, #f4faf7 0%, #ffffff 72%);
	border: 1px solid #d8e9df;
	border-right: 4px solid var(--rp-accent);
	border-radius: 14px;
	box-shadow: 0 8px 24px rgba(15, 91, 58, .08);
	padding: 18px 18px 16px;
	margin: 14px 0 0;
	overflow: hidden;
}

/* Keep reply forms aligned with their parent comment in WooCommerce layouts. */
.woocommerce #reviews #comments .form-contribution_comment,
.woocommerce-page #reviews #comments .form-contribution_comment {
	margin: 10px 40px 25px 0;
	padding: 10px;
	border: 0;
}

#reviews .form-contribution.form-contribution_comment:before {
	content: 'پاسخ به نظر';
	display: flex;
	align-items: center;
	width: max-content;
	max-width: 100%;
	margin: 0 0 13px;
	padding: 5px 10px;
	border-radius: 999px;
	background: #e3f3eb;
	color: var(--rp-accent-dark);
	font-size: 11.5px;
	font-weight: 700;
	line-height: 1.4;
}

#reviews .form-contribution.form-contribution_comment .form-row label {
	font-size: 13px;
	font-weight: 700;
	color: #315546;
}

#reviews .form-contribution.form-contribution_comment textarea {
	min-height: 110px;
	resize: vertical;
	background: rgba(255, 255, 255, .82);
	border-color: #cfe2d7;
	line-height: 1.9;
}

#reviews .form-contribution.form-contribution_comment textarea:focus {
	border-color: var(--rp-accent);
	box-shadow: 0 0 0 4px rgba(0, 183, 120, .11);
}

#reviews .form-contribution.form-contribution_comment .wc-product-reviews-pro-form-submit-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 14px 0 0;
}

#reviews .form-contribution.form-contribution_comment .wc-product-reviews-pro-form-submit-row button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: 150px;
	min-height: 42px;
	margin: 0;
	padding: 9px 17px;
	border-radius: 10px;
	box-shadow: 0 7px 14px rgba(0, 130, 82, .18);
}

#reviews .form-contribution.form-contribution_comment .response {
	margin: 0;
	font-size: 12px;
}

@media (max-width: 480px) {
	#reviews .form-contribution.form-contribution_comment {
		padding: 15px 14px;
		border-radius: 12px;
	}

	#reviews .form-contribution.form-contribution_comment .wc-product-reviews-pro-form-submit-row button {
		width: 100%;
	}
}
