/*
 * VisualProof — Widget Styles
 * BEM naming with vp- prefix. CSS custom properties for theming.
 */

/* ── Global custom properties ── */
:root {
	--vp-primary:    #FF6B35;
	--vp-star-color: #FFC107;
	--vp-bg:         #FFFFFF;
	--vp-text:       #1A1A1A;
	--vp-radius:     8px;
	--vp-shadow:     0 2px 8px rgba(0, 0, 0, .08);
}

/* ── Base widget ── */
.vp-widget {
	font-family: inherit;
	color: var(--vp-text);
	background: var(--vp-bg);
	box-sizing: border-box;
}

.vp-widget *,
.vp-widget *::before,
.vp-widget *::after {
	box-sizing: inherit;
}

.vp-widget__empty {
	color: #888;
	font-style: italic;
	padding: 16px 0;
}

/* ── Stars ── */
.vp-stars {
	display: inline-flex;
	font-size: 1rem;
	line-height: 1;
	gap: 1px;
}

.vp-star--full  { color: var(--vp-star-color); }
.vp-star--empty { color: #ddd; }

/* ── Review card ── */
.vp-widget__card {
	background: var(--vp-bg);
	border-radius: var(--vp-radius);
	box-shadow: var(--vp-shadow);
	padding: 16px;
}

.vp-widget__card-header {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin-bottom: 10px;
}

.vp-widget__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--vp-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: .95rem;
	flex-shrink: 0;
	line-height: 1;
}

.vp-widget__reviewer-meta {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.vp-widget__reviewer-name {
	font-weight: 600;
	font-size: .9rem;
}

.vp-widget__verified {
	color: #28a745;
	font-size: .75rem;
	margin-left: 4px;
}

.vp-widget__date {
	font-size: .75rem;
	color: #888;
}

.vp-widget__review-title {
	font-weight: 600;
	margin: 0 0 6px;
	font-size: .95rem;
}

.vp-widget__review-body {
	margin: 0;
	line-height: 1.6;
	font-size: .9rem;
}

.vp-widget__media {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.vp-widget__thumb {
	width: 70px;
	height: 70px;
	object-fit: cover;
	border-radius: calc(var(--vp-radius) / 2);
	cursor: pointer;
	display: block;
}

.vp-widget__video-thumb {
	width: 70px;
	height: 70px;
	background: #1a1a1a;
	border-radius: calc(var(--vp-radius) / 2);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	cursor: pointer;
	flex-shrink: 0;
}

/* ── Grid ── */
.vp-widget--grid__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
}

/* ── Carousel ── */
.vp-widget--carousel {
	position: relative;
	padding: 0 44px;
}

.vp-widget--carousel__wrapper {
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
	scroll-snap-type: x mandatory;
}

.vp-widget--carousel__wrapper::-webkit-scrollbar {
	display: none;
}

.vp-widget--carousel__track {
	display: flex;
	gap: 16px;
	padding: 8px 2px;
}

.vp-widget--carousel__slide {
	flex: 0 0 300px;
	scroll-snap-align: start;
}

.vp-widget--carousel__btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: var(--vp-bg);
	border: 1px solid #e0e0e0;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	font-size: 1.4rem;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 2;
	box-shadow: var(--vp-shadow);
	padding: 0;
	color: var(--vp-text);
}

.vp-widget--carousel__btn--prev { left: 0; }
.vp-widget--carousel__btn--next { right: 0; }

.vp-widget--carousel__btn:hover {
	background: var(--vp-primary);
	color: #fff;
	border-color: var(--vp-primary);
}

