/**
 * RS Reviews Public Styles
 * Version: 2.0.6
 */

:root {
	--rs-gap: 20px;
	--rs-radius: 12px;
	--rs-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
	--rs-bg: #ffffff;
	--rs-text: #374151;
	--rs-text-mute: #9ca3af;
	--rs-border: #f3f4f6;
	
	/* Brand Colors */
	--rs-google: #4285f4;
	--rs-trustpilot: #00b67a;
	--rs-local: #6b7280;
}

.rs-reviews-wrapper-block {
	position: relative;
	max-width: 100%;
	overflow-x: hidden; /* Prevent horizontal scrollbar */
}

/* --- Global Branding Header --- */
.rs-carousel-branding {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px;
	margin-bottom: 20px;
	background: #fff;
	border-radius: var(--rs-radius);
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
	border-left: 5px solid transparent;
}

.rs-carousel-branding.source-google { border-left-color: var(--rs-google); color: var(--rs-google); }
.rs-carousel-branding.source-trustpilot { border-left-color: var(--rs-trustpilot); color: var(--rs-trustpilot); }
.rs-carousel-branding.source-local { border-left-color: var(--rs-local); color: var(--rs-local); }

/* Left Side (Logo + Text) */
.rs-branding-left {
	display: flex;
	align-items: center;
}

.rs-carousel-branding .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
	margin-right: 8px;
}
.rs-brand-text {
	font-weight: 700;
	font-size: 1.1em;
	color: #1f2937;
}

/* Styling for "Reviews" suffix */
.rs-brand-suffix {
	opacity: 0.85;
	font-weight: 400;
}

/* Right Side (Rating + Stars) */
.rs-branding-rating {
	display: flex;
	align-items: center;
	gap: 8px;
}

.rs-numeric-rating {
	font-weight: 700;
	font-size: 1.1em;
	color: #1f2937;
}

/* --- Container --- */
.rs-reviews-feed {
	box-sizing: border-box;
	width: 100%;
	display: flex;
	gap: var(--rs-gap);
}

/* --- Layout: Complex List --- */
.rs-reviews-feed.layout-list {
	flex-direction: column;
}

.rs-reviews-feed.layout-list .rs-review-card {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	padding: 24px;
	border-left-width: 5px; /* Colored accent */
}

