/* ============================================================
 *  نظرات بلیزوان — نوار امتیاز صفحه محصول + کارت‌های محصول
 *  رنگ‌ها از تنظیمات می‌آیند (متغیرهای --bcr-r-* که به‌صورت inline
 *  بعد از این فایل چاپ می‌شوند). سوییچ‌ها با کلاس روی body:
 *  .bcr-rating-bar و .bcr-hide-loop-stars
 *  سبک نمایش با کلاس .bcr-rating--{style} روی خود نوار انتخاب می‌شود و
 *  دکمه‌ی «خلاصه دیدگاه‌ها» (عنصر بعدی نوار) همان سبک را می‌گیرد.
 * ============================================================ */
:root {
	--bcr-r-accent: #635bff;
	--bcr-r-accent-dark: #4b45d6;
	--bcr-r-accent-soft: rgba(99,91,255,.12);
	--bcr-r-accent-line: rgba(99,91,255,.22);
	--bcr-r-star: #f5b32f;
	--bcr-r-star-off: #e3dff2;
	--bcr-r-ink: #1f1b3a;
	--bcr-r-h: 26px; /* قد نوار و دکمه‌ی «خلاصه دیدگاه‌ها» */
}

/* ── حذف ستاره‌ها از کارت محصولات (فروشگاه، دسته‌ها، مرتبط‌ها، اسلایدرها) ── */
.bcr-hide-loop-stars .products .star-rating,
.bcr-hide-loop-stars .wd-products .star-rating,
.bcr-hide-loop-stars .product-grid-item .star-rating { display: none !important; }

/* ============================================================
 *  ساختار مشترک نوار (همه‌ی سبک‌ها)
 * ============================================================ */
body .woocommerce-product-rating.bcr-rating {
	display: inline-flex !important;
	align-items: center;
	gap: 8px;
	float: none;
	width: auto;
	max-width: 100%;
	height: var(--bcr-r-h);
	margin: 0 0 10px;
	padding: 0 10px 0 9px;
	line-height: 1;
	vertical-align: middle;
	box-sizing: border-box;
	direction: rtl;
	font-family: inherit;
	border: 1px solid transparent;
	border-radius: 999px;
}

.bcr-rating .bcr-rating-stars { display: inline-flex; align-items: center; position: relative; cursor: default; }

/* راهنمای میانگین امتیاز: فقط روی هاور ستاره‌ها */
.bcr-rating .bcr-rating-stars::after {
	content: attr(data-bcr-tip);
	position: absolute;
	z-index: 20;
	inset-block-start: calc(100% + 9px);
	inset-inline-start: 50%;
	transform: translateX(50%) translateY(-4px);
	padding: 5px 10px;
	border-radius: 8px;
	background: var(--bcr-r-ink);
	color: #fff;
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0;
	white-space: nowrap;
	box-shadow: 0 8px 20px -10px rgba(31,27,58,.6);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .15s, transform .15s, visibility .15s;
}
.bcr-rating .bcr-rating-stars::before {
	content: "";
	position: absolute;
	z-index: 21;
	inset-block-start: calc(100% + 4px);
	inset-inline-start: 50%;
	width: 8px;
	height: 8px;
	transform: translateX(50%) translateY(-4px) rotate(45deg);
	background: var(--bcr-r-ink);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .15s, transform .15s, visibility .15s;
}
.bcr-rating .bcr-rating-stars:hover::after,
.bcr-rating .bcr-rating-stars:focus-within::after { opacity: 1; visibility: visible; transform: translateX(50%) translateY(0); }
.bcr-rating .bcr-rating-stars:hover::before,
.bcr-rating .bcr-rating-stars:focus-within::before { opacity: 1; visibility: visible; transform: translateX(50%) translateY(0) rotate(45deg); }
.bcr-rating .bcr-rating-stars[data-bcr-tip=""]::after,
.bcr-rating .bcr-rating-stars[data-bcr-tip=""]::before { display: none; }

.bcr-rating .star-rating {
	float: none !important;
	margin: 0 !important;
	font-size: 12px;
	letter-spacing: 1px;
	line-height: 1;
	color: var(--bcr-r-star);
}
.bcr-rating .star-rating::before { color: var(--bcr-r-star-off); }

.bcr-rating .bcr-rating-avg {
	font-size: 12.5px;
	font-weight: 800;
	line-height: 1;
	color: var(--bcr-r-ink);
	margin-inline-start: -2px;
}

.bcr-rating .bcr-rating-count {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding-inline-start: 8px;
	border-inline-start: 1px solid var(--bcr-r-accent-line);
	color: var(--bcr-r-accent);
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none !important;
	white-space: nowrap;
	transition: color .2s;
}
.bcr-rating .bcr-rating-count .count { font-weight: 800; }
/* هاور با !important تا روی style درون‌خطی لینک هم اثر کند */
.bcr-rating .bcr-rating-count:hover,
.bcr-rating .bcr-rating-count:focus-visible { color: var(--bcr-r-accent-dark) !important; outline: none; }

