/*
 * Review section.
 *
 * Styling only, over the markup Customer Reviews for WooCommerce prints. Values
 * follow Hey Harper, measured at a 375px viewport: the whole summary there is
 * "Reviews (60)" at 13px/500 beside a 4.92 at 17px/600, then dated, titled,
 * attributed reviews with a Verified Buyer line at 13px/500 in 60% grey.
 */

/*
 * The histogram. With nine reviews it prints three rows reading 0%, which
 * advertises how few reviews there are. Neither reference shows one.
 */
.pearlory-reviews-compact .ivole-summaryBox,
.pearlory-reviews-compact .cr-histogramTable,
.pearlory-reviews-compact .cr-summaryBox-ajax {
	display: none;
}

/*
 * Merchant facing, and absent from both references. The plugin styles this by
 * element and class inside its wrap, so the same shape is needed here to take
 * it rather than losing the tie on source order.
 */
body.pearlory-reviews-no-write .cr-overall-rating-wrap button.cr-ajax-reviews-add-review,
body.pearlory-reviews-no-write button.cr-ajax-reviews-add-review {
	/* !important because the reviews plugin sets its own. Verified first that the
	   selectors match and the rules load: they do, and the plugin still won. */
	display: none !important;
}

/*
 * The summary. The plugin sets a panel with a large centred average; this puts
 * the score and its count on one quiet line.
 */
.pearlory-reviews-compact .cr-summaryBox-wrap {
	margin: 0 0 16px;
	padding: 0;
	background: none;
	border: 0;
}

/*
 * The summary on one line.
 *
 * The plugin sets this wrap to flex-direction: column with align-items: center,
 * so the score, the stars and the count stacked and each centred itself at a
 * different width. Measured: they sat at x=165, x=127 and x=115 while the
 * heading and every other row on the page sit at x=15. Three ragged edges under
 * a left aligned heading is most of why the section read as broken.
 *
 * One row, left aligned, vertically centred: 4.7, then the stars, then the
 * count. That is Hey Harper's arrangement and it is one line rather than three.
 */
body.pearlory-reviews-compact .cr-summaryBox-wrap .cr-overall-rating-wrap {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap;
	align-items: center !important;
	justify-content: flex-start !important;
	gap: 8px;
	padding: 0 !important;
	background: none;
	text-align: left !important;
}

body.pearlory-reviews-compact .cr-summaryBox-wrap {
	display: block !important;
	padding: 0 !important;
}

/* The three parts sit inline instead of each taking a full width row. */
body.pearlory-reviews-compact .cr-overall-rating-wrap .cr-average-rating,
body.pearlory-reviews-compact .cr-overall-rating-wrap .cr-average-rating-stars,
body.pearlory-reviews-compact .cr-overall-rating-wrap .cr-total-rating-count {
	width: auto !important;
	margin: 0 !important;
	text-align: left !important;
}

/*
 * "Based on 9 reviews" states a number the heading already carries as
 * "Reviews (9)", two lines above it. Hey Harper carries the count once, in the
 * heading, and then only the score.
 */
body.pearlory-reviews-compact .cr-overall-rating-wrap .cr-total-rating-count {
	display: none !important;
}

/* Measured at 36px before this. Hey Harper sets the equivalent at 16.96px. */
body.pearlory-reviews-compact .cr-overall-rating-wrap .cr-average-rating,
body.pearlory-reviews-compact .cr-overall-rating-wrap .cr-average-rating span {
	font-size: 17px !important;
	font-weight: 600;
	line-height: 1.2 !important;
	color: #161616;
}

/*
 * Star alignment.
 *
 * Measured: the score's centre sat at 256.5 and the star glyphs at 259, so the
 * stars rendered 2.5px low against the number beside them. The container was
 * already centred; the inner SVG wrap carries line-height: 0 and bottom aligned
 * itself inside a 25px box while being 20px tall. Making the container a
 * centred flex box of the glyphs' own height removes the slack it was sitting in.
 */
