/**
 * GS Product Reviews — Frontend styles
 * Matches design reference exactly
 */

/* ==========================================================================
   Block wrapper
   ========================================================================== */

.gs-reviews-block {
	max-width: 1100px;
	margin: 60px auto;
	padding: 0 20px;
	font-family: inherit;
	color: #2b2b2b;
	font-size: 14px;
}

/* ==========================================================================
   Summary header
   ========================================================================== */

.gs-reviews-summary {
	text-align: center;
	margin-bottom: 32px;
}

.gs-reviews-summary-label {
	font-size: 23px;
	letter-spacing: 0.05em;
	color: #2b2b2b;
	margin: 0 0 14px;
	font-weight: 400;
}

.gs-reviews-summary-percent {
	font-size: 52px;
	font-weight: 300;
	margin: 0;
	line-height: 1;
	color: #2b2b2b;
}

.gs-reviews-summary-recommend {
	font-size: 14px;
	color: #2b2b2b;
	margin: 6px 0 12px;
	font-weight: 400;
}

.gs-reviews-summary-stars {
	margin: 0 0 20px;
}

/* Stars shared */
.gs-review-stars {
	display: inline-flex;
	gap: 1px;
}

.gs-star {
	font-size: 18px;
	line-height: 1;
	color: #2b2b2b;
}

.gs-star--empty {
	color: #d0d0d0;
}

.gs-star--half {
	color: #2b2b2b;
}

.gs-reviews-summary-stars .gs-star {
	font-size: 22px;
}

/* Write a Review button */
.gs-reviews-write-btn {
	display: inline-block;
	background: #1a1a1a;
	color: #fff;
	border: none;
	cursor: pointer;
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	padding: 0px 10px 10px 10px;
	font-family: inherit;
	font-weight: 400;
	transition: background 0.2s;
    width: 50%;
}

.gs-reviews-write-btn:hover {
	background: #000;
}

/* ==========================================================================
   Review form
   ========================================================================== */

.gs-review-toggle-container {
	border: 1px solid #e4e4e4;
	background: #fff;
	padding: 28px 30px;
	margin-bottom: 30px;
	max-width: 660px;
	margin-left: auto;
	margin-right: auto;
}

.gs-form-heading {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 20px;
	padding-bottom: 12px;
	border-bottom: 1px solid #eee;
}

.gs-review-form .gs-form-group {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 16px;
}

.gs-review-form .gs-form-group label {
	width: 200px;
	flex-shrink: 0;
	font-size: 13px;
	font-weight: 600;
	color: #333;
	padding-top: 10px;
	text-transform: none;
}

.gs-review-form input[type="text"],
.gs-review-form select,
.gs-review-form textarea {
	flex: 1;
	padding: 9px 12px;
	border: 1px solid #ccc;
	border-radius: 0;
	outline: none;
	font-size: 14px;
	font-family: inherit;
	color: #2b2b2b;
	background: #fff;
	box-sizing: border-box;
}

.gs-review-form select {
	height: 40px;
	cursor: pointer;
}

.gs-review-form textarea {
	resize: vertical;
	min-height: 110px;
}

.gs-review-form input[type="text"]:focus,
.gs-review-form select:focus,
.gs-review-form textarea:focus {
	border-color: #999;
}

.gs-review-photos-wrap {
	flex-direction: column;
	align-items: flex-start;
}

.gs-review-photos-wrap label {
	padding-top: 0 !important;
	margin-bottom: 8px;
	width: auto !important;
}

.gs-review-photos-input {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
}

.gs-review-photos-btn {
	background: #fff;
	color: #4361ee;
	border: 1px solid #4361ee;
	padding: 8px 18px;
	font-size: 13px;
	cursor: pointer;
	font-family: inherit;
	font-weight: 500;
	transition: background 0.15s;
}

.gs-review-photos-btn:hover {
	background: #f0f3ff;
}

.gs-review-photos-preview {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.gs-review-photo-wrap {
	position: relative;
	width: 70px;
	height: 70px;
	overflow: hidden;
	border: 1px solid #ddd;
}

.gs-review-photo-thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gs-review-photo-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 18px;
	height: 18px;
	background: rgba(0,0,0,0.55);
	color: #fff;
	border: none;
	font-size: 11px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.15s;
}

.gs-review-photo-remove:hover {
	background: rgba(0,0,0,0.85);
}

.gs-frontend-form-message {
	font-size: 13px;
	margin: 0 0 14px;
	font-weight: 600;
}