.rs-reviews-feed.layout-list .rs-card-left {
	flex: 0 0 60px;
	margin-right: 20px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.rs-reviews-feed.layout-list .rs-card-content {
	flex-grow: 1;
}

/* List View Mobile: Stack avatar */
@media (max-width: 480px) {
	.rs-reviews-feed.layout-list .rs-review-card {
		flex-direction: column;
		padding: 15px;
	}
	.rs-reviews-feed.layout-list .rs-card-left {
		flex-direction: row;
		margin-right: 0;
		margin-bottom: 15px;
		width: 100%;
		justify-content: flex-start;
	}
	.rs-reviews-feed.layout-list .rs-card-left .rs-source-badge {
		margin-left: auto;
	}
}

/* --- Layout: Carousel --- */
.rs-reviews-feed.layout-carousel {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	
    /* FIX: Physical padding ensures space exists at start/end of track */
	padding: 0 60px 20px 60px;
    
    /* FIX: Scroll padding ensures SNAP points respect the arrows (Cards stop 60px from edge) */
    scroll-padding-left: 60px;
    scroll-padding-right: 60px;

	scrollbar-width: none;
	-ms-overflow-style: none;
	cursor: grab;
	scroll-behavior: smooth;
	align-items: stretch;
}
.rs-reviews-feed.layout-carousel::-webkit-scrollbar { 
    display: none; 
}

.rs-reviews-feed.layout-carousel.active {
	cursor: grabbing;
	scroll-snap-type: none;
	scroll-behavior: auto;
}

/* Carousel Item Sizing */
.rs-reviews-feed.layout-carousel .rs-review-card {
	flex: 0 0 85%;
	scroll-snap-align: center;
	display: flex;
	flex-direction: column;
	border-top: 4px solid transparent; 
	min-height: 280px; 
}

@media (min-width: 600px) {
	.rs-reviews-feed.layout-carousel .rs-review-card {
		flex: 0 0 calc((100% - var(--rs-gap)) / 2);
		scroll-snap-align: start;
	}
}

@media (min-width: 992px) {
	.rs-reviews-feed.layout-carousel .rs-review-card {
		flex: 0 0 calc((100% - (var(--rs-gap) * 2)) / 3);
		scroll-snap-align: start;
	}
}

/* --- Card Base Design --- */
.rs-review-card {
	background: var(--rs-bg);
	border-radius: var(--rs-radius);
	box-shadow: var(--rs-shadow);
	border: 1px solid var(--rs-border);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	position: relative;
	overflow: hidden;
}

.rs-review-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Source Accents */
.rs-review-card.source-google { border-color: var(--rs-google); border-width: 0 0 0 4px; }
.rs-review-card.source-trustpilot { border-color: var(--rs-trustpilot); border-width: 0 0 0 4px; }
.rs-review-card.source-local { border-color: var(--rs-local); border-width: 0 0 0 4px; }

/* Carousel: Top Accent */
.rs-reviews-feed.layout-carousel .rs-review-card {
	border-width: 4px 0 0 0;
	padding: 20px;
}

/* Carousel Header Row */
.rs-reviews-feed.layout-carousel .rs-card-left {
	display: flex;
	flex-direction: row;
	align-items: center; 
	gap: 12px;
	margin-bottom: 8px;
	width: 100%;
}

/* Elements */
.rs-avatar img, .rs-avatar-placeholder {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.rs-avatar-placeholder {
	background: #e5e7eb;
	color: #6b7280;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 20px;
}

/* New: Silhouette Styles */
.rs-silhouette {
	background: #e5e7eb;
	color: #9ca3af;
}
.rs-silhouette svg {
	width: 28px;
	height: 28px;
	display: block;
}

.rs-source-badge .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}
.source-google .rs-source-badge { color: var(--rs-google); }
.source-trustpilot .rs-source-badge { color: var(--rs-trustpilot); }

/* Header for Content */
.rs-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	flex-wrap: wrap;
	width: 100%;
}

.rs-author-name {
	font-size: 1.1em;
	color: #111827;
}

.rs-stars {
	color: #f59e0b;
	letter-spacing: 2px;
	font-size: 0.9em;
}

.rs-review-body {
	font-size: 0.95em;
	line-height: 1.6;
	color: var(--rs-text);
	margin-bottom: 12px;
	flex-grow: 1;
	
	/* Line Clamping */
	display: -webkit-box;
	-webkit-line-clamp: 6;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rs-review-footer {
	font-size: 0.8em;
	color: var(--rs-text-mute);
	border-top: 1px solid #f3f4f6;
	padding-top: 10px;
	margin-top: auto;
	width: 100%;
}

/* --- Carousel Controls --- */
.rs-carousel-arrow {
	position: absolute;
	top: 50%;
	margin-top: 20px; 
	transform: translateY(-50%);
	background: #fff;
	border: 1px solid #e5e7eb;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	cursor: pointer;
	z-index: 10;
	font-size: 24px;
	line-height: 1;
	color: #374151;
	box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-bottom: 4px;
}
.rs-reviews-wrapper-block.has-global-branding .rs-carousel-arrow {
    top: 60%; 
}

.rs-carousel-arrow:hover {
	background: #f9fafb;
	color: #000;
	border-color: #d1d5db;
}

/* Arrows inside container */
.rs-prev { left: 10px; } 
.rs-next { right: 10px; }

@media (max-width: 768px) {
	.rs-prev { left: 5px; }
	.rs-next { right: 5px; }
    
    .rs-reviews-feed.layout-carousel {
        padding-left: 50px;
        padding-right: 50px;
        /* Ensure scroll padding matches on mobile */
        scroll-padding-left: 50px;
        scroll-padding-right: 50px;
    }
}

.rs-reviews-empty {
	text-align: center;
	padding: 30px;
	color: #6b7280;
}