body.pearlory-reviews-compact .cr-overall-rating-wrap .cr-average-rating-stars {
	display: flex !important;
	align-items: center !important;
	height: 20px !important;
	font-size: 14px !important;
	line-height: 1 !important;
}

/*
 * The plugin puts margin-top: 5px on the star wrap. In a centred flex row that
 * shifts the glyphs down by half of it, which is the 2.5px measured between the
 * score's centre and the stars'. Zeroing the margin is the cause rather than a
 * nudge, so the centring already in place does the rest.
 */
body.pearlory-reviews-compact .cr-overall-rating-wrap .cr-average-rating-stars .crstar-rating-svg {
	display: flex !important;
	align-items: center !important;
	margin-top: 0 !important;
}

body.pearlory-reviews-compact .cr-overall-rating-wrap .cr-overall-rating-text,
body.pearlory-reviews-compact .cr-summaryBox-wrap .cr-based-on {
	font-size: 13px;
	font-weight: 400;
	color: rgba(0, 0, 0, 0.6);
}

/* The heading repeats the product name the page already carries twice. */
.pearlory-reviews-compact .woocommerce-Reviews-title {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	color: #161616;
	text-transform: none;
}

/*
 * Individual reviews. The plugin's own rows are close to the reference already,
 * so this only settles the type and the spacing between them.
 */
.pearlory-reviews-compact .commentlist {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pearlory-reviews-compact .commentlist > li.review {
	margin: 0 0 16px;
	padding: 0 0 16px;
	border-bottom: 1px solid #eeece8;
	list-style: none;
}

.pearlory-reviews-compact .commentlist > li.review:last-child {
	border-bottom: 0;
}

.pearlory-reviews-compact .cr-review-author,
.pearlory-reviews-compact .woocommerce-review__author {
	font-size: 13px;
	font-weight: 600;
	color: #161616;
}

.pearlory-reviews-compact .cr-review-date,
.pearlory-reviews-compact .woocommerce-review__published-date {
	font-size: 12px;
	font-weight: 400;
	color: rgba(0, 0, 0, 0.55);
}

.pearlory-reviews-compact .cr-verified-badge,
.pearlory-reviews-compact .cr-review-verified {
	font-size: 12px;
	font-weight: 400;
	color: rgba(0, 0, 0, 0.55);
}

.pearlory-reviews-compact .description,
.pearlory-reviews-compact .cr-review-content {
	font-size: 13px;
	line-height: 1.55;
	color: rgba(0, 0, 0, 0.72);
}

/* The sort control and the count sit on one line rather than stacking. */
.pearlory-reviews-compact .cr-count-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 12px;
}

.pearlory-reviews-compact .cr-count-row-count {
	font-size: 12px;
	color: rgba(0, 0, 0, 0.55);
}

/* Customer images earn their place, so they stay. Only the label is quietened. */
.pearlory-reviews-compact .cr-ajax-reviews-cus-images-title {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 600;
	color: #161616;
	text-transform: none;
}


/*
 * A search field over nine reviews is a control with nothing to do. The plugin
 * ships it for shops carrying hundreds. Neither reference has one.
 */
body.pearlory-reviews-compact .cr-ajax-search {
	display: none !important;
}

/*
 * The plugin wraps the summary and the sort row in grey panels. Removing the
 * fill lets the reviews themselves be the only thing with weight, which is what
 * both references do.
 */
body.pearlory-reviews-compact .cr-summaryBox-wrap,
body.pearlory-reviews-compact .cr-overall-rating-wrap,
body.pearlory-reviews-compact .cr-count-row {
	background: none !important;
	border: 0 !important;
}

body.pearlory-reviews-compact .cr-count-row {
	padding: 0 !important;
}

/* Left aligned, like every other row on this page. */
body.pearlory-reviews-compact .cr-overall-rating-wrap,
body.pearlory-reviews-compact .cr-summaryBox-wrap {
	text-align: left !important;
}


