/* ==========================================================================
   Compatibilità Woo Product Table 6.x / Pro 9.x (01/12/2026)
   La 3.x caricava universal.css e template.css, su cui main.css si appoggiava:
   la 6.x non li carica più e colora la tabella con variabili proprie
   (override-root.css). Qui le regole della 3.x che servono al tema, con lo
   stesso risultato di prima. Caricato dopo main.css (header.php).
   ========================================================================== */

/* variabili della 6.x: intestazione bianca, testi e link come prima */
.wpt-wrap {
	--wpt_thead_text: #fff;
	--wpt_text: inherit;
	--wpt_link: #021d33;
}

/* allineamento verticale al centro di tutte le celle (3.x universal.css) */
.wpt_product_table *,
.wpt_product_table tr > td,
.wpt_product_table td,
.wpt_product_table th {
	box-sizing: border-box;
	vertical-align: middle;
}

/* intestazione: la 6.x aggiunge wpt_column_sort al contenitore e attiva la regola
   «maiuscolo 12px» di main.css che prima non si applicava */
div.wpt_column_sort table#wpt_table.wpt_product_table tr > th {
	text-transform: none;
	font-size: 14px;
}
.custom_table thead .wpt_table_header_row th {
	color: #fff;
}

/* righe (3.x template.css, tema custom_table) */
.custom_table tbody tr td {
	border: 1px solid #fff;
}
div.wpt_product_table_wrapper table.wpt_product_table tbody tr.wpt_row > td {
	border-left: 0 none;
	border-right: 0 none;
}
@media only screen and (min-width: 761px) {
	table.custom_table > tbody > tr:nth-child(2n+2) > td {
		background-color: #f5f5f587;
	}
}
table.custom_table tbody tr:nth-child(2n+2) td input {
	background: #fff;
}
.custom_table .wpt_row td img {
	height: auto;
	margin: 0 auto;
}
td.wpt_thumbnails img {
	cursor: pointer;
}
table.custom_table tbody td a {
	color: #021d33;
	font-weight: bold;
}

/* quantità al centro (3.x) */
table.wpt_product_table tr.wpt_row td.wpt_quantity {
	text-align: center;
}

/* varianti (3.x universal.css) */
.wpt_varition_section select {
	display: inline-block;
	min-width: 120px;
	padding-left: 16px;
	border: 1px solid #a9a1a1;
	margin: 1px;
}
.wpt_product_table .variation-wrapper label {
	min-width: 60px;
	display: inline-block;
	font-weight: 600;
}
.wpt_product_table .variation-wrapper a.reset_variations {
	display: inline-block;
}

/* pulsante carrello: icona WooCommerce a sinistra (3.x template.css, add_cart_left_icon) */
a.button.wpt_woo_add_cart_button {
	position: relative;
	display: inline-block;
}
.custom_table tbody tr a.button,
.custom_table tbody tr a.button.adding,
.custom_table tbody tr a.button.alt.wc-variation-selection-needed,
.custom_table tbody tr a.button.adding.wc-variation-selection-needed,
.custom_table tbody tr a.button.disabled,
.custom_table tbody tr a.button.alt.disabled {
	color: #fff;
	border-radius: 5px;
	font-weight: bold;
}
table.add_cart_left_icon tr .wpt_action a.button::before {
	content: "\e01d";
	z-index: 99999;
	font-family: WooCommerce;
	padding: 0;
	position: static;
	font-size: 76%;
	margin-right: 5px;
}

/* carrello flottante: la 3.x lo mostrava solo con il carrello non vuoto (hide_for_zerro), la 6.x sempre.
   Nascosto qui, lo mostra custom.js quando il totale non è zero */
.wpt-footer-cart-wrapper {
	display: none;
}
.wpt-footer-cart-wrapper.nw-pieno {
	display: block;
}
.wpt-new-footer-cart.wpt-foooter-cart-stats-empty {
	display: none;
}

/* testo delle celle come la 3.x (eredita dal tema: 14px light, codice prodotto in grassetto) */
.wpt-wrap .wpt-table-tag.wpt_product_table,
.wpt-wrap .wpt-table-tag.wpt_product_table .wpt-tbody-tag .wpt-tr-tag {
	font-size: 14px;
	font-weight: 300;
	line-height: 21px;
	box-shadow: none;
	background-color: #fff;
}
.wpt-wrap .wpt-table-tag.wpt_product_table .wpt-tbody-tag .wpt-td-tag {
	font-size: 14px;
	font-weight: 300;
	line-height: 21px;
}
.wpt-wrap .wpt-table-tag.wpt_product_table .wpt-tbody-tag .wpt-td-tag.wpt_sku {
	font-weight: 700;
}
.wpt-wrap .wpt-table-tag.wpt_product_table .wpt_total_item strong {
	font-weight: 400;
}

