/* Customer reviews — yallah.space. Mobile first, RTL native. */

.yef-reviews {
	--r-line: #ECECEC;
	--r-ink: #111;
	--r-muted: #6E6E6E;
	--r-accent: #66c7cc;
	--r-accent-soft: rgba(102, 199, 204, .12);
	--r-star: #F5B301;
	direction: rtl; text-align: start;
	box-sizing: border-box; width: 100%; max-width: 100%;
	margin: 28px 0 0; padding: 0;
}
.yef-reviews *, .yef-reviews *::before, .yef-reviews *::after { box-sizing: border-box; }
.yef-reviews__title { margin: 0 0 14px; font-size: 1.125rem; font-weight: 800; color: var(--r-ink); }

/* ---- stars ---- */
.yef-stars { display: inline-flex; gap: 1px; vertical-align: middle; line-height: 0; }
.yef-star { fill: #DEDEDE; flex: none; }
.yef-star.is-on { fill: var(--r-star); }
.yef-star.is-half { fill: url(#yef-half); }

/* ---- compact summary beside the price ---- */
.yef-rsum {
	display: inline-flex; align-items: center; gap: 6px;
	text-decoration: none; color: inherit; min-height: 32px;
}
.yef-rsum__avg { font-size: .875rem; font-weight: 800; }
.yef-rsum__count { font-size: .8125rem; color: var(--r-muted); }
.yef-rsum:hover .yef-rsum__count { color: var(--r-accent); }

/* ---- header: score + distribution ---- */
.yef-reviews__head {
	display: flex; flex-direction: column; gap: 16px;
	background: #fff; border: 1px solid var(--r-line); border-radius: 16px;
	padding: 16px; margin-bottom: 16px;
}
.yef-reviews__score { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.yef-reviews__avg { font-size: 2rem; font-weight: 800; line-height: 1; }
.yef-reviews__avg span { font-size: .875rem; font-weight: 600; color: var(--r-muted); }
.yef-reviews__based { font-size: .8125rem; color: var(--r-muted); }

.yef-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.yef-bars__row { display: flex; align-items: center; gap: 8px; font-size: .75rem; }
.yef-bars__label { flex: none; width: 34px; color: var(--r-muted); }
.yef-bars__track { flex: 1; height: 7px; border-radius: 999px; background: #F1F1F1; overflow: hidden; }
.yef-bars__fill { display: block; height: 100%; background: var(--r-star); border-radius: 999px; }
.yef-bars__pct { flex: none; width: 34px; text-align: end; color: var(--r-muted); }

/* ---- carousel ----
   CSS scroll-snap rather than a carousel library: it is native, it is smooth on
   touch, and it costs the product page nothing. */
.yef-carousel {
	display: flex; gap: 12px;
	overflow-x: auto; overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 4px; margin: 0 0 10px;
}
.yef-carousel::-webkit-scrollbar { display: none; }
.yef-carousel > .yef-review {
	/* A sliver of the next card is deliberately visible, so the swipe is
	   discoverable without an instruction. */
	flex: 0 0 87%;
	scroll-snap-align: start;
}
.yef-carousel__dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.yef-carousel__dot { width: 6px; height: 6px; border-radius: 50%; background: #D5D5D5; border: 0; padding: 0; }
.yef-carousel__dot.is-active { background: var(--r-accent); width: 18px; border-radius: 999px; }

/* ---- review card ---- */
.yef-review {
	background: #fff; border: 1px solid var(--r-line); border-radius: 16px;
	padding: 16px; min-width: 0;
	display: flex; flex-direction: column; gap: 8px;
}
.yef-review__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.yef-review__author { font-size: .875rem; font-weight: 800; }
.yef-review__verified {
	font-size: .625rem; font-weight: 700; line-height: 1;
	padding: 4px 8px; border-radius: 999px;
	background: #E7F6EC; color: #146B33;
}
.yef-review__text { font-size: .875rem; line-height: 1.8; color: #3A3A3A; overflow-wrap: anywhere; }
.yef-review__text p { margin: 0 0 6px; }
.yef-review__images { display: flex; gap: 8px; flex-wrap: wrap; }
.yef-review__image {
	width: 60px; height: 60px; padding: 0; border: 1px solid var(--r-line);
	border-radius: 10px; overflow: hidden; background: none; cursor: pointer;
}
.yef-review__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yef-review__foot {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	font-size: .75rem; color: var(--r-muted);
	padding-top: 8px; border-top: 1px solid var(--r-line);
}
.yef-review__helpful {
	background: none; border: 0; cursor: pointer; font: inherit;
	font-size: .75rem; color: var(--r-muted); min-height: 32px;
	display: inline-flex; align-items: center; gap: 5px;
}
.yef-review__helpful.is-voted { color: var(--r-accent); font-weight: 700; }
.yef-review__reply {
	background: #FAFAFA; border-radius: 12px; padding: 12px;
	margin-top: 4px;
}
.yef-review__reply-who { margin: 0 0 4px; font-size: .75rem; font-weight: 800; color: var(--r-accent); }
.yef-review__reply-text { font-size: .8125rem; line-height: 1.7; color: #3A3A3A; }
.yef-review__reply-text p { margin: 0; }

/* ---- full list + filters ---- */
.yef-reviews__all { margin-bottom: 16px; }
.yef-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 12px; scrollbar-width: none; }
.yef-filters::-webkit-scrollbar { display: none; }
.yef-chip {
	flex: none; min-height: 36px; padding: 0 14px;
	border: 1px solid var(--r-line); border-radius: 999px; background: #fff;
	font: inherit; font-size: .75rem; font-weight: 700; cursor: pointer; color: var(--r-ink);
}
.yef-chip.is-active { border-color: var(--r-accent); background: var(--r-accent-soft); color: #14494C; }
.yef-sort {
	flex: none; min-height: 36px; padding: 0 10px;
	border: 1px solid var(--r-line); border-radius: 999px; background: #fff;
	font: inherit; font-size: .75rem; margin-inline-start: auto;
}
.yef-reviews__list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }

/* ---- empty ---- */
.yef-reviews__empty {
	text-align: center; padding: 22px 12px; margin-bottom: 16px;
	background: #fff; border: 1px solid var(--r-line); border-radius: 16px;
}
.yef-reviews__empty-title { margin: 10px 0 4px; font-size: .9375rem; font-weight: 800; }
.yef-reviews__empty-text { margin: 0; font-size: .8125rem; color: var(--r-muted); }

/* ---- invitation ---- */
.yef-invite {
	background: var(--r-accent-soft); border-radius: 16px; padding: 16px; text-align: center;
}
.yef-invite__title { margin: 0 0 4px; font-size: .9375rem; font-weight: 800; color: #14494C; }
.yef-invite__text { margin: 0 0 12px; font-size: .8125rem; line-height: 1.6; color: #1E6E73; }
.yef-invite__done { margin: 0; font-size: .875rem; font-weight: 700; color: #146B33; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* ---- form ---- */
.yef-rform { position: fixed; inset: 0; z-index: 400; display: flex; align-items: flex-end; }
.yef-rform[hidden] { display: none; }
.yef-rform::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.yef-rform__panel {
	position: relative; width: 100%; max-height: 92vh; overflow-y: auto;
	background: #fff; border-radius: 20px 20px 0 0;
	padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
	direction: rtl; text-align: start;
}
.yef-rform__close {
	position: absolute; top: 10px; inset-inline-start: 12px;
	width: 36px; height: 36px; border: 0; background: none; font-size: 26px;
	line-height: 1; cursor: pointer; color: var(--r-muted);
}
.yef-rform__title { margin: 0 0 16px; font-size: 1.0625rem; font-weight: 800; }
.yef-rform__q { margin: 0 0 8px; font-size: .875rem; font-weight: 700; }
.yef-rform__stars { display: flex; gap: 6px; margin-bottom: 6px; }
.yef-rform__star { background: none; border: 0; padding: 4px; cursor: pointer; line-height: 0; min-width: 44px; min-height: 44px; }
.yef-rform__star svg { fill: #DEDEDE; transition: fill .12s ease; }
.yef-rform__star.is-on svg { fill: var(--r-star); }
.yef-rform__word { margin: 0 0 14px; min-height: 1.2em; font-size: .8125rem; font-weight: 700; color: var(--r-accent); }
.yef-rform__label { display: block; margin: 0 0 6px; font-size: .8125rem; font-weight: 700; }
.yef-rform__opt { font-weight: 400; color: var(--r-muted); font-size: .75rem; }
.yef-rform textarea {
	width: 100%; box-sizing: border-box; padding: 12px 14px; margin-bottom: 14px;
	border: 1px solid var(--r-line); border-radius: 12px; font: inherit; font-size: 16px;
	line-height: 1.7; resize: vertical;
}
.yef-rform textarea:focus { outline: none; border-color: var(--r-accent); box-shadow: 0 0 0 3px var(--r-accent-soft); }
.yef-rform input[type="file"] { display: block; width: 100%; font-size: .8125rem; margin-bottom: 6px; }
.yef-rform__hint { margin: 0 0 14px; font-size: .6875rem; color: var(--r-muted); }
.yef-rform__error { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: #FDECEA; color: #B42318; font-size: .8125rem; font-weight: 600; }
.yef-rform__done { text-align: center; padding: 24px 8px; }
.yef-rform__tick {
	display: inline-flex; align-items: center; justify-content: center;
	width: 52px; height: 52px; border-radius: 50%;
	background: #E7F6EC; color: #146B33; font-size: 26px; margin-bottom: 12px;
}
.yef-rform__done-title { margin: 0 0 6px; font-size: 1rem; font-weight: 800; }
.yef-rform__done-text { margin: 0; font-size: .8125rem; color: var(--r-muted); line-height: 1.7; }

/* ---- buttons (scoped so they match the account/checkout system) ---- */
.yef-reviews .yef-btn, .yef-rform .yef-btn {
	display: inline-flex; align-items: center; justify-content: center;
	box-sizing: border-box; min-height: 48px; padding: 0 18px;
	border: 1px solid transparent; border-radius: 12px;
	font: inherit; font-size: .875rem; font-weight: 700; cursor: pointer; text-decoration: none;
}
.yef-reviews .yef-btn--block, .yef-rform .yef-btn--block { display: flex; width: 100%; }
.yef-reviews .yef-btn--primary, .yef-rform .yef-btn--primary { background: var(--r-accent); color: #0B3B3D; }
.yef-reviews .yef-btn--ghost { background: #fff; border-color: var(--r-line); color: var(--r-ink); }
.yef-reviews .yef-btn:disabled, .yef-rform .yef-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- lightbox ---- */
.yef-lightbox { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; }
.yef-lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; }

@media (min-width: 768px) and (max-width: 767px) {
	.yef-reviews__head { flex-direction: row; align-items: center; gap: 28px; }
	.yef-reviews__score { flex: none; min-width: 150px; }
	.yef-bars { flex: 1; }
	.yef-carousel > .yef-review { flex: 0 0 46%; }
	.yef-rform { align-items: center; justify-content: center; }
	.yef-rform__panel { max-width: 480px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
	.yef-carousel { scroll-behavior: auto; }
	.yef-rform__star svg { transition: none; }
}
