/**
 * CTPS - Widget Avis WooCommerce
 * Styles frontend
 */

/* ═══════════════════════════════════════════
   Wrapper global
═══════════════════════════════════════════ */
.ctps-reviews-widget {
	width: 100%;
}

.ctps-no-reviews {
	text-align: center;
	color: #999;
	font-style: italic;
}

/* ═══════════════════════════════════════════
   Grilles & listes
═══════════════════════════════════════════ */
.ctps-reviews-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

.ctps-reviews-list {
	display: flex;
	flex-direction: column;
}

.ctps-reviews-masonry {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	align-items: start;
}

/* ═══════════════════════════════════════════
   Carte d'avis
═══════════════════════════════════════════ */
.ctps-review-card {
	background: #ffffff;
	border-radius: 12px;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	height: 100%;
	box-sizing: border-box;
}

.ctps-review-card:hover {
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.13);
	transform: translateY(-2px);
}

/* ═══════════════════════════════════════════
   Info produit (image + nom)
═══════════════════════════════════════════ */
.ctps-review-product-info {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.ctps-review-product-img img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 8px;
	display: block;
}

.ctps-review-product-name {
	margin: 0;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.3;
}

.ctps-review-product-name a {
	text-decoration: none;
	color: inherit;
}

.ctps-review-product-name a:hover {
	text-decoration: underline;
}

/* ═══════════════════════════════════════════
   Étoiles
═══════════════════════════════════════════ */
.ctps-stars {
	display: inline-flex;
	gap: 2px;
	font-size: 16px;
	line-height: 1;
}

.ctps-star {
	display: inline-block;
}

.ctps-star-filled {
	color: #f5a623;
}

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

/* ═══════════════════════════════════════════
   Titre de l'avis
═══════════════════════════════════════════ */
.ctps-review-title {
	margin: 0;
	font-size: 1em;
	font-weight: 700;
	line-height: 1.4;
	color: #1a1a1a;
}

/* ═══════════════════════════════════════════
   Contenu de l'avis
═══════════════════════════════════════════ */
.ctps-review-content {
	font-size: 0.9em;
	line-height: 1.6;
	color: #555;
	flex-grow: 1;
	word-break: break-word;
}

/* ═══════════════════════════════════════════
   Bouton "Lire la suite"
═══════════════════════════════════════════ */
.ctps-read-more {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	font-size: inherit;
	color: #0066cc;
	text-decoration: underline;
	font-family: inherit;
	line-height: inherit;
	display: inline;
}

.ctps-read-more:hover {
	color: #004499;
}

/* ═══════════════════════════════════════════
   Footer : avatar + méta
═══════════════════════════════════════════ */
.ctps-review-footer {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.ctps-review-avatar img {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	flex-shrink: 0;
}

.ctps-review-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ctps-review-author {
	font-weight: 600;
	font-size: 0.88em;
	color: #1a1a1a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ctps-review-date {
	font-size: 0.78em;
	color: #999;
}

/* ═══════════════════════════════════════════
   Badge "Achat vérifié"
═══════════════════════════════════════════ */
.ctps-verified-badge {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	background-color: #27ae60;
	color: #ffffff;
	font-size: 0.72em;
	font-weight: 600;
	padding: 2px 7px;
	border-radius: 4px;
	line-height: 1.5;
	white-space: nowrap;
	margin-top: 2px;
	width: fit-content;
}

/* ═══════════════════════════════════════════
   Responsive
═══════════════════════════════════════════ */
@media (max-width: 1024px) {
	.ctps-reviews-grid,
	.ctps-reviews-masonry {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	.ctps-reviews-grid,
	.ctps-reviews-masonry {
		grid-template-columns: 1fr;
	}

	.ctps-review-card {
		padding: 18px;
	}
}
