/**
 * Сучасний рескін плагіна Customer Reviews for WooCommerce (CusRev)
 * під токени теми vizitka-child. Підключається лише там, де є шорткоди
 * cusrev (сторінка /opinie/ + слайдер на головній).  @package vizitka-child
 */

/* ── Обгортка сторінки відгуків ───────────────────────────────────────── */
.cr-all-reviews-shortcode {
	max-width: var(--pp-container, 1200px);
	margin: 0 auto;
	font-family: var(--pp-font);
	color: var(--pp-text);
}

/* ═══ ПІДСУМОК (summary bar) — герой-картка ═══════════════════════════════ */
.cr-all-reviews-shortcode > div:first-child:has(.cr-overall-rating-wrap),
.cr-all-reviews-shortcode .cr-summary,
.cr-summary-tab {
	background: linear-gradient(135deg, #ffffff 0%, var(--pp-orange-light) 100%);
	border: 1px solid var(--pp-border);
	border-radius: var(--pp-radius-lg, 18px);
	box-shadow: 0 10px 30px rgba(26,26,26,.06);
	padding: 28px 32px;
	margin-bottom: 28px;
}

/* Лівий блок: велика середня оцінка */
.cr-overall-rating-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding-right: 28px;
}
.cr-average-rating {
	font-size: var(--pp-fs-11xl, 56px);
	font-weight: 800;
	line-height: 1;
	color: var(--pp-text);
	letter-spacing: -1px;
}
.cr-average-rating::after { content: " / 5"; font-size: var(--pp-fs-3xl, 20px); font-weight: 600; color: var(--pp-text-muted); }
.cr-average-rating-stars { transform: scale(1.15); margin: 6px 0 2px; }
.cr-total-rating-count {
	display: inline-block;
	background: var(--pp-orange);
	color: #fff;
	font-size: var(--pp-fs-sm, 13px);
	font-weight: 700;
	padding: 5px 14px;
	border-radius: 999px;
	box-shadow: 0 4px 10px rgba(249,115,22,.3);
}

.cr-summary-separator { border: none; width: 1px; background: var(--pp-border); }

