/* ==========================================================================
   Teddypost Personalizer UX — custom product reviews section
   Replaces the native WooCommerce review list: no avatar gutter, tight
   spacing, 1 or 2 columns, photo thumbnails + lightbox.
   ========================================================================== */

.tpux-reviews {
	--tp-brand: #4cb5b2;
	--tp-brand-soft: rgba(76, 181, 178, 0.16);
	--tp-ink: #1f2933;
	--tp-muted: #6b7280;
	--tp-line: #e3e8ee;
	--tp-star: #f5a623;
	--tp-radius: 12px;
	margin: 0 0 2em;
}

/* --------------------------------------------------------------------------
   Header: count + average + photo toggle
   -------------------------------------------------------------------------- */

.tpux-reviews-head {
	padding-bottom: 0.9em;
	border-bottom: 2px solid var(--tp-line);
}

/* Typography (size, weight, color, font) deliberately unset: the heading
   inherits the theme's own h2 styling so it matches the rest of the page. */
.tpux-reviews-title {
	margin: 0 0 0.35em;
}

.tpux-reviews-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4em 0.6em;
}

.tpux-reviews-average {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
}

.tpux-average-number {
	font-weight: 700;
	color: var(--tp-ink);
}

.tpux-reviews-count {
	color: var(--tp-muted);
	font-size: calc(1em - 2px);
}

.tpux-photos-toggle {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	font-size: 0.92em;
	color: var(--tp-muted);
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
}

.tpux-photos-toggle input {
	accent-color: var(--tp-brand);
	margin: 0;
}

/* --------------------------------------------------------------------------
   Stars: background row + width-clipped filled row (supports 4.9 etc.)
   -------------------------------------------------------------------------- */

.tpux-stars {
	position: relative;
	display: inline-block;
	font-size: 1.3em;
	line-height: 1;
	letter-spacing: 0.06em;
}

.tpux-stars-bg {
	color: #d8dee6;
}

.tpux-stars-fill {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	white-space: nowrap;
	color: var(--tp-star);
}

/* --------------------------------------------------------------------------
   Review list: 1 or 2 columns, no avatar gutter, tight dividers
   -------------------------------------------------------------------------- */

.tpux-review-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	column-gap: 2.5em;
}

.tpux-reviews[data-columns="2"] .tpux-review-list {
	grid-template-columns: 1fr 1fr;
}

@media (max-width: 767px) {
	.tpux-reviews[data-columns="2"] .tpux-review-list {
		grid-template-columns: 1fr;
	}
}

.tpux-review {
	margin: 0;
	padding: 0.9em 0;
	border-bottom: 1px solid var(--tp-line);
}

.tpux-review-top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1em;
	flex-wrap: wrap;
}

.tpux-review-byline {
	display: flex;
	align-items: baseline;
	gap: 0.6em;
	flex-wrap: wrap;
}

.tpux-review-author {
	font-weight: 700;
	color: var(--tp-ink);
}

.tpux-review-date {
	font-size: 0.85em;
	color: var(--tp-muted);
}

.tpux-verified {
	font-size: 0.72em;
	font-weight: 600;
	letter-spacing: 0.03em;
	color: #227976;
	background: var(--tp-brand-soft);
	border-radius: 999px;
	padding: 0.2em 0.7em;
	white-space: nowrap;
}

.tpux-review-text {
	margin-top: 0.35em;
	color: var(--tp-ink);
}

.tpux-review-text p {
	margin: 0 0 0.5em;
}

.tpux-review-text p:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Customer photos
   -------------------------------------------------------------------------- */

.tpux-review-photos {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin-top: 0.6em;
}

.tpux-photo {
	padding: 0;
	border: 1px solid var(--tp-line);
	border-radius: 8px;
	overflow: hidden;
	background: none;
	cursor: zoom-in;
	line-height: 0;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tpux-photo:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(31, 41, 51, 0.12);
}

.tpux-photo img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	display: block;
	max-width: none;
}

/* --------------------------------------------------------------------------
   Load more
   -------------------------------------------------------------------------- */

.tpux-load-more-wrap {
	text-align: center;
	padding-top: 1.4em;
}

.tpux-load-more {
	display: inline-block;
	background: var(--tp-brand);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 0.7em 2.2em;
	font-weight: 600;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.tpux-load-more:hover {
	filter: brightness(0.94);
}

.tpux-load-more:disabled {
	opacity: 0.6;
	cursor: default;
}

.tpux-reviews-empty {
	padding: 1.2em 0;
	color: var(--tp-muted);
}

.tpux-reviews-invite {
	margin: 1.2em 0 0;
	font-size: 0.88em;
	color: var(--tp-muted);
	text-align: center;
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */

.tpux-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(15, 20, 26, 0.82);
	padding: 2.5em 1em 1em;
}

.tpux-lightbox[hidden] {
	display: none;
}

.tpux-lightbox img {
	max-width: min(92vw, 900px);
	max-height: 86vh;
	border-radius: 10px;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.tpux-lightbox-close {
	position: absolute;
	top: 0.6em;
	right: 0.8em;
	background: none;
	border: 0;
	color: #fff;
	font-size: 2em;
	line-height: 1;
	cursor: pointer;
	padding: 0.2em;
}

.tpux-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.14);
	border: 0;
	color: #fff;
	font-size: 1.6em;
	line-height: 1;
	border-radius: 999px;
	width: 1.8em;
	height: 1.8em;
	cursor: pointer;
}

.tpux-lightbox-nav:hover {
	background: rgba(255, 255, 255, 0.28);
}

.tpux-lightbox-prev {
	left: 0.6em;
}

.tpux-lightbox-next {
	right: 0.6em;
}

.tpux-lightbox-nav[hidden] {
	display: none;
}

/* --------------------------------------------------------------------------
   Kill any native Woo review leftovers a theme might print around the tab
   -------------------------------------------------------------------------- */

.single-product #review_form_wrapper,
.single-product #review_form,
.single-product #reviews #respond {
	display: none !important;
}
