/**
 * Catalogo sonde — stili frontend.
 *
 * Il componente vive dentro il tema del cliente: eredita font e colori del sito
 * e non impone un'identità propria. Tutto ciò che si può voler cambiare passa da
 * una variabile CSS, sovrascrivibile dal widget Elementor o dal CSS del tema.
 */

.pc-catalog {
	--pc-accent: #266e26;
	--pc-ink: #1b2530;
	--pc-muted: #6b7784;
	--pc-border: #e2e6ea;
	--pc-row-hover: #f6f8f9;
	--pc-radius: 6px;

	color: var(--pc-ink);
	font-size: 15px;
	line-height: 1.5;
}

.pc-catalog *,
.pc-catalog *::before,
.pc-catalog *::after {
	box-sizing: border-box;
}

/* --- Filtro cromosomi ---------------------------------------------------- */

.pc-filter-heading {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--pc-muted);
}

.pc-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.pc-catalog .pc-pill {
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var(--pc-border);
	border-radius: 999px;
	background: #fff;
	background-image: none;
	color: var(--pc-ink);
	font: inherit;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	text-shadow: none;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.pc-catalog .pc-pill:hover,
.pc-catalog .pc-pill:focus {
	background: #fff;
	border-color: var(--pc-accent);
	color: var(--pc-accent);
}

.pc-catalog .pc-pill[aria-pressed="true"] {
	background: var(--pc-accent) !important;
	background-image: none !important;
	border-color: var(--pc-accent) !important;
	color: #fff !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

/* --- Pannelli a tendina (categoria, patologia, stato, colorazione) -------- */

.pc-filter-panels {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
}

.pc-panel {
	position: relative;
	flex: 1 1 200px;
	min-width: 0;
}

.pc-panel-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 14px;
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius);
	background: #fff;
	cursor: pointer;
	list-style: none;
	font-size: 14px;
	font-weight: 500;
}

.pc-panel-toggle::-webkit-details-marker {
	display: none;
}

.pc-panel-toggle::after {
	content: "";
	flex: none;
	width: 7px;
	height: 7px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.15s ease;
}

.pc-panel[open] .pc-panel-toggle::after {
	transform: translateY(1px) rotate(-135deg);
}

.pc-panel.is-active .pc-panel-toggle {
	border-color: var(--pc-accent);
	color: var(--pc-accent);
}

.pc-panel-count {
	flex: none;
	min-width: 20px;
	padding: 1px 6px;
	border-radius: 999px;
	background: var(--pc-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
}

.pc-panel-body {
	position: absolute;
	z-index: 20;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	max-height: 320px;
	overflow-y: auto;
	padding: 8px;
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius);
	background: #fff;
	box-shadow: 0 8px 24px rgba(16, 24, 32, 0.1);
}

.pc-check {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 8px;
	border-radius: 4px;
	font-size: 14px;
	cursor: pointer;
}

.pc-check:hover {
	background: var(--pc-row-hover);
}

.pc-check input {
	flex: none;
	margin: 0;
}

.pc-check-name {
	flex: 1 1 auto;
	min-width: 0;
}

.pc-check-count {
	flex: none;
	color: var(--pc-muted);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}

/* --- Barra strumenti ----------------------------------------------------- */

.pc-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 24px 0 12px;
}

.pc-search {
	flex: 1 1 260px;
}

.pc-search-input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius);
	background: #fff;
	font: inherit;
	font-size: 14px;
}

.pc-search-input:focus {
	border-color: var(--pc-accent);
	outline: none;
}

.pc-count {
	margin: 0;
	color: var(--pc-muted);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

.pc-count-shown {
	font-weight: 600;
	color: var(--pc-ink);
}

.pc-reset {
	padding: 8px 14px;
	border: 1px solid var(--pc-accent);
	border-radius: var(--pc-radius);
	background: #fff;
	color: var(--pc-accent);
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.12s ease, color 0.12s ease;
}

.pc-reset:hover {
	background: var(--pc-accent);
	color: #fff;
}

/* --- Tabella ------------------------------------------------------------- */

.pc-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: auto;
}