.gs-frontend-form-message.success { color: #1a7f37; }
.gs-frontend-form-message.error   { color: #b32d2e; }

.gs-reviews-submit-btn {
	background: #2f54eb;
	color: #fff;
	border: none;
	padding: 13px 36px;
	font-size: 13px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.2s;
}

.gs-reviews-submit-btn:hover { background: #1e40c5; }

.gs-reviews-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.gs-login-prompt {
	text-align: center;
	padding: 20px 0;
	font-size: 15px;
	color: #333;
}

.gs-login-prompt a {
	color: #2f54eb;
	text-decoration: underline;
	margin-left: 6px;
}

/* ==========================================================================
   Toolbar — search left with underline, filter absolute top-right
   ========================================================================== */

.gs-reviews-toolbar {
	position: relative;
	padding-right: 58px; /* space for the filter box */
	margin-bottom: 28px;
}

/* Search — full width of toolbar minus the right padding, bottom border only */
.gs-reviews-search {
	display: flex;
	align-items: center;
	border-bottom: 1px solid #ccc;
    width: 50%;
}

.gs-reviews-search-input {
	flex: 1;
	border: none;
	background: transparent;
	font-size: 14px;
	padding: 10px 0;
	outline: none;
	color: #2b2b2b;
	font-family: inherit;
}

.gs-reviews-search-input::placeholder {
	color: #bbb;
}

.gs-reviews-search-btn {
	flex-shrink: 0;
	background: none;
	border: none;
	cursor: pointer;
	color: #555;
	padding: 0 0 0 8px;
	display: flex;
	align-items: center;
	line-height: 0;
}

/* Filter — absolute top-right, fully independent */
.gs-reviews-filter-wrap {
	position: absolute;
	top: 0;
	right: 0;
}

.gs-reviews-filter-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: #2b2b2b;
	padding: 0;
	display: block;
	line-height: 0;
}

.gs-reviews-filter-icon-box {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid #bbb;
	transition: border-color 0.15s;
}

.gs-reviews-filter-btn:hover .gs-reviews-filter-icon-box {
	border-color: #555;
}

/* Filter dropdown panel */
.gs-reviews-filter-panel {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 200;
	background: #fff;
	border: 1px solid #d0d0d0;
	min-width: 210px;
	padding: 14px 16px 12px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.gs-reviews-filter-panel.is-open {
	display: block;
}

.gs-filter-panel-title {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #666;
	margin: 0 0 10px;
}

.gs-filter-option {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 5px 0;
	cursor: pointer;
	font-size: 14px;
	color: #2b2b2b;
	user-select: none;
}

.gs-filter-option input[type="checkbox"] {
	width: 15px;
	height: 15px;
	margin: 0;
	cursor: pointer;
	accent-color: #2b2b2b;
	flex-shrink: 0;
}

.gs-filter-clear {
	display: block;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #eee;
	border-left: none;
	border-right: none;
	border-bottom: none;
	font-size: 12px;
	color: #999;
	cursor: pointer;
	background: none;
	width: 100%;
	text-align: left;
	font-family: inherit;
	padding-left: 0;
	padding-bottom: 0;
	transition: color 0.15s;
}

.gs-filter-clear:hover {
	color: #2b2b2b;
}

/* Hide filter on mobile, search goes full width */
@media (max-width: 700px) {
	.gs-reviews-toolbar {
		padding-right: 0;
	}
	.gs-reviews-filter-wrap {
		display: none;
	}
}

/* ==========================================================================
   Reviews grid — 2 columns
   ========================================================================== */

.gs-reviews-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 60px;
	row-gap: 0;
}

/* ==========================================================================
   Single review item — matches Image 2 exactly
   ========================================================================== */

.gs-review-item {
	padding: 24px 0 0;
	position: relative;
}

/* Top row: meta (left) + gallery (right) */
.gs-review-item-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 0;
}

.gs-review-item-meta {
	flex: 1;
	min-width: 0;
}

.gs-review-item-name {
	font-weight: 700;
	font-size: 15px;
	color: #000;
	margin: 0 0 4px !important;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.gs-review-item-field {
	margin: 0 0 2px !important;
	font-size: 14px;
	color: #2b2b2b;
	line-height: 1.45;
}

.gs-review-item-field strong {
	font-weight: 700;
	color: #000;
}

/* Gallery thumbnails — top-right corner */
.gs-review-item-gallery {
	display: flex;
	gap: 4px;
	flex-shrink: 0;
	align-items: flex-start;
}

.gs-review-thumb {
	position: relative;
	width: 68px;
	height: 68px;
	overflow: hidden;
	display: block;
	cursor: pointer;
	flex-shrink: 0;
}

.gs-review-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gs-review-thumb-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.38);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

/* Stars — centered, below meta */
.gs-review-item-stars {
	text-align: center;
	margin: 14px 0 10px;
}

.gs-review-item-stars .gs-star {
	font-size: 17px;
}

/* Review text */
.gs-review-item-content {
	font-size: 14px;
	line-height: 1.65;
	color: #2b2b2b !important;
	margin: 0 !important;
}

.gs-review-item-content a,
.gs-review-item-content span,
.gs-review-item-content * {
	color: inherit !important;
}

/* Force meta field values to dark color, override theme link/color styles */
.gs-review-item-field,
.gs-review-item-field * {
	color: #2b2b2b !important;
}

.gs-review-item-name {
	color: #000 !important;
}

/* Divider */
.gs-review-item-divider {
	border: none;
	border-top: 1px solid #e4e4e4;
	margin: 22px 0 0 !important;
}

.gs-reviews-no-results {
	grid-column: 1 / -1;
	text-align: center;
	color: #777;
	padding: 30px 0;
}

/* ==========================================================================
   Load More
   ========================================================================== */

.gs-reviews-load-more-wrap {
	text-align: center;
	margin-top: 32px;
}

.gs-reviews-load-more-btn {
	background: #fff;
	color: #2b2b2b;
	border: 1px solid #2b2b2b;
	cursor: pointer;
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	padding: 0px 10px 10px 10px;
	font-family: inherit;
	font-weight: 400;
	transition: background 0.2s, color 0.2s;
    width: 50%;
}

.gs-reviews-load-more-btn:hover {
	background: #2b2b2b;
	color: #fff;
}

.gs-reviews-load-more-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.gs-reviews-load-spinner {
	display: none;
	width: 18px;
	height: 18px;
	margin: 0 auto 12px;
	border: 2px solid #ddd;
	border-top-color: #2b2b2b;
	border-radius: 50%;
	animation: gs-spin 0.7s linear infinite;
}

.gs-reviews-load-spinner.is-active {
	display: block;
}

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

/* Fade-in for newly loaded items */
.gs-review-item--new {
	animation: gs-fade-in 0.3s ease;
}

@keyframes gs-fade-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.gs-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0,0,0,0.92);
	align-items: center;
	justify-content: center;
}