/* ── Rating summary ── */
.vp-widget--rating-summary__overview {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.vp-widget--rating-summary__score-block {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	min-width: 80px;
}

.vp-widget--rating-summary__score {
	font-size: 3rem;
	font-weight: 700;
	line-height: 1;
	color: var(--vp-text);
}

.vp-widget--rating-summary__count {
	font-size: .8rem;
	color: #888;
}

.vp-widget--rating-summary__bars {
	flex: 1;
	min-width: 180px;
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.vp-widget--rating-summary__bar-row {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: .8rem;
}

.vp-widget--rating-summary__bar-label {
	width: 24px;
	flex-shrink: 0;
	text-align: right;
}

.vp-widget--rating-summary__bar-track {
	flex: 1;
	height: 8px;
	background: #e5e5e5;
	border-radius: 4px;
	overflow: hidden;
}

.vp-widget--rating-summary__bar-fill {
	height: 100%;
	background: var(--vp-star-color);
	border-radius: 4px;
	transition: width .3s ease;
}

.vp-widget--rating-summary__bar-count {
	width: 24px;
	flex-shrink: 0;
	color: #888;
}

.vp-widget--rating-summary__reviews {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* ── Star badge ── */
.vp-widget--star-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: var(--vp-bg);
	border-radius: var(--vp-radius);
	box-shadow: var(--vp-shadow);
	font-size: .9rem;
}

.vp-widget--star-badge__score {
	font-weight: 700;
}

.vp-widget--star-badge__count {
	color: #888;
}

/* ── List ── */
.vp-widget--list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.vp-widget--list .vp-widget__card {
	box-shadow: none;
	border: 1px solid #e5e5e5;
}

/* ── Masonry ── */
.vp-widget--masonry__columns {
	columns: 3 220px;
	gap: 16px;
}

.vp-widget--masonry__columns .vp-widget__card {
	break-inside: avoid;
	margin-bottom: 16px;
}

/* ── Testimonial ── */
.vp-widget--testimonial {
	text-align: center;
	padding: 32px 24px;
	background: var(--vp-bg);
	border-radius: var(--vp-radius);
	box-shadow: var(--vp-shadow);
}

.vp-widget--testimonial__quote-mark {
	font-size: 5rem;
	color: var(--vp-primary);
	line-height: .6;
	margin-bottom: 12px;
	font-family: Georgia, serif;
}

.vp-widget--testimonial__body {
	font-size: 1.2rem;
	line-height: 1.7;
	font-style: italic;
	margin: 0 0 16px;
}

.vp-widget--testimonial__attribution {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
	font-size: .9rem;
}

.vp-widget--testimonial__author {
	font-weight: 600;
}

.vp-widget--testimonial__media {
	justify-content: center;
	margin-top: 16px;
}

/* ── Popup ── */
.vp-widget--popup__trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--vp-primary);
	color: #fff;
	border: none;
	border-radius: var(--vp-radius);
	padding: 10px 18px;
	cursor: pointer;
	font-size: .9rem;
	font-family: inherit;
}

.vp-widget--popup__trigger:hover {
	opacity: .9;
}

.vp-widget--popup__overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .55);
	z-index: 99999;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.vp-widget--popup__overlay.is-open {
	display: flex;
}

.vp-widget--popup__modal {
	background: #fff;
	border-radius: var(--vp-radius);
	padding: 24px;
	max-width: 620px;
	width: 100%;
	max-height: 80vh;
	overflow-y: auto;
	position: relative;
}

.vp-widget--popup__close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	color: #888;
	padding: 0;
}

.vp-widget--popup__close:hover {
	color: #333;
}

.vp-widget--popup__title {
	margin: 0 32px 16px 0;
	font-size: 1.1rem;
}

.vp-widget--popup__list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.vp-widget--popup__list .vp-widget__card {
	box-shadow: none;
	border: 1px solid #e5e5e5;
}

/* ── Photo wall ── */
.vp-widget--photo-wall__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 8px;
}

.vp-widget--photo-wall__img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: calc(var(--vp-radius) / 2);
	cursor: pointer;
	display: block;
}

/* ── Floating badge ── */
.vp-widget--floating-badge {
	position: fixed;
	bottom: 20px;
	right: 20px;
	background: var(--vp-bg);
	border-radius: var(--vp-radius);
	box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
	padding: 10px 14px;
	display: flex;
	align-items: center;
	gap: 8px;
	z-index: 9999;
	font-size: .85rem;
}

.vp-widget--floating-badge.is-hidden {
	display: none;
}

.vp-widget--floating-badge__text {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.vp-widget--floating-badge__count {
	font-size: .75rem;
	color: #888;
}

.vp-widget--floating-badge__dismiss {
	background: none;
	border: none;
	cursor: pointer;
	color: #bbb;
	font-size: 1.1rem;
	padding: 0 0 0 4px;
	line-height: 1;
}

.vp-widget--floating-badge__dismiss:hover {
	color: #888;
}

/* ── Lightbox ── */
.vp-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .92);
	z-index: 999999;
	align-items: center;
	justify-content: center;
}

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

.vp-lightbox__content {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
}

.vp-lightbox__img,
.vp-lightbox__video {
	display: block;
	max-width: 90vw;
	max-height: 85vh;
	border-radius: 4px;
}

.vp-lightbox__close {
	position: fixed;
	top: 16px;
	right: 18px;
	background: none;
	border: none;
	color: #fff;
	font-size: 2.2rem;
	line-height: 1;
	cursor: pointer;
	padding: 4px;
	opacity: .8;
}

.vp-lightbox__close:hover {
	opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 768px) {
	.vp-widget--grid__grid {
		grid-template-columns: 1fr;
	}

	.vp-widget--masonry__columns {
		columns: 2 160px;
	}

	.vp-widget--carousel {
		padding: 0 40px;
	}

	.vp-widget--carousel__slide {
		flex: 0 0 260px;
	}

	.vp-widget--testimonial {
		padding: 20px 16px;
	}

	.vp-widget--testimonial__body {
		font-size: 1rem;
	}

	.vp-widget--rating-summary__overview {
		flex-direction: column;
		align-items: stretch;
	}

	.vp-widget--rating-summary__score-block {
		flex-direction: row;
		justify-content: flex-start;
	}
}

@media (max-width: 480px) {
	.vp-widget--photo-wall__grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.vp-widget--floating-badge {
		bottom: 12px;
		right: 12px;
	}
}