.pc-table thead th {
	padding: 12px 14px;
	border-bottom: 2px solid var(--pc-border);
	background: transparent;
	color: var(--pc-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-align: left;
	white-space: nowrap;
}

.pc-sort {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	cursor: pointer;
}

.pc-sort:hover {
	color: var(--pc-accent);
}

.pc-sort-icon::after {
	content: "\2195";
	font-size: 11px;
	opacity: 0.6;
}

.pc-table th[aria-sort="ascending"] .pc-sort-icon::after {
	content: "\2191";
	opacity: 1;
}

.pc-table th[aria-sort="descending"] .pc-sort-icon::after {
	content: "\2193";
	opacity: 1;
}

.pc-table tbody td {
	padding: 14px;
	border-bottom: 1px solid var(--pc-border);
	vertical-align: middle;
}

.pc-table tbody tr:hover td {
	background: var(--pc-row-hover);
}

.pc-col-code {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	color: var(--pc-muted);
}

.pc-col-name a {
	color: var(--pc-accent);
	font-weight: 500;
	text-decoration: none;
}

.pc-col-name a:hover {
	text-decoration: underline;
}

.pc-location {
	display: block;
	margin-top: 2px;
	color: var(--pc-muted);
	font-size: 13px;
}

/* --- Pallini e badge ----------------------------------------------------- */

.pc-dot {
	display: inline-block;
	flex: none;
	width: 14px;
	height: 14px;
	margin-right: 3px;
	border-radius: 50%;
	background: var(--pc-dot, #9aa3ab);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
	vertical-align: middle;
}

.pc-badge {
	display: inline-block;
	margin: 2px 3px 2px 0;
	padding: 3px 9px;
	border-radius: 999px;
	background: #eef1f3;
	color: #3c4a57;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

.pc-badge-ivdd {
	background: #e6f0ff;
	color: #16457c;
}

.pc-badge-ivdr {
	background: #e3f5ec;
	color: #16603c;
}

.pc-badge-ruo {
	background: #fdeee2;
	color: #8a4415;
}

/* --- Riepilogo filtri attivi --------------------------------------------- */

.pc-active {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 4px 0 16px;
	padding: 12px 14px;
	border: 1px solid var(--pc-border);
	border-left: 3px solid var(--pc-accent);
	border-radius: var(--pc-radius);
	background: var(--pc-row-hover);
}

.pc-active-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--pc-muted);
}

.pc-active-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.pc-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 6px 4px 11px;
	border: 1px solid var(--pc-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--pc-accent);
	font: inherit;
	font-size: 13px;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.12s ease, color 0.12s ease;
}

.pc-chip:hover,
.pc-chip:focus-visible {
	background: var(--pc-accent);
	color: #fff;
}

.pc-chip-x {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 17px;
	height: 17px;
	border-radius: 50%;
	background: currentColor;
	font-size: 12px;
	line-height: 1;
}

.pc-chip-x::before {
	content: "\00d7";
	color: #fff;
}

.pc-chip:hover .pc-chip-x::before,
.pc-chip:focus-visible .pc-chip-x::before {
	color: var(--pc-accent);
}

/* --- Anteprima al passaggio del mouse ------------------------------------ */

.pc-preview {
	position: fixed;
	z-index: 999;
	max-width: 360px;
	padding: 8px;
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius);
	background: #fff;
	box-shadow: 0 12px 32px rgba(16, 24, 32, 0.18);
	pointer-events: none;
}

.pc-preview img {
	display: block;
	width: 100%;
	max-width: 344px;
	height: auto;
	border-radius: 3px;
}

.pc-row.has-preview .pc-col-name a::after {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-left: 6px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.35;
	vertical-align: middle;
}

/* --- Stati vuoti e paginazione ------------------------------------------- */

.pc-empty {
	padding: 32px 0;
	color: var(--pc-muted);
	text-align: center;
}

.pc-pagination {
	margin-top: 20px;
	text-align: center;
}

.pc-more {
	padding: 11px 22px;
	border: 1px solid var(--pc-accent);
	border-radius: var(--pc-radius);
	background: #fff;
	color: var(--pc-accent);
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}

.pc-more:hover {
	background: var(--pc-accent);
	color: #fff;
}