/* celle: padding del tema (5px), la 6.x mette 10px con un selettore più forte */
.wpt-wrap .wpt-tr-tag.wpt-row > .wpt-td-tag {
	padding: 5px;
}
.wpt-wrap .wpt-table-tag .wpt_thumbnails img {
	border-radius: 0;
}

/* intestazione: grassetto e altezza come prima */
.wpt-wrap .wpt-tr-tag.wpt_table_header_row.wpt_table_head .wpt-th-tag {
	font-weight: 700;
	line-height: 21px;
}

/* quantità «- 1 +» su una riga: la 6.x aggiunge due contenitori (.tag_or_div > .welcome-to-all) */
.wpt_product_table td.wpt_quantity .tag_or_div,
.wpt_product_table td.wpt_quantity .welcome-to-all {
	display: block;
	width: 100%;
}
.wpt_product_table td.wpt_quantity .qib-button.wcmmq_qib_button {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: center;
}

/* I fogli della 6.x (base-template, universal, modello) sono stampati nel footer, dopo questo file:
   a parità di specificità vincerebbero loro. Le regole che li contrastano hanno «html body» davanti. */
html body .wpt-wrap .wpt-tr-tag.wpt-row > .wpt-td-tag {
	padding: 5px;
}
html body .wpt-wrap .wpt-table-tag.wpt_product_table,
html body .wpt-wrap .wpt-table-tag.wpt_product_table .wpt-tbody-tag .wpt-tr-tag,
html body .wpt-wrap .wpt-table-tag.wpt_product_table .wpt-tbody-tag .wpt-td-tag {
	color: #222;
	box-shadow: none;
}
html body .wpt-wrap .wpt-table-tag.wpt_product_table .wpt-tbody-tag .wpt-tr-tag:nth-child(2n+1) {
	background-color: transparent;
}
html body .wpt-wrap .wpt-table-tag .wpt_thumbnails img {
	border-radius: 0;
}
html body .wpt-wrap .wpt_varition_section select {
	border: 1px solid #a9a1a1;
}
html body .wpt-wrap .wpt_quantity input.input-text.qty.text {
	padding: 1px 2px;
	border-radius: 0;
	font-size: 14px;
	line-height: 21px;
}

html body .wpt-wrap .wpt-table-tag .wpt_thumbnails img {
	border-radius: 0 !important;
}
html body .wpt-wrap .wpt_action a.button.wpt_woo_add_cart_button {
	line-height: 18px !important;
	height: 38px;
	box-sizing: border-box;
}
/* il plugin mette «always_show» sul carrello flottante: lo nascondiamo comunque finché è vuoto */
html body .wpt-footer-cart-wrapper:not(.nw-pieno) {
	display: none !important;
}
/* pulsante disattivato finché non si sceglie la variante (aspetto della 3.x): la 6.x non mette «disabled»
   al caricamento e aggiunge «enabled» dopo la scelta */
html body .wpt-wrap .wpt_action a.button.wpt_woo_add_cart_button.disabled,
html body .wpt-wrap .wpt_action a.button.wpt_woo_add_cart_button.wpt_variation_product:not(.enabled) {
	opacity: .5;
	cursor: not-allowed;
}

/* ---------- mobile e tablet ----------
   La 3.x mostrava ogni campo con l'etichetta della colonna a sinistra (Pro: .col_inside_tag.autoresponsive-label-show::before
   con attr(data-title)). Nella 6.x il contenitore si chiama .item_inside_cell e le etichette non ci sono più. */
@media screen and (max-width: 992px) {
	.wpt_product_table.mobile_responsive .item_inside_cell.autoresponsive-label-show {
		padding-left: 35%;
		position: relative;
		min-height: 21px;
	}
	.wpt_product_table.mobile_responsive .item_inside_cell.autoresponsive-label-show::before {
		content: attr(data-title);
		display: block;
		position: absolute;
		top: 4px;
		left: 0;
		width: 50%;
		font-weight: 600;
		text-align: left;
		color: #383838;
	}
	.wpt_product_table.mobile_responsive .item_inside_cell.wpt_action.autoresponsive-label-show {
		padding-left: 0;
		text-align: right;
		justify-content: flex-end;
	}
	/* bordo della scheda: la 6.x lo colora con var(--wpt_btn_bg) e !important */
	.wpt-auto-responsive.wpt-wrap {
		--wpt_btn_bg: #ddd;
	}
	.wpt_product_table.mobile_responsive .item_inside_cell.wpt_action.autoresponsive-label-show::before {
		content: none;
	}
	.wpt_product_table.mobile_responsive .item_inside_cell.wpt_quantity .qib-button.wcmmq_qib_button {
		justify-content: flex-start;
	}
}
@media screen and (max-width: 767px) {
	html body .wpt-wrap table.wpt_product_table.mobile_responsive .wpt-tbody-tag .wpt-tr-tag.wpt_row {
		border: 1px solid #ddd;
		margin: 0 0 5px;
	}
	html body .wpt-wrap table.wpt_product_table.mobile_responsive .wpt-tr-tag.wpt-row > .wpt-td-tag {
		padding: 5px 5px 5px 8px;
	}
	html body .wpt-wrap table.wpt_product_table.mobile_responsive .wpt-tr-tag.wpt-row > .wpt-td-tag.wpt_action {
		text-align: right;
		padding-right: 10px;
	}
	/* righe senza valore (opzioni dei prodotti semplici, totale dei variabili prima della scelta): l'etichetta resta, come prima */
	html body .wpt-wrap .wpt-table-tag.wpt_product_table .wpt-tbody-tag .wpt-td-tag.wpt_sku {
		font-weight: 300;
	}
}