/*
 * The reviews block carried 68px of empty space above its heading, inherited
 * from the tab panel the plugin renders inside.
 */
body.pearlory-reviews-compact #reviews,
body.pearlory-reviews-compact .cr-reviews-ajax-comments {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

body.pearlory-reviews-compact .woocommerce-Reviews-title {
	margin-top: 0 !important;
}


/*
 * The 68px above the reviews heading is not the reviews block's own: it is the
 * summary column's padding-bottom plus the cart form's margin, measured at 30px
 * and 21px, landing under the accordion. A section break belongs there, but not
 * a two thirds empty screen, so it is trimmed to something deliberate.
 */
@media (max-width: 849px) {
	body.pearlory-reviews-compact .product-info {
		padding-bottom: 8px;
	}

	body.pearlory-reviews-compact form.cart {
		margin-bottom: 0;
	}

	body.pearlory-reviews-compact .woocommerce-Reviews-title {
		padding-top: 24px;
		border-top: 1px solid #e8e6e1;
	}
}


/*
 * Summary stars under the product title.
 *
 * Rendered by the reviews plugin's own SVG renderer so they are the same glyphs
 * as the reviews below, rather than WooCommerce's text stars with a percentage
 * fill that leaves a part drawn character at 4.67.
 */
.single-product .product-stacked-info .pearlory-stars {
	display: inline-flex;
	align-items: center;
	position: relative;
	margin: 2px 0 0;
	line-height: 1;
}

.single-product .product-stacked-info .pearlory-stars .cr-rating-icon-base,
.single-product .product-stacked-info .pearlory-stars .cr-rating-icon-frnt {
	display: flex;
	align-items: center;
}

/* 20px, matching the glyphs in the reviews below rather than sitting 4px
   smaller than them. Same renderer, same size, so the two read as one thing. */
.single-product .product-stacked-info .pearlory-stars svg {
	width: 20px;
	height: 20px;
}


/*
 * Show more reviews.
 *
 * The plugin's own button is off palette: measured at a 1px rgb(188,204,212)
 * blue grey border with rgb(14,37,44) teal navy text, square corners, and the
 * label uppercased in CSS with letter spacing. None of those colours appear
 * anywhere else on the page.
 *
 * Restyled to the language the rest of the page already speaks: the #e8e6e1
 * hairline used by the accordion and the section rules, the 8px radius of the
 * buy bar, and the accordion's 13px semibold. The label's own text is already
 * sentence case, so dropping the transform is enough to fix the shouting.
 *
 * Full width because it is the one action in that section and a full width tap
 * target on a phone beats a 230px box floated to the left.
 */
body.pearlory-reviews-compact .cr-show-more-review-spinner-cnt {
	margin: 4px 0 0;
	text-align: center;
}

body.pearlory-reviews-compact button.cr-show-more-reviews-prd {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 12px 18px;
	background: transparent;
	border: 1px solid #e8e6e1 !important;
	border-radius: 8px;
	color: #161616 !important;
	font-size: 13px !important;
	font-weight: 600;
	letter-spacing: 0 !important;
	line-height: 1.3;
	text-transform: none !important;
}

body.pearlory-reviews-compact button.cr-show-more-reviews-prd:hover,
body.pearlory-reviews-compact button.cr-show-more-reviews-prd:focus-visible {
	background: rgba(0, 0, 0, 0.03);
	border-color: #d8d5cf !important;
}


/*
 * The review cards.
 *
 * Measured on Atolea at a 375px viewport: every review is a bordered card,
 * 1px solid rgb(224,224,224) at a 5px radius with 20px of inner padding, and
 * the body is 14px/400 upright. The card is what makes their section read as
 * designed rather than as a comment thread separated by rules, so the same
 * treatment is taken here at this page's own border colour and radius.
 *
 * Their two column masonry is not taken. At 375px it leaves 123px of text
 * width per card, which set a 40 word review as an 860px tall column on the
 * page measured.
 *
 * The list element carries both commentlist and cr-ajax-reviews-list, so the
 * rules written above against .commentlist do reach it. They lose: the plugin
 * styles the same elements from chains led by #reviews and #comments, which no
 * chain of plain classes can outrank. This block carries both ids for that
 * reason rather than reaching for the flag.
 */
body.pearlory-reviews-compact #reviews #comments .cr-ajax-reviews-list > li.review {
	margin: 0 0 10px;
	padding: 0;
	border: 0;
}

