/* Trucillo Recensioni — widget in stile Judge.me */
:root { --trr-accent: #d12420; }

.trr-stars { display: inline-flex; gap: 1px; color: var(--trr-accent); vertical-align: middle; line-height: 1; }
.trr-star { display: block; flex: 0 0 auto; }

/* ---------- Widget ---------- */
.trr-widget {
	border: 0;
	padding: 24px 0;
	margin: 40px 0;
	color: #000;
	font-size: 15px;
	line-height: 1.4;
	clear: both;
}
.trr-widget *, .trr-order-page * { box-sizing: border-box; }
.trr-widget [hidden], .trr-order-page [hidden] { display: none !important; }

.trr-title {
	font-weight: 400;
	font-size: 24.4px;
	margin: 0 0 8px;
	letter-spacing: 0;
}
.trr-header { text-align: left; }
.trr-header__row { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.trr-summary__stars { margin-bottom: 2px; }
.trr-summary__text { font-size: 15px; }

.trr-actions { width: 100%; margin: 12px 0 18px; }
.trr-write-btn {
	display: block;
	width: 100%;
	background: #fff;
	color: #000;
	border: 1px solid #000;
	border-radius: 0;
	font: inherit;
	font-size: 15px;
	line-height: 21px;
	padding: 5px 10px;
	cursor: pointer;
	text-align: center;
	box-shadow: none;
}
.trr-write-btn:hover, .trr-write-btn:focus { background: #000; color: #fff; }

.trr-histogram { display: flex; flex-direction: column; gap: 3px; margin: 0 0 20px; }
.trr-histogram__row {
	display: flex; align-items: center; gap: 6px;
	background: none; border: 0; padding: 3px 0; margin: 0;
	font: inherit; font-size: 12px; color: #000; cursor: pointer; text-align: left;
	box-shadow: none; line-height: 1;
}
.trr-histogram__row:hover .trr-histogram__bar, .trr-histogram__row.is-active .trr-histogram__bar { outline: 1px solid #000; }
.trr-histogram__row:hover, .trr-histogram__row:focus { background: none; color: #000; }
.trr-histogram__bar { position: relative; display: block; width: 120px; height: 18px; border: 1px solid #eee; background: #fff; }
.trr-histogram__bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--trr-accent); }
.trr-histogram__pct { width: 34px; }
.trr-histogram__count { min-width: 28px; }

.trr-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #eee; }
.trr-widget select.trr-sort {
	width: auto; min-width: 180px; max-width: 100%;
	height: 40px; font: inherit; font-size: 12px;
	border: 1px solid #ddd; border-radius: 4.8px; background-color: transparent;
	padding: 0 34px 0 10px; box-shadow: none;
}
.trr-clear-filter { background: none; border: 0; padding: 0; color: #000; text-decoration: underline; font: inherit; font-size: 12px; cursor: pointer; box-shadow: none; }

.trr-notice { margin: 0 0 16px; padding: 12px 14px; background: #f6f6f6; border-left: 3px solid var(--trr-accent); }
.trr-notice--error { border-left-color: #b00; background: #fff4f4; }

/* ---------- Singola recensione ---------- */
.trr-rev { display: grid; grid-template-columns: minmax(110px, 33%) 1fr; gap: 0 20px; border-top: 1px solid #eee; padding-top: 16px; margin-top: 16px; }
.trr-toolbar + .trr-list .trr-rev:first-child { border-top: 0; }
.trr-rev__meta { display: flex; flex-direction: column; gap: 4px; }
.trr-rev__date { font-size: 15px; }
.trr-rev__head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.trr-badge { display: inline-block; background: #000; color: #fff; font-size: 11px; line-height: 1.3; padding: 3px 7px; }
.trr-rev__author { font-weight: 700; font-size: 15px; }
.trr-rev__title { display: block; font-size: 17px; margin: 4px 0 4px; font-weight: 700; }
.trr-rev__body { line-height: 21px; overflow-wrap: anywhere; }
.trr-rev__body p { margin: 0 0 8px; }
.trr-rev__body p:last-child { margin-bottom: 0; }
.trr-rev__pics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.trr-rev__pic img { display: block; width: 80px; height: 80px; object-fit: cover; border: 1px solid #eee; }
.trr-rev__reply { margin-top: 12px; padding: 10px 14px; background: #f7f7f7; border-left: 2px solid #000; font-size: 14px; }
.trr-rev__reply-head { font-weight: 700; margin-bottom: 4px; }
.trr-rev__reply-body p { margin: 0 0 6px; }
.trr-rev__reply-body p:last-child { margin: 0; }
.trr-rev.is-hidden { display: none; }
.trr-empty-filter { margin: 16px 0 0; }

/* ---------- Paginazione ---------- */
.trr-pagination { display: flex; justify-content: center; gap: 4px; margin-top: 20px; flex-wrap: wrap; }
.trr-pagination:empty { display: none; }
.trr-pagination button {
	min-width: 32px; height: 32px; padding: 0 8px; border: 0; background: none;
	font: inherit; font-size: 14px; color: #000; cursor: pointer; box-shadow: none;
}
.trr-pagination button[aria-current="page"] { font-weight: 700; text-decoration: underline; }
.trr-pagination button:hover { background: #f2f2f2; color: #000; }

/* ---------- Lightbox ---------- */
.trr-lightbox { position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; padding: 30px; }
.trr-lightbox img { max-width: 100%; max-height: 100%; }
.trr-lightbox__close { position: absolute; top: 12px; right: 16px; background: none; border: 0; color: #fff; font-size: 36px; line-height: 1; cursor: pointer; }

/* ---------- Moduli ---------- */
.trr-form { border-top: 1px solid #eee; margin: 0 0 20px; padding-top: 20px; }
.trr-form__title { font-size: 18px; margin: 0 0 14px; font-weight: 400; }
.trr-field { margin-bottom: 14px; }
.trr-label { display: block; font-size: 13px; margin-bottom: 5px; }
.trr-widget input[type="text"], .trr-widget input[type="email"], .trr-widget textarea,
.trr-order-page input[type="text"], .trr-order-page input[type="email"], .trr-order-page textarea {
	width: 100%; border: 1px solid #ddd; border-radius: 0; padding: 9px 10px; font: inherit; font-size: 15px; background: #fff; box-shadow: none; height: auto;
}
.trr-widget textarea, .trr-order-page textarea { min-height: 110px; resize: vertical; }
.trr-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.trr-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.trr-form__error { color: #b00; margin: 0 0 12px; }
.trr-form__buttons { display: flex; justify-content: flex-end; gap: 10px; }

.trr-btn { display: inline-block; border-radius: 0; padding: 9px 22px; font: inherit; font-size: 15px; cursor: pointer; text-decoration: none; text-align: center; box-shadow: none; }
.trr-btn--primary { background: var(--trr-accent); color: #fff; border: 1px solid var(--trr-accent); }
.trr-btn--primary:hover, .trr-btn--primary:focus { background: #000; border-color: #000; color: #fff; }
.trr-btn--ghost { background: #fff; color: #000; border: 1px solid #000; }
.trr-btn--ghost:hover { background: #f2f2f2; color: #000; }
.trr-btn--large { padding: 13px 32px; font-size: 16px; }

/* Stelle cliccabili (CSS puro, ordine invertito nel markup) */
.trr-rating-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.trr-rating-input input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.trr-rating-input .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.trr-rating-input label { cursor: pointer; color: #ccc; margin: 0; padding: 0; line-height: 0; }
.trr-rating-input label:hover, .trr-rating-input label:hover ~ label,
.trr-rating-input input:checked ~ label { color: var(--trr-accent); }
.trr-rating-input input:focus-visible + label { outline: 2px solid #000; outline-offset: 2px; }

/* ---------- Stelle catalogo e scheda ---------- */
.trr-loop-badge { margin: 2px 0 6px; line-height: 0; }
.trr-summary-badge { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; color: #000; text-decoration: none; font-size: 14px; }
.trr-summary-badge:hover { text-decoration: underline; color: #000; }

/* ---------- Pagina recensione da mail ---------- */
.trr-page { padding-top: 30px; padding-bottom: 60px; }
.trr-order-page { max-width: 760px; margin: 0 auto; }
.trr-page__title { margin-bottom: 10px; }
.trr-page__intro { margin-bottom: 26px; }
.trr-page__subtitle { margin: 30px 0 16px; font-size: 20px; }
.trr-order-item { border: 1px solid #eee; padding: 20px; margin: 0 0 18px; display: grid; grid-template-columns: 120px 1fr; gap: 20px; min-width: 0; }
.trr-order-item__product img { width: 120px; height: auto; display: block; margin-bottom: 8px; }
.trr-order-item__product { min-width: 0; }
.trr-order-item__name { font-weight: 700; font-size: 14px; line-height: 1.35; margin: 0; padding: 0; overflow-wrap: anywhere; hyphens: auto; }
.trr-order-name { max-width: 360px; margin-top: 8px; }

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
	.trr-header { text-align: center; }
	.trr-header__row { align-items: center; }
	.trr-actions { width: auto; margin: 14px 0 18px; }
	.trr-write-btn { display: inline-block; width: auto; }
	.trr-histogram { margin-bottom: 24px; }
	.trr-rev__meta { flex-direction: row; align-items: center; gap: 10px; align-self: start; }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
	.trr-widget { padding: 18px 0; }
	.trr-rev { grid-template-columns: 1fr; gap: 6px; }
	.trr-rev__meta { flex-direction: row; align-items: center; gap: 10px; }
	.trr-field-row { grid-template-columns: 1fr; }
	.trr-order-item { grid-template-columns: 1fr; }
	.trr-order-item__product { display: flex; gap: 12px; align-items: center; }
	.trr-order-item__product img { width: 70px; margin: 0; }
	.trr-form__buttons { flex-direction: column-reverse; }
	.trr-form__buttons .trr-btn { width: 100%; }
}

/* ---------- Larghezza allineata al contenuto del tema (Shoptimizer .col-full) ---------- */
.related-wrapper > .trr-widget { max-width: 1170px; margin-left: auto; margin-right: auto; }
@media (min-width: 993px) { .related-wrapper > .trr-widget { width: calc(100% - 5.235848em); } }
@media (max-width: 992px) { .related-wrapper > .trr-widget { margin-left: 1em; margin-right: 1em; } }