/* intestazioni che vanno a capo come nella 3.x (la 6.x le tiene su una riga: colonne Codice e Unità più larghe) */
html body .wpt-wrap .wpt-tr-tag.wpt_table_header_row .wpt-th-tag {
	white-space: normal !important;
}

/* intestazioni a 14px: la regola di main.css si agganciava a .wpt_column_sort, che ora (wpt9.php) non c'è più */
html body .wpt-wrap .wpt-tr-tag.wpt_table_header_row .wpt-th-tag {
	font-size: 14px;
	text-transform: none;
}

/* ricerca come nella 3.x: «Keyword» e «Categorie» affiancati a metà, testo 12px, elenco categorie basso, nessun pulsante di reset */
html body .wpt_search_box .search_box_wrapper {
	font-size: 12px;
	flex-wrap: nowrap;
}
html body .wpt_search_box .search_box_wrapper > .search_single {
	flex: 0 0 50%;
	width: 50%;
	max-width: 50%;
}
html body .wpt_search_box .search_single_direct .search_single_search_by_keyword {
	width: 100%;
}
html body .wpt_search_box .search_single_direct input.query_box_direct_value {
	width: 100%;
}
html body .wpt_search_box .wpt-query-reset-button {
	display: none !important;
}
html body .wpt_search_box select.search_select {
	display: inline-block;
	font-size: 12px;
	height: 70px;
	width: calc(100% - 11px);
	margin-left: 5px;
}

/* paginazione come nella 3.x: la pagina corrente ora è uno <span> (main.css colora solo a.page-numbers.current) e la 6.x
   la fa azzurra e più grande */
html body .wpt_table_pagination .page-numbers {
	font-size: 13px !important;
	padding: 5px 10px !important;
	color: #000 !important;
	border: 1px solid #a9a9a9 !important;
	background-color: transparent !important;
}
html body .wpt_table_pagination .page-numbers.current,
html body .wpt_table_pagination .page-numbers:hover,
html body .wpt_table_pagination .page-numbers:focus {
	color: #fff !important;
	border-color: #d20a10 !important;
	background-color: #d20a10 !important;
}

/* ricerca: «Keyword» in alto, allineata a «Categorie» */
html body .wpt_search_box .search_box_wrapper > .search_single_direct {
	align-items: flex-start !important;
}
/* contenitore della ricerca: nella 6.x è flex con a capo e il blocco interno sborda (su mobile 370px in 330) */
html body .wpt_search_box .search_box_fixer {
	display: block !important;
}
html body .wpt_search_box select.search_select {
	display: inline-block !important;
	width: calc(100% - 11px) !important;
	padding: 2px !important;
}
html body .wpt_search_box .search_box_wrapper > .search_single {
	min-width: 0 !important;
}
html body .wpt_search_box .search_single_direct input.query_box_direct_value {
	margin-top: 0 !important;
	max-width: 100%;
}
/* riquadro e titolo della ricerca come nella 3.x (24px, testo 12px light, margini) */
html body .wpt_search_box {
	font-size: 12px !important;
	font-weight: 300 !important;
	padding: 5px 0 !important;
	margin: 0 0 22px !important; /* 5px + lo spazio che nella 3.x c'era fra ricerca e tabella */
}
html body .wpt_search_box .search_box_label {
	font-size: 24px !important;
	line-height: 16px !important;
}
html body .wpt_search_box .search_keyword_label {
	line-height: 21px !important;
	margin: 0 !important;
}
html body .wpt_search_box .search_box_wrapper > .search_single_direct {
	margin: 10px 0 24px !important;
}
html body .wpt_search_box .search_box_wrapper > .search_single_texonomy {
	margin: 10px 0 0 !important;
}