/* The plugin draws a rule under the container as well as under the text. */
body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list > li.review .comment_container {
	padding: 0;
	border-bottom: 0;
}

/*
 * The card itself. This element wraps the meta, the stars, the body and the
 * photos, so it is the border rather than a new wrapper. The plugin's own
 * padding-bottom and border-bottom here were the divider being replaced.
 */
body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list > li.review .cr-comment-text {
	padding: 14px;
	background: none;
	border: 1px solid #e8e6e1;
	border-bottom: 1px solid #e8e6e1;
	border-radius: 10px;
}

/* Name and date on one row, tops aligned, date pushed to the far edge. */
body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list .meta {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	margin: 0 0 6px;
	padding: 0;
}

body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list .cr-meta-author-featured-date {
	min-width: 0;
}

body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list .woocommerce-review__author {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	color: #161616;
}

/*
 * Measured at 9.8px in rgb(77,93,100), a blue grey that appears nowhere else on
 * the page. The size is the child theme's: style.css sets .verified to 0.7em
 * with a flag, so the size here needs one too. Nothing else in this block does.
 * Hey Harper carries the same line in grey at 13px/500.
 */
body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list .woocommerce-review__verified {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 11.5px !important;
	font-weight: 500;
	line-height: 1.4;
	color: rgba(0, 0, 0, 0.5);
	text-transform: none;
}

body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list .woocommerce-review__verified::before {
	content: "\2713";
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
}

/*
 * The date measured 14px, larger than the 13px name beside it, because the
 * plugin sets 0.875em from a selector led by #reviews. An id beats any class
 * chain, so this needs the flag rather than a longer selector.
 */
body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list time.woocommerce-review__published-date {
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.5;
	color: rgba(0, 0, 0, 0.45);
	white-space: nowrap;
}

/* Glyphs at 20px, the size Atolea sets and the size of the summary stars. */
body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list .crstar-rating-svg {
	margin: 0 0 8px;
}

body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list .crstar-rating-svg svg {
	width: 18px;
	height: 18px;
}

/*
 * Flatsome sets font-style: italic on .commentlist li .description. The id in
 * the prefix outranks it, so no flag is needed. Atolea sets 14px/20px upright.
 */
body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list .description {
	margin: 0;
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: 1.5;
	color: #2b2b2b;
}

body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list .description p:last-child {
	margin-bottom: 0;
}

/*
 * A star only review has an empty .description. Left in flow it contributed
 * the blank band measured between the stars and the card edge.
 */
body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list .description:empty {
	display: none;
}

/* Customer photos in a row, at the radius the gallery and the buy bar use. */
body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list .cr-comment-images {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 10px 0 0;
}

body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list .cr-comment-images a {
	display: block;
	line-height: 0;
}

body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list .cr-comment-images img {
	width: 64px;
	height: 64px;
	margin: 0;
	border-radius: 8px;
	object-fit: cover;
}

/*
 * Each photo sits in a div.iv-comment-image the plugin borders at 1px with a
 * 5px radius. Around a 64px thumbnail at an 8px radius that drew a 66px ring
 * at a different curve, which is the white frame visible around every review
 * photo. The thumbnail's own rounding is the shape, so the frame comes off.
 */
body.pearlory-reviews-compact #reviews .cr-ajax-reviews-list .iv-comment-image {
	padding: 0;
	background: none;
	border: 0;
	border-radius: 8px;
	line-height: 0;
}
