/* DM Cus Tabelle Prodotti (Sabianlab) */

.dmcus-tab {
	--dm-blu: #004799;
	--dm-arancio: #fd8333;
	--dm-testo: #333;
	--dm-grigio: #f6f6f6;
	--dm-bordo: #dde3ec;
	--dm-evid: #edf2f9;
	--dm-alt: #f8f9fb;
	--dm-hover: #fff1e6;
	--dm-gruppo: #9fb3cf;
	--dm-etichetta: #5d6b7e;
	color: var(--dm-testo);
	font-size: 13px;
	line-height: 1.4;
	margin: 24px 0 40px;
	text-align: left;
}

.dmcus-tab *,
.dmcus-tab *::before,
.dmcus-tab *::after {
	box-sizing: border-box;
}

.dmcus-tab + .dmcus-tab {
	margin-top: -8px;
}

/* La riga del disegno dei cilindri era fissa in alto per tenere in vista la vecchia testata, che stava
   separata dalla tabella: con la tabella nuova la testata resta in vista da sola e il disegno scorre. */
.l-section.type_sticky:has(#imgMain) {
	position: relative !important;
	top: auto !important;
}

/* Filtri */

.dmcus-tab__filtri {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px 16px;
	padding: 16px;
	margin: 0 0 12px;
	background: var(--dm-grigio);
	border-top: 3px solid var(--dm-arancio);
}

.dmcus-tab__filtro {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 170px;
	margin: 0;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--dm-blu);
}

.dmcus-tab__filtro select {
	height: 40px;
	width: 100%;
	margin: 0;
	padding: 0 34px 0 10px;
	border: 1px solid var(--dm-blu);
	border-radius: 0;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23004799' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
	color: var(--dm-testo);
	font: inherit;
	font-size: 15px;
	font-weight: normal;
	letter-spacing: 0;
	text-transform: none;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.dmcus-tab__filtro select:focus-visible,
.dmcus-tab__azzera:focus-visible,
.dmcus-tab__scorri:focus-visible,
.dmcus-tab .c-apri button:focus-visible {
	outline: 2px solid var(--dm-blu);
	outline-offset: 2px;
}

.dmcus-tab__info {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-left: auto;
	min-height: 40px;
}

.dmcus-tab__conteggio {
	margin: 0;
	padding: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--dm-blu);
}

.dmcus-tab__azzera {
	padding: 0;
	border: 0;
	background: none;
	color: var(--dm-blu);
	font: inherit;
	font-size: 14px;
	text-decoration: underline;
	text-transform: none;
	cursor: pointer;
}

.dmcus-tab__azzera:hover {
	color: #c4560f;
}

.dmcus-tab__vuoto {
	margin: 0;
	padding: 24px 16px;
	border: 1px solid var(--dm-bordo);
	text-align: center;
	font-size: 15px;
}

/* Tabella (computer) */

.dmcus-tab__scorri {
	max-height: 75vh;
	overflow: auto;
	border: 1px solid var(--dm-bordo);
	-webkit-overflow-scrolling: touch;
}

.dmcus-tab--accessori .dmcus-tab__scorri {
	max-height: none;
}

.dmcus-tab--semplice {
	max-width: 640px;
	margin-left: auto;
	margin-right: auto;
}

.dmcus-tab table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: separate;
	border-spacing: 0;
	font-variant-numeric: tabular-nums;
}

.dmcus-tab table caption {
	caption-side: top;
	padding: 12px 12px 10px;
	background: #fff;
	color: var(--dm-blu);
	font-size: 15px;
	font-weight: 600;
	text-align: left;
}

.dmcus-tab table th,
.dmcus-tab table td {
	padding: 7px 6px;
	border: 0;
	border-right: 1px solid var(--dm-bordo);
	border-bottom: 1px solid var(--dm-bordo);
	background: #fff;
	color: var(--dm-testo);
	font-family: inherit;
	font-size: 13px;
	font-weight: normal;
	letter-spacing: 0;
	line-height: 1.35;
	text-align: center;
	text-transform: none;
	vertical-align: middle;
	white-space: nowrap;
}

.dmcus-tab table tr > *:last-child {
	border-right: 0;
}

.dmcus-tab--accessori table th,
.dmcus-tab--accessori table td {
	padding: 8px 10px;
	font-size: 14px;
}

.dmcus-tab thead {
	position: sticky;
	top: 0;
	z-index: 3;
}

.dmcus-tab table thead th {
	background: var(--dm-blu);
	color: #fff;
	font-weight: 600;
	border-right-color: rgba(255, 255, 255, .2);
	border-bottom: 0;
}

.dmcus-tab table tbody th {
	font-weight: 600;
	text-align: left;
	padding-left: 10px;
	padding-right: 10px;
}

/* codice sempre visibile scorrendo in orizzontale */
.dmcus-tab table .c-cod {
	position: sticky;
	left: 0;
	z-index: 1;
	border-right: 0;
	box-shadow: 1px 0 0 var(--dm-bordo);
	text-align: left;
}