/* --- Scheda prodotto ----------------------------------------------------- */

.pc-single {
	max-width: 1080px;
	margin: 0 auto;
	padding: 40px 20px 64px;
}

.pc-single-code {
	display: inline-block;
	margin-bottom: 8px;
	padding: 3px 10px;
	border-radius: 999px;
	background: #eef1f3;
	color: var(--pc-muted);
	font-size: 13px;
	font-weight: 600;
}

.pc-single-title {
	margin: 0 0 16px;
}

.pc-single-layout {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 40px;
	align-items: start;
	margin-top: 24px;
}

.pc-single-image img {
	width: 100%;
	height: auto;
	border-radius: var(--pc-radius);
}

.pc-specs {
	width: 100%;
	margin: 24px 0;
	border-collapse: collapse;
}

.pc-specs th,
.pc-specs td {
	padding: 10px 0;
	border-bottom: 1px solid var(--pc-border);
	text-align: left;
	vertical-align: top;
}

.pc-specs th {
	width: 40%;
	color: var(--pc-muted);
	font-size: 13px;
	font-weight: 600;
}

.pc-field {
	margin-bottom: 28px;
}

.pc-field-heading {
	margin: 0 0 10px;
	font-size: 18px;
}

.pc-term-label {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-right: 12px;
}

/* --- Documenti ----------------------------------------------------------- */

.pc-documents {
	margin-top: 32px;
}

.pc-documents-title {
	margin: 0 0 12px;
	font-size: 18px;
}

.pc-documents-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pc-document + .pc-document {
	margin-top: 8px;
}

.pc-document a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius);
	color: var(--pc-ink);
	text-decoration: none;
	transition: border-color 0.12s ease;
}

.pc-document a:hover {
	border-color: var(--pc-accent);
	color: var(--pc-accent);
}

.pc-document-label {
	font-weight: 500;
}

.pc-document-meta {
	flex: none;
	color: var(--pc-muted);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}

/* --- Accessibilità ------------------------------------------------------- */

.pc-catalog button:focus-visible,
.pc-catalog input:focus-visible,
.pc-catalog summary:focus-visible,
.pc-document a:focus-visible {
	outline: 2px solid var(--pc-accent);
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	.pc-catalog * {
		transition: none !important;
	}
}

/* --- Mobile: la tabella diventa un elenco di schede ---------------------- */

@media (max-width: 782px) {
	.pc-filter-chromosomes {
		margin-bottom: 16px;
	}

	.pc-catalog .pc-pill {
		height: 34px;
		min-width: 34px;
		font-size: 13px;
	}

	.pc-filter-panels {
		flex-direction: column;
		gap: 8px;
		margin-top: 0;
	}

	.pc-panel {
		flex: 1 1 auto;
	}

	/* Il corpo del pannello segue l'apertura del <details>: chiuso non occupa spazio. */
	.pc-panel-body {
		position: static;
		max-height: 280px;
		margin-top: 6px;
		box-shadow: none;
	}

	.pc-toolbar {
		gap: 10px;
		margin: 18px 0 12px;
	}

	.pc-search {
		flex: 1 1 100%;
		order: -1;
	}

	.pc-table thead {
		display: none;
	}

	.pc-table,
	.pc-table tbody,
	.pc-table tr,
	.pc-table td {
		display: block;
		width: 100%;
	}

	.pc-table tbody tr {
		margin-bottom: 12px;
		border: 1px solid var(--pc-border);
		border-radius: var(--pc-radius);
		padding: 4px 0;
	}

	.pc-table tbody td {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		padding: 9px 14px;
		border-bottom: 0;
		text-align: right;
	}

	.pc-table tbody td::before {
		content: attr(data-th);
		flex: none;
		color: var(--pc-muted);
		font-size: 12px;
		font-weight: 600;
		letter-spacing: 0.03em;
		text-transform: uppercase;
		text-align: left;
	}

	.pc-table tbody tr:hover td {
		background: transparent;
	}

	.pc-col-name {
		flex-direction: column;
		align-items: flex-start !important;
		text-align: left !important;
	}

	.pc-single-layout {
		grid-template-columns: 1fr;
		gap: 24px;
	}
}