/* ── Гістограма розподілу — виразні смуги ─────────────────────────────── */
.cr-histogramTable { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.ivole-histogramRow { transition: transform .15s ease; }
.ivole-histogramRow:hover { transform: translateX(2px); }
.ivole-histogramCell1 { white-space: nowrap; padding-right: 12px; }
.ivole-histogramCell1 .cr-histogram-a { font-size: var(--pp-fs-sm, 13px); font-weight: 600; color: var(--pp-text-2); }

/* ── Підпис рядка: «5 gwiazdek» → ★★★★★ ───────────────────────────────────
   Розмітка CusRev неоднорідна одразу у двох вимірах:
     • клікабельний елемент-фільтр зветься .cr-histogram-a на сторінці
       [cusrev_all_reviews] і .ivole-histogram-a на сторінці товару — тому
       чіпляємось за спільне [data-rating], а не за клас;
     • рядок з НУЛЕМ відгуків взагалі не має того span — там просто текст у <td>,
       для нього зірки малюємо на клітинці через :not(:has([data-rating])),
       інакше вийшов би дубль там, де span є.
   ⚠ Прив'язка до .ivole-histogramCell1 обов'язкова: той самий [data-rating]
   висить ще й на смузі (Cell2) та відсотку (Cell3) — без неї зірки насипаються
   в усі три колонки.
   Текст лишається в DOM (font-size:0) — читалки його озвучують. */
.ivole-histogramCell1 [data-rating],
.ivole-histogramCell1:not(:has([data-rating])) {
	font-size: 0;
	line-height: 22px; /* ДОВЖИНОЮ, не множником: множник × font-size:0 = рядок 0px і нема куди клікати */
}
.ivole-histogramCell1 [data-rating]::before,
.ivole-histogramCell1 [data-rating]::after,
.ivole-histogramCell1:not(:has([data-rating]))::before,
.ivole-histogramCell1:not(:has([data-rating]))::after {
	display: inline-block;
	font-size: var(--pp-fs-xl, 16px);
	letter-spacing: 1px;
	line-height: 22px;
}
.ivole-histogramCell1 [data-rating]::before,
.ivole-histogramCell1:not(:has([data-rating]))::before { color: #F59E0B; }
.ivole-histogramCell1 [data-rating]::after,
.ivole-histogramCell1:not(:has([data-rating]))::after { color: #E2E8F0; }
.ivole-histogramCell1 [data-rating] { cursor: pointer; }
.ivole-histogramCell1 [data-rating]:hover::before { color: #D97706; }
/* Плагін тримає цей span як display:inline правилом 0,3,1 — перебиваємо
   специфічністю (0,4,1), без !important. Інакше рядок має height:0 і зона
   кліку тримається лише на псевдоелементах. */
.cr-histogramTable tr.ivole-histogramRow .ivole-histogramCell1 [data-rating] { display: inline-block; }

/* Рядки, де відгуки є — за data-rating. */
.ivole-histogramCell1 [data-rating="5"]::before { content: "★★★★★"; }
.ivole-histogramCell1 [data-rating="4"]::before { content: "★★★★"; }
.ivole-histogramCell1 [data-rating="4"]::after  { content: "★"; }
.ivole-histogramCell1 [data-rating="3"]::before { content: "★★★"; }
.ivole-histogramCell1 [data-rating="3"]::after  { content: "★★"; }
.ivole-histogramCell1 [data-rating="2"]::before { content: "★★"; }
.ivole-histogramCell1 [data-rating="2"]::after  { content: "★★★"; }
.ivole-histogramCell1 [data-rating="1"]::before { content: "★"; }
.ivole-histogramCell1 [data-rating="1"]::after  { content: "★★★★"; }

/* Рядки з нулем відгуків — span відсутній, орієнтуємось на порядок 5→1. */
.ivole-histogramRow:nth-child(1) .ivole-histogramCell1:not(:has([data-rating]))::before { content: "★★★★★"; }
.ivole-histogramRow:nth-child(2) .ivole-histogramCell1:not(:has([data-rating]))::before { content: "★★★★"; }
.ivole-histogramRow:nth-child(2) .ivole-histogramCell1:not(:has([data-rating]))::after  { content: "★"; }
.ivole-histogramRow:nth-child(3) .ivole-histogramCell1:not(:has([data-rating]))::before { content: "★★★"; }
.ivole-histogramRow:nth-child(3) .ivole-histogramCell1:not(:has([data-rating]))::after  { content: "★★"; }
.ivole-histogramRow:nth-child(4) .ivole-histogramCell1:not(:has([data-rating]))::before { content: "★★"; }
.ivole-histogramRow:nth-child(4) .ivole-histogramCell1:not(:has([data-rating]))::after  { content: "★★★"; }
.ivole-histogramRow:nth-child(5) .ivole-histogramCell1:not(:has([data-rating]))::before { content: "★"; }
.ivole-histogramRow:nth-child(5) .ivole-histogramCell1:not(:has([data-rating]))::after  { content: "★★★★"; }
.ivole-histogramCell2 { width: 100%; }
.ivole-histogramCell3 { padding-left: 12px; text-align: right; }
.ivole-histogramCell3 .cr-histogram-a { font-size: var(--pp-fs-sm, 13px); font-weight: 700; color: var(--pp-text); min-width: 38px; display: inline-block; }

.ivole-meter {
	height: 12px;
	background: #e9ecef;
	border-radius: 999px;
	overflow: hidden;
}
.ivole-meter-bar {
	height: 100%;
	background: linear-gradient(90deg, var(--pp-orange) 0%, #FB923C 100%);
	border-radius: 999px;
	text-indent: -9999px;            /* ховаємо число всередині смуги */
	box-shadow: inset 0 -1px 2px rgba(0,0,0,.08);
	transition: width .8s cubic-bezier(.16,1,.3,1);
}
/* 0-зірок рядок без заливки лишається сірим */

/* ═══ ПОШУК + СОРТУВАННЯ ══════════════════════════════════════════════════ */
.cr-ajax-search, .cr-ajax-reviews-sort-div { margin: 18px 0; }
.cr-input-text, .cr-ajax-reviews-sort {
	border: 1.5px solid var(--pp-border);
	border-radius: 10px;
	padding: 11px 14px;
	font-size: var(--pp-fs-md, 14px);
	font-family: var(--pp-font);
	background: #fff;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.cr-input-text:focus, .cr-ajax-reviews-sort:focus {
	outline: none;
	border-color: var(--pp-orange);
	box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}
.cr-button-search { border-radius: 10px; }

/* ═══ СПИСОК ВІДГУКІВ — картки ════════════════════════════════════════════ */
.cr-all-reviews-shortcode ol.commentlist {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}
.cr-all-reviews-shortcode ol.commentlist > li.review {
	margin: 0;
	border: none;
	padding: 0;
}
/* Картка = comment_container; працюємо з рідною розкладкою CusRev (аватар absolute зліва). */
.cr-all-reviews-shortcode ol li.review .comment_container,
.cr-all-reviews-shortcode ol li.comment .comment_container {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	background: var(--pp-white);
	border: 1px solid var(--pp-border);
	border-radius: var(--pp-radius, 12px);
	padding: 22px 24px 22px 92px;          /* зліва — місце під absolute-аватар */
	height: 100%;
	box-shadow: 0 2px 10px rgba(26,26,26,.04);
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cr-all-reviews-shortcode ol li.review .comment_container:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 28px rgba(26,26,26,.10);
	border-color: #FED7AA;
}

/* Аватар (CusRev: position:absolute top:0 left:0) — посунути всередину картки, збільшити. */
.cr-all-reviews-shortcode ol li.review .comment_container .cr-avatar {
	width: 52px !important;
	height: 52px !important;
	top: 22px !important;
	left: 24px !important;
	border-radius: 50% !important;
	object-fit: cover;
	box-shadow: 0 2px 6px rgba(0,0,0,.10);
}
.cr-all-reviews-shortcode ol li.review .comment_container .cr-avatar-check { left: 56px !important; top: 50px !important; }
.cr-avatar-check svg, .cr-avatar-check img { filter: drop-shadow(0 1px 2px rgba(0,0,0,.15)); }
.cr-meta-author-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.woocommerce-review__author { font-weight: 700; font-size: var(--pp-fs-lg, 15px); color: var(--pp-text); }
.woocommerce-review__verified.verified {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: rgba(249,115,22,.12);
	color: var(--pp-orange-hover);
	font-size: var(--pp-fs-2xs, 11px);
	font-weight: 700;
	padding: 3px 9px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: .02em;
}
.woocommerce-review__verified.verified::before { content: "✓"; font-weight: 800; }
.cr-meta-author-featured-date { display: block; }
.cr-meta-author-featured-date time,
.cr-all-reviews-shortcode time { font-size: var(--pp-fs-xs, 12px); color: var(--pp-text-muted); }

/* Зірки + товар */
.cr-rating-product-name { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 6px; }
.cr-product-name-picture {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--pp-img-bg);
	border: 1px solid var(--pp-border);
	border-radius: 999px;
	padding: 4px 12px 4px 4px;
}
.iv-comment-product-img {
	width: 32px !important;
	height: 32px !important;
	border-radius: 4px;
	object-fit: contain;
	background: #fff;
}
.cr-comment-productname-a {
	font-size: var(--pp-fs-xs, 12px);
	font-weight: 600;
	color: var(--pp-text-2);
	text-decoration: none;
}
.cr-comment-productname-a:hover { color: var(--pp-orange-hover); }

/* Текст відгуку */
.cr-all-reviews-shortcode .description p,
.cr-comment-text .description { color: var(--pp-text-2); font-size: var(--pp-fs-md, 14px); line-height: 1.6; margin: 6px 0 0; }

/* ── «Показати ще» ────────────────────────────────────────────────────── */
/* CusRev action appearance/plugin specificity bridge is owned by buttons.css. */
.cr-all-reviews-shortcode .cr-show-more-reviews-prd,
.cr-all-reviews-shortcode .cr-show-more-button,
.cr-reviews-grid .cr-show-more-button,
.cr-reviews-ajax-reviews .cr-show-more-reviews-prd,
.vz-reviews--cusrev .cr-show-more-reviews-prd,
.vz-reviews--cusrev .cr-show-more-button {
	display: flex;
	width: max-content;
	margin: 24px auto 0;
}

/* ── Адаптив ──────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
	.cr-all-reviews-shortcode ol.commentlist { grid-template-columns: 1fr; }
	.cr-overall-rating-wrap { padding-right: 0; }
	.cr-average-rating { font-size: var(--pp-fs-10xl, 44px); }
}

/* ═══ Слайдер на головній (секція opinie-cusrev) ══════════════════════════ */
.vz-reviews--cusrev .cr-reviews-slider .crwoo-review,
.vz-reviews--cusrev .cr-slider-review {
	background: var(--pp-white);
	border: 1px solid var(--pp-border);
	border-radius: var(--pp-radius, 12px);
	box-shadow: 0 4px 14px rgba(26,26,26,.05);
}
.vz-reviews__cta { text-align: center; margin-top: 28px; }

/* =========================================================================
   HOME / CUSREV SLIDER — PIUROPRINT component boundary
   =========================================================================
   Keep this after the plugin's own slider CSS. The theme owns spacing, surfaces
   and typography; CusRev still owns the data, slider mechanics and star widget.
   ========================================================================= */
.pp-opinie .pp-opinie__slider { min-width: 0; overflow: hidden; }
.pp-opinie .pp-opinie__slider :where(.cr-reviews-slider,.cr-reviews-slider-wrap,.slick-list,.slick-track) {
	box-sizing: border-box;
	min-width: 0;
}
.pp-opinie .pp-opinie__slider .cr-reviews-slider {
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 2px 0 12px;
	border: 0;
	background: transparent;
}
.pp-opinie .pp-opinie__slider .slick-list { margin: 0 -8px; overflow: hidden; }
.pp-opinie .pp-opinie__slider .cr-review-card,
.pp-opinie .pp-opinie__slider .cr-slider-review,
.pp-opinie .pp-opinie__slider .crwoo-review {
	box-sizing: border-box;
	height: auto;
	min-width: 0;
	padding: 0 8px;
	background: transparent;
	border: 0;
}
.pp-opinie .pp-opinie__slider .cr-review-card-inner,
.pp-opinie .pp-opinie__slider .cr-slider-review > div,
.pp-opinie .pp-opinie__slider .crwoo-review > div {
	box-sizing: border-box;
	height: 100%;
	min-height: 220px;
	padding: 22px;
	background: #fff;
	border: 1px solid var(--pp-border);
	border-radius: var(--pp-radius-lg);
	box-shadow: var(--pp-shadow-card);
	color: var(--pp-text);
}
.pp-opinie .pp-opinie__slider :where(.cr-review-card-inner,.cr-slider-review,.crwoo-review) p {
	color: var(--pp-text-2);
	font-family: var(--pp-font);
	font-size: var(--pp-fs-md,14px);
	line-height: 1.65;
}
.pp-opinie .pp-opinie__slider :where(.cr-review-card-inner,.cr-slider-review,.crwoo-review) a {
	color: var(--pp-text);
	text-decoration: none;
}
.pp-opinie .pp-opinie__slider :where(.cr-review-card-inner,.cr-slider-review,.crwoo-review) a:hover { color: var(--pp-orange); }
.pp-opinie .pp-opinie__slider :where(.crstar-rating,.star-rating) { color: #f59e0b; }
.pp-opinie .pp-opinie__slider .slick-dots { position: static; margin: 18px 0 0; padding: 0; }
.pp-opinie .pp-opinie__slider .slick-dots li { margin: 0 3px; }
.pp-opinie .pp-opinie__slider .slick-dots li button::before { color: #cbd5e1; opacity: 1; }
.pp-opinie .pp-opinie__slider .slick-dots li.slick-active button::before { color: var(--pp-orange); opacity: 1; }
.pp-opinie .pp-opinie__slider :where(.slick-prev,.slick-next) {
	z-index: 3;
	width: 38px;
	height: 38px;
	border: 1px solid var(--pp-border);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 6px 18px rgba(15,23,42,.12);
}
@media(max-width:760px){
	.pp-opinie .pp-opinie__slider .cr-review-card-inner,
	.pp-opinie .pp-opinie__slider .cr-slider-review > div,
	.pp-opinie .pp-opinie__slider .crwoo-review > div { min-height: 0; padding: 18px; }
	.pp-opinie .pp-opinie__slider :where(.slick-prev,.slick-next) { display: none; }
}