.dmcus-tab table thead .c-cod {
	z-index: 4;
	box-shadow: 1px 0 0 rgba(255, 255, 255, .2);
}

.dmcus-tab tbody tr.alt > *,
.dmcus-tab--accessori tbody tr:nth-child(even) > * {
	background: var(--dm-alt);
}

.dmcus-tab tbody .c-filtro,
.dmcus-tab tbody tr.alt > .c-filtro {
	background: var(--dm-evid);
}

.dmcus-tab tbody tr:hover > * {
	background: var(--dm-hover);
}

.dmcus-tab tbody tr.inizio-gruppo > * {
	border-top: 2px solid var(--dm-gruppo);
}

.dmcus-tab .solo-mobile {
	display: none;
}

.dmcus-tab tbody tr[hidden] {
	display: none !important;
}

/* Cellulare */

@media (max-width: 760px) {

	.dmcus-tab__filtri {
		display: grid;
		grid-template-columns: 1fr 1fr;
		padding: 12px;
	}

	.dmcus-tab__filtro {
		min-width: 0;
	}

	.dmcus-tab__filtro:nth-child(3) {
		grid-column: 1 / -1;
	}

	.dmcus-tab__info {
		grid-column: 1 / -1;
		justify-content: space-between;
		margin: 0;
		min-height: 0;
	}

	.dmcus-tab--semplice table th,
	.dmcus-tab--semplice table td {
		white-space: normal;
	}

	/* schede: una per riga */

	.dmcus-tab--schede .dmcus-tab__scorri {
		max-height: none;
		overflow: visible;
		border: 0;
	}

	.dmcus-tab--schede table,
	.dmcus-tab--schede tbody {
		display: block;
		width: 100%;
	}

	.dmcus-tab--schede table caption {
		display: block;
		padding: 0 0 10px;
	}

	.dmcus-tab--schede thead {
		display: none;
	}

	.dmcus-tab--schede tbody tr {
		display: grid;
		grid-template-columns: repeat(12, 1fr);
		gap: 10px 8px;
		margin: 0 0 10px;
		padding: 14px 14px 12px;
		border: 1px solid var(--dm-bordo);
		border-left: 4px solid var(--dm-blu);
		background: #fff;
	}

	.dmcus-tab--schede tbody tr.inizio-gruppo {
		margin-top: 18px;
	}

	.dmcus-tab--schede table tbody tr > * {
		display: block;
		position: static;
		padding: 0;
		border: 0;
		box-shadow: none;
		background: none;
		text-align: left;
		white-space: normal;
		font-size: 15px;
	}

	.dmcus-tab--schede table tbody tr.alt > *,
	.dmcus-tab--schede table tbody tr:hover > *,
	.dmcus-tab--schede table tbody tr:nth-child(even) > *,
	.dmcus-tab--schede table tbody tr > .c-filtro,
	.dmcus-tab--schede table tbody tr.alt > .c-filtro,
	.dmcus-tab--schede table tbody tr.inizio-gruppo > * {
		background: none;
		border: 0;
	}

	.dmcus-tab--schede tbody td[data-label]::before {
		content: attr(data-label);
		display: block;
		margin-bottom: 2px;
		font-size: 11px;
		font-weight: 600;
		letter-spacing: .03em;
		text-transform: uppercase;
		color: var(--dm-etichetta);
	}

	.dmcus-tab--schede table tbody .c-cod {
		grid-column: 1 / -1;
		order: 1;
		border: 0;
		box-shadow: none;
		font-size: 17px;
		font-weight: 600;
		color: var(--dm-blu);
	}

	.dmcus-tab--schede tbody .c-val {
		grid-column: span 4;
		order: 3;
	}

	/* cilindri: codice, poi A, S e C, poi le altre misure con il pulsante */

	.dmcus-tab--cilindri tbody .c-filtro {
		grid-column: span 4;
		order: 3;
		font-weight: 600;
	}

	.dmcus-tab--cilindri tbody .c-apri {
		display: block;
		grid-column: 1 / -1;
		order: 7;
	}

	.dmcus-tab .c-apri button {
		width: 100%;
		margin: 2px 0 0;
		padding: 9px 12px;
		border: 1px solid var(--dm-blu);
		border-radius: 0;
		background: #fff;
		color: var(--dm-blu);
		font: inherit;
		font-size: 14px;
		font-weight: 600;
		line-height: 1.3;
		text-align: left;
		text-transform: none;
		box-shadow: none;
		cursor: pointer;
	}

	.dmcus-tab .c-apri button::after {
		content: "+";
		float: right;
		font-size: 18px;
		line-height: 1;
	}

	.dmcus-tab tr.aperta .c-apri button::after {
		content: "\2212";
	}

	.dmcus-tab--cilindri tbody .c-mis {
		display: none;
		grid-column: span 3;
		order: 8;
	}

	.dmcus-tab--cilindri tbody tr.aperta .c-mis {
		display: block;
	}
}
