/**
 * Product reviews — slide-out form + reviews list.
 * Lives inside the shared .sf-sidepanel drawer.
 */

/* The native WooCommerce rating under the title is replaced by our own
   clickable block (which also works at zero reviews and opens the panel). */
.summary .woocommerce-product-rating {
	display: none;
}

/* Rating + "write a review" trigger. Hidden until JS relocates it directly
   under the product title (the summary is a plain block, so it is moved in
   the DOM rather than reordered with flex). The review flow needs JS anyway
   to open the panel, so hiding until placed avoids a position flash. */
.sf-review-rating-trigger {
	align-items: center;
	gap: 12px;
	margin: 4px 0 14px;
	display: none;
}

.sf-review-rating-trigger.is-placed {
	display: flex;
}

/* Read-only star display (filled overlay technique). Slightly larger than
   the MBM reference. */
.sf-stars {
	position: relative;
	display: inline-block;
	white-space: nowrap;
	font-size: 22px;
	line-height: 1;
	letter-spacing: 3px;
}

.sf-stars-empty {
	/* Fixed light gray — the theme palette colors are dark on this site. */
	color: #d8d2c8;
}

.sf-stars-filled {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	color: #e8a93a;
}

/* Plain text link (no button), a touch larger than the MBM reference. */
.sf-review-write-link {
	font-size: 16px;
	line-height: 1.2;
	color: var(--theme-palette-color-4, #6f6357);
	text-decoration: none;
	cursor: pointer;
	transition: color 0.2s ease;
}

.sf-review-write-link:hover {
	color: var(--theme-palette-color-1, #232323);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------------- Form ---------------- */
.sf-review-form-wrap {
	margin-bottom: 28px;
}

.sf-review-notice {
	margin: 0 0 8px;
	padding: 14px 16px;
	font-size: 14px;
	line-height: 1.5;
	background: var(--theme-palette-color-7, #f2efea);
	border-radius: 4px;
}

.sf-review-form-title {
	margin: 0 0 12px;
	font-size: 18px;
}

.sf-review-label {
	display: block;
	margin: 16px 0 6px;
	font-size: 13px;
	font-weight: 600;
}

.sf-review-form textarea {
	width: 100%;
	padding: 10px 12px;
	font: inherit;
	font-size: 14px;
	border: 1px solid var(--theme-palette-color-3, #cfc4b4);
	border-radius: 4px;
	resize: vertical;
	box-sizing: border-box;
}

.sf-review-form input[type="file"] {
	display: block;
	width: 100%;
	font-size: 13px;
}

/* ---------------- Star input ---------------- */
.sf-review-stars {
	display: inline-flex;
	gap: 4px;
	direction: ltr;
}

.sf-review-star {
	padding: 0;
	font-size: 30px;
	line-height: 1;
	color: #d8d2c8;
	background: none;
	border: 0;
	cursor: pointer;
	transition: color 0.15s ease;
}

.sf-review-star.is-active {
	color: #e8a93a;
}

/* ---------------- Photo previews ---------------- */
.sf-review-photo-preview {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.sf-review-photo-thumb {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid var(--theme-palette-color-3, #cfc4b4);
}

/* ---------------- Submit + status ---------------- */
.sf-review-submit {
	margin-top: 18px;
	padding: 12px 28px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	background: var(--theme-palette-color-1, #232323);
	border: 0;
	border-radius: 4px;
	cursor: pointer;
}

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

.sf-review-status {
	margin: 12px 0 0;
	font-size: 14px;
	line-height: 1.5;
	min-height: 1em;
}

.sf-review-status.is-success {
	color: #2e7d32;
}

.sf-review-status.is-error {
	color: #c0392b;
}

/* ---------------- Reviews list ---------------- */
.sf-reviews-list {
	border-top: 1px solid var(--theme-palette-color-3, #e3dccf);
	padding-top: 20px;
}

.sf-reviews-list-title {
	margin: 0 0 16px;
	font-size: 18px;
}

.sf-reviews-empty {
	font-size: 14px;
	color: var(--theme-palette-color-4, #7a7065);
}

.sf-review-item {
	padding: 16px 0;
	border-bottom: 1px solid var(--theme-palette-color-7, #ece7df);
}

.sf-review-item-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 4px;
}

.sf-review-author {
	font-weight: 600;
	font-size: 14px;
}

.sf-review-verified {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #2e7d32;
	background: rgba(46, 125, 50, 0.1);
	padding: 2px 8px;
	border-radius: 3px;
}

.sf-review-rating {
	margin-bottom: 6px;
	font-size: 16px;
	letter-spacing: 1px;
}

.sf-review-rating .sf-star.is-filled,
.sf-review-photos + .sf-review-date {
	color: inherit;
}

.sf-star.is-filled {
	color: #e8a93a;
}

.sf-star.is-empty {
	color: #d8d2c8;
}

.sf-review-text {
	font-size: 14px;
	line-height: 1.55;
}

.sf-review-text p {
	margin: 0 0 8px;
}

.sf-review-photos {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 8px 0;
}

.sf-review-photos img,
.sf-review-photo {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid var(--theme-palette-color-3, #cfc4b4);
}

.sf-review-photo-link {
	display: inline-flex;
	cursor: zoom-in;
}

.sf-review-date {
	margin-top: 4px;
	font-size: 12px;
	color: var(--theme-palette-color-4, #9a9085);
}

/* ---------------- Photo lightbox (gallery slider) ---------------- */
.sf-review-lightbox {
	position: fixed;
	inset: 0;
	z-index: 1000000; /* above the side panel (999999) */
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
}

.sf-review-lightbox.is-open {
	display: flex;
}

.sf-lb-stage {
	margin: 0;
	max-width: 90vw;
	max-height: 85vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sf-lb-img {
	max-width: 90vw;
	max-height: 85vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 4px;
}

.sf-lb-close {
	position: absolute;
	top: 16px;
	right: 20px;
	width: 44px;
	height: 44px;
	font-size: 34px;
	line-height: 1;
	color: #fff;
	background: none;
	border: 0;
	cursor: pointer;
}

.sf-lb-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	font-size: 40px;
	line-height: 1;
	color: #fff;
	background: rgba(0, 0, 0, 0.35);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sf-lb-prev {
	left: 16px;
}

.sf-lb-next {
	right: 16px;
}

.sf-lb-nav[hidden] {
	display: none;
}

.sf-lb-counter {
	position: absolute;
	bottom: 18px;
	left: 0;
	right: 0;
	text-align: center;
	font-size: 14px;
	color: #fff;
}

@media (max-width: 600px) {
	.sf-lb-nav {
		width: 44px;
		height: 44px;
		font-size: 32px;
	}
}