.gs-lightbox.is-open { display: flex; }

.gs-lightbox-inner {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.gs-lightbox-img {
	max-width: 90vw;
	max-height: 85vh;
	object-fit: contain;
	display: block;
	box-shadow: 0 4px 40px rgba(0,0,0,0.5);
	transition: opacity 0.2s;
}

.gs-lightbox-img.is-loading { opacity: 0.25; }

.gs-lightbox-close {
	position: fixed;
	top: 16px;
	right: 20px;
	background: none;
	border: none;
	color: #fff;
	font-size: 38px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	z-index: 10;
	opacity: 0.8;
	transition: opacity 0.15s;
	font-family: Arial, sans-serif;
}

.gs-lightbox-close:hover { opacity: 1; }

.gs-lightbox-prev,
.gs-lightbox-next {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255,255,255,0.1);
	border: none;
	color: #fff;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	padding: 18px 14px;
	z-index: 10;
	opacity: 0.8;
	transition: background 0.15s, opacity 0.15s;
}

.gs-lightbox-prev:hover,
.gs-lightbox-next:hover {
	background: rgba(255,255,255,0.22);
	opacity: 1;
}

.gs-lightbox-prev { left: 12px; }
.gs-lightbox-next { right: 12px; }

.gs-lightbox-prev.is-hidden,
.gs-lightbox-next.is-hidden { display: none; }

.gs-lightbox-counter {
	position: fixed;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255,255,255,0.6);
	font-size: 13px;
	pointer-events: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
	.gs-reviews-list { column-gap: 36px; }
}

@media (max-width: 700px) {
	.gs-reviews-block { margin: 40px auto; }
	.gs-reviews-summary-percent { font-size: 40px; }
	.gs-reviews-list { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
	.gs-review-item-header { flex-direction: column; gap: 12px; }
	.gs-review-item-gallery { margin-left: 0; }
	.gs-review-form .gs-form-group { flex-direction: column; gap: 6px; }
	.gs-review-form .gs-form-group label { width: auto !important; padding-top: 0 !important; }
}

@media (max-width: 420px) {
	.gs-reviews-write-btn,
	.gs-reviews-load-more-btn { width: 100%; }
}
/* ==========================================================================
   WooCommerce rating override — make WC stars look like GS review stars
   ========================================================================== */

.gs-wc-rating {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.gs-wc-rating .star-rating {
	display: inline-flex;
	gap: 1px;
}

/* Our gs-star elements inside WC rating wrapper */
.gs-wc-rating .gs-star {
	font-size: 16px;
	color: #2b2b2b;
}

.gs-wc-rating .gs-star--empty {
	color: #d0d0d0;
}