/* دکمه‌ی «خلاصه دیدگاه‌ها» کنار نوار: هم‌قد، هم‌راستا و هم‌سبک نوار.
   (به مجاورت مستقیم با نوار وابسته نیست؛ پیش‌فرض = ظاهر کپسولی نوار) */
.bcr-rating-bar .bcr-ai-pill {
	height: var(--bcr-r-h);
	box-sizing: border-box;
	padding: 0 9px 0 8px;
	margin-inline-start: 6px;
	margin-bottom: 10px;
	font-size: 12px;
	line-height: 1;
	vertical-align: middle;
	color: var(--bcr-r-accent);
	background: linear-gradient(180deg, #ffffff, #f6f4ff);
	border: 1px solid var(--bcr-r-accent-line);
	box-shadow: 0 1px 2px var(--bcr-r-accent-soft), inset 0 1px 0 #fff;
}
.bcr-rating-bar .bcr-ai-pill .bcr-ai-pill-ic { color: var(--bcr-r-accent); }
.bcr-rating-bar .bcr-ai-pill .bcr-ai-pill-ic svg { width: 11px; height: 11px; filter: none; }
/* هاور با !important تا روی style درون‌خطی دکمه هم اثر کند */
.bcr-rating-bar .bcr-ai-pill:hover,
.bcr-rating-bar .bcr-ai-pill:focus-visible {
	color: var(--bcr-r-accent-dark) !important;
	background: linear-gradient(180deg, #ffffff, #efedff) !important;
	border-color: var(--bcr-r-accent-line) !important;
	box-shadow: 0 4px 12px -6px var(--bcr-r-accent-soft), inset 0 1px 0 #fff !important;
	transform: none;
}

/* ============================================================
 *  سبک‌ها
 * ============================================================ */

/* کپسولی (پیش‌فرض) و یکپارچه: گرادیان روشن با کادر نازک */
body .woocommerce-product-rating.bcr-rating--pill,
body .woocommerce-product-rating.bcr-rating--joined,
.bcr-rating-bar .bcr-rating--pill + .bcr-ai-pill,
.bcr-rating-bar .bcr-rating--joined + .bcr-ai-pill {
	background: linear-gradient(180deg, #ffffff, #f6f4ff);
	border-color: var(--bcr-r-accent-line);
	box-shadow: 0 1px 2px var(--bcr-r-accent-soft), inset 0 1px 0 #fff;
}
.bcr-rating-bar .bcr-rating--pill + .bcr-ai-pill:hover,
.bcr-rating-bar .bcr-rating--joined + .bcr-ai-pill:hover {
	background: linear-gradient(180deg, #ffffff, #efedff);
	box-shadow: 0 4px 12px -6px var(--bcr-r-accent-soft), inset 0 1px 0 #fff;
}

/* یکپارچه: نوار و دکمه یک کپسول با یک خط جداکننده */
body .woocommerce-product-rating.bcr-rating--joined { border-start-end-radius: 0; border-end-end-radius: 0; }
.bcr-rating-bar .bcr-rating--joined + .bcr-ai-pill {
	margin-inline-start: -1px;
	border-start-start-radius: 0;
	border-end-start-radius: 0;
	padding-inline-start: 10px;
}

/* نرم: پر، بدون کادر */
body .woocommerce-product-rating.bcr-rating--soft,
.bcr-rating-bar .bcr-rating--soft + .bcr-ai-pill { background: #f1efff; }
.bcr-rating--soft .bcr-rating-count { border-inline-start-color: rgba(99,91,255,.28); }
.bcr-rating-bar .bcr-rating--soft + .bcr-ai-pill:hover { background: #e7e4ff; }

/* خطی: سفید با کادر نازک، متن تعداد تیره */
body .woocommerce-product-rating.bcr-rating--outline,
.bcr-rating-bar .bcr-rating--outline + .bcr-ai-pill { background: #fff; border-color: #dcd8f3; }
.bcr-rating--outline .bcr-rating-count { color: var(--bcr-r-ink); border-inline-start-color: #e6e3f5; }
.bcr-rating--outline .bcr-rating-count:hover { color: var(--bcr-r-accent); }
.bcr-rating-bar .bcr-rating--outline + .bcr-ai-pill:hover { background: #faf9ff; border-color: var(--bcr-r-accent-line); }

/* تیره */
body .woocommerce-product-rating.bcr-rating--dark,
.bcr-rating-bar .bcr-rating--dark + .bcr-ai-pill {
	background: linear-gradient(180deg, #2a2555, #1f1b3a);
	border-color: #1f1b3a;
	box-shadow: 0 6px 14px -8px rgba(31,27,58,.6);
	color: #fff;
}
.bcr-rating--dark .star-rating::before { color: rgba(255,255,255,.28); }
.bcr-rating--dark .bcr-rating-avg { color: #fff; }
.bcr-rating--dark .bcr-rating-count { color: #e9e6ff; border-inline-start-color: rgba(255,255,255,.22); }
.bcr-rating--dark .bcr-rating-count:hover { color: #fff !important; }
.bcr-rating-bar .bcr-rating--dark + .bcr-ai-pill,
.bcr-rating-bar .bcr-rating--dark + .bcr-ai-pill .bcr-ai-pill-ic { color: #fff; }
.bcr-rating-bar .bcr-rating--dark + .bcr-ai-pill:hover { background: linear-gradient(180deg, #332d66, #26214a); color: #fff; }

/* گرادیان برند */
body .woocommerce-product-rating.bcr-rating--gradient,
.bcr-rating-bar .bcr-rating--gradient + .bcr-ai-pill {
	background: linear-gradient(112deg, #5146ee 0%, #6a5cff 55%, #8f5cf6 100%);
	border-color: transparent;
	box-shadow: 0 8px 18px -10px rgba(99,91,255,.75);
	color: #fff;
}
.bcr-rating--gradient .star-rating { color: #ffd166; }
.bcr-rating--gradient .star-rating::before { color: rgba(255,255,255,.4); }
.bcr-rating--gradient .bcr-rating-avg { color: #fff; }
.bcr-rating--gradient .bcr-rating-count { color: #fff; border-inline-start-color: rgba(255,255,255,.35); }
.bcr-rating--gradient .bcr-rating-count:hover { color: #fff !important; opacity: .88; }
.bcr-rating-bar .bcr-rating--gradient + .bcr-ai-pill,
.bcr-rating-bar .bcr-rating--gradient + .bcr-ai-pill .bcr-ai-pill-ic { color: #fff; }
.bcr-rating-bar .bcr-rating--gradient + .bcr-ai-pill:hover { background: linear-gradient(112deg, #4a3fe6 0%, #6153ff 55%, #8552f0 100%); color: #fff; }

/* دو رنگ: نوار سفید خطی، دکمه بنفش پر */
body .woocommerce-product-rating.bcr-rating--contrast { background: #fff; border-color: #e3e0f5; }
.bcr-rating--contrast .bcr-rating-count { color: var(--bcr-r-ink); border-inline-start-color: #e6e3f5; }
.bcr-rating--contrast .bcr-rating-count:hover { color: var(--bcr-r-accent); }
.bcr-rating-bar .bcr-rating--contrast + .bcr-ai-pill {
	background: linear-gradient(135deg, #7b73ff, #5b52f5);
	border-color: transparent;
	box-shadow: 0 8px 18px -10px rgba(99,91,255,.8);
	color: #fff;
}
.bcr-rating-bar .bcr-rating--contrast + .bcr-ai-pill .bcr-ai-pill-ic { color: #fff; }
.bcr-rating-bar .bcr-rating--contrast + .bcr-ai-pill:hover { background: linear-gradient(135deg, #6f66ff, #5148ea); color: #fff; }

/* متنی: بدون کادر، جداکننده‌ی نقطه */
body .woocommerce-product-rating.bcr-rating--text { padding: 0; gap: 8px; }
.bcr-rating--text .bcr-rating-count { border: none; padding-inline-start: 0; color: var(--bcr-r-ink); font-weight: 600; }
.bcr-rating--text .bcr-rating-count::before { content: "·"; margin-inline-end: 4px; color: #b8b3d6; font-weight: 800; }
.bcr-rating--text .bcr-rating-count:hover { color: var(--bcr-r-accent); }
.bcr-rating-bar .bcr-rating--text + .bcr-ai-pill { padding: 0; margin-inline-start: 2px; background: none; border-color: transparent; box-shadow: none; }
.bcr-rating-bar .bcr-rating--text + .bcr-ai-pill::before { content: "·"; margin-inline-end: 2px; color: #b8b3d6; font-weight: 800; }
.bcr-rating-bar .bcr-rating--text + .bcr-ai-pill:hover { background: none; border-color: transparent; box-shadow: none; }

/* ساده: نوار و دکمه بدون پس‌زمینه (با خط جداکننده‌ی نازک) */
body .woocommerce-product-rating.bcr-rating--minimal { padding: 0; }
.bcr-rating-bar .bcr-rating--minimal + .bcr-ai-pill { padding: 0; margin-inline-start: 10px; background: none; border-color: transparent; box-shadow: none; }
.bcr-rating-bar .bcr-rating--minimal + .bcr-ai-pill:hover { background: none; border-color: transparent; box-shadow: none; }

@media (max-width: 480px) {
	body .woocommerce-product-rating.bcr-rating { gap: 6px; padding: 0 9px 0 8px; }
	body .woocommerce-product-rating.bcr-rating--minimal,
	body .woocommerce-product-rating.bcr-rating--text { padding: 0; }
	.bcr-rating .star-rating { font-size: 11.5px; letter-spacing: .8px; }
	.bcr-rating .bcr-rating-count { font-size: 11.5px; padding-inline-start: 7px; }
	.bcr-rating-bar .bcr-ai-pill { margin-inline-start: 5px; font-size: 11.5px; }
	.bcr-rating-bar .bcr-rating--joined + .bcr-ai-pill { margin-inline-start: -1px; }
	.bcr-rating-bar .bcr-rating--text + .bcr-ai-pill { margin-inline-start: 2px; }
}
