/**
 * PC Precision — tema blu scuro professionale (2026-07)
 *
 * REVERT: in functions.php impostare define( 'PCP_BLUE_PALETTE_TRIAL', false );
 *
 * Palette v3 (seria, PC shop):
 *   #0D0D0D header/footer nero | #1E40AF blu scuro primario
 *   #1E3A8A navy | #172554 hover | #FFFFFF testi su scuro
 *   #DC2626 solo badge sconto (onsale)
 */

:root,
body {
	/* Token canonici v3 */
	--pcp-primary-dark: #1e3a8a;
	--pcp-primary: #1e40af;
	--pcp-text-light: #ffffff;
	--pcp-text-muted: #f3f4f6;
	--pcp-accent-cta: #1e40af;
	--pcp-accent-sale: #dc2626;
	--pcp-accent-promo: #1e40af;

	/* Alias back-compat */
	--pcp-blue-primary: var(--pcp-primary);
	--pcp-blue-secondary: #1e3a8a;
	--pcp-blue-dark: var(--pcp-primary-dark);
	--pcp-blue-muted: #64748b;
	--pcp-blue-bg: #f5f7fa;
	--pcp-blue-primary-hover: #172554;
	--pcp-blue-primary-soft: rgba(30, 64, 175, 0.1);
	--pcp-blue-primary-border: rgba(30, 64, 175, 0.22);

	/* Map onto token esistenti */
	--pcp-accent: var(--pcp-primary);
	--pcp-cart-blue: var(--pcp-primary);
	--pcp-green: var(--pcp-primary);

	/* Header/footer — NERO invariato (mai blu) */
	--pcp-black-bar: #0d0d0d;
	--pcp-header-bg: #0d0d0d;

	--wd-primary-color: var(--pcp-primary);
	--btn-accented-bgcolor: var(--pcp-accent-cta);
	--btn-accented-bgcolor-hover: var(--pcp-blue-primary-hover);
	--btn-accented-color: var(--pcp-text-light);
	--btn-accented-color-hover: #fff;

	--pcp-btn-primary: var(--pcp-primary);
	--pcp-btn-hover: var(--pcp-blue-primary-hover);
	--pcp-btn-active: var(--pcp-primary-dark);
	--pcp-btn-accent: var(--pcp-blue-secondary);
	--pcp-g-primary: var(--pcp-primary);
	--pcp-g-accent: var(--pcp-blue-secondary);

	/* Catalog tokens */
	--pcp-cat-green: var(--pcp-primary);
	--pcp-cat-green-dark: var(--pcp-primary-dark);

	/* Footer Drako */
	--pcp-df-green: var(--pcp-primary);
	--pcp-df-green-light: #93c5fd;
	--pcp-df-green-dark: var(--pcp-primary-dark);
}

body.pcp-light-pages {
	--wd-link-color-hover: var(--pcp-primary);
	background-color: var(--pcp-blue-bg) !important;
}

body.pcp-light-pages :is(
	.website-wrapper,
	.wd-page-wrapper,
	.wd-page-content,
	.main-page-wrapper,
	.wd-content-layout,
	.site-content,
	.wd-content-area,
	#main-content
) {
	background-color: var(--pcp-blue-bg) !important;
}

body.pcp-light-pages.pcp-catalog-active,
body.pcp-light-pages.pcp-catalog-active :is(
	.site-content,
	.content-area,
	.wd-content-area,
	.wd-page-content,
	.main-page-wrapper
) {
	background-color: var(--pcp-blue-bg) !important;
}

/* =============================================================================
   HEADER PROTECTION — nero #0d0d0d, mai sovrascritto dal blu accent
   ============================================================================= */
.whb-header,
.whb-header .whb-main-header,
.whb-header .whb-general-header,
.whb-header .whb-general-header.whb-color-dark,
.whb-sticky-header.whb-sticked .whb-main-header,
.whb-sticky-header.whb-sticked .whb-general-header,
.whb-top-bar,
.whb-top-bar.whb-color-light {
	background-color: #0d0d0d !important;
	border-bottom-color: rgba(255, 255, 255, 0.08) !important;
	color: #f5f5f5 !important;
}

.whb-top-bar .pcp-topbar-track,
.whb-top-bar .wd-nav-secondary > li > a,
.whb-top-bar .wd-header-text {
	color: #f5f5f5 !important;
}

/* Pulsanti accented site-wide — blu scuro */
.button.btn-accented,
.wd-btn.btn-accented,
.add_to_cart_button,
.single_add_to_cart_button,
.woocommerce .button.alt,
.wd-add-btn-replace .add-to-cart-loop,
.wd-loop-btn .add_to_cart_button {
	background-color: var(--pcp-accent-cta) !important;
	border-color: var(--pcp-accent-cta) !important;
	color: #fff !important;
}

.button.btn-accented:hover,
.wd-btn.btn-accented:hover,
.add_to_cart_button:hover,
.single_add_to_cart_button:hover,
.woocommerce .button.alt:hover {
	background-color: var(--pcp-blue-primary-hover) !important;
	border-color: var(--pcp-blue-primary-hover) !important;
}

/* Prezzi WooCommerce — blu scuro; sconto in rosso */
.woocommerce :is(.price, .amount) {
	color: var(--pcp-primary);
}

.woocommerce :is(.price ins, .price ins .amount, ins .amount) {
	color: var(--pcp-accent-sale) !important;
}

.woocommerce .price del,
.woocommerce .price del .amount {
	color: var(--pcp-blue-muted) !important;
}

/* Badge sconto — rosso (solo percentuale / onsale) */
.onsale,
.product-label.onsale,
.wd-product-label.onsale,
.wd-products .product-label.onsale,
.woocommerce span.onsale,
.product-label .sale,
.badge-sale,
.product-label span.sale {
	background-color: var(--pcp-accent-sale) !important;
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
}

/* NUOVO / PROMO / new / featured — blu scuro + testo bianco */
.product-label.featured,
.product-label.new,
.product-label.hot,
.wd-product-label.featured,
.wd-product-label.new,
.wd-product-label.hot,
.pcp-home-products__badge,
.pcp-home-products__badge--nuovo,
.pcp-home-products__badge--promo {
	background-color: var(--pcp-primary, #1e40af) !important;
	color: #ffffff !important;
	-webkit-text-fill-color: #ffffff !important;
}

.pcp-home-products__badge--bestseller,
.pcp-home-products__badge--hot {
	background-color: #b45309 !important;
	color: #ffffff !important;
	-webkit-text-fill-color: #ffffff !important;
}

/* Link attivi / hover catalogo */
:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat) .wd-filter-list .wc-layered-nav-term.wd-active a,
:is(.woocommerce-shop, .post-type-archive-product, .tax-product_cat) .product-categories li.wd-active > a,
.wd-nav-tabs > li.wd-active > a {
	color: var(--pcp-primary) !important;
	border-color: var(--pcp-primary) !important;
}

/* Caseking nav accent */
.pcp-ck-nav {
	--pcp-ck-accent: var(--pcp-primary);
}

/* Badge carrello header — SOLO cifra sul disco (non mini-cart / titoli prodotto) */
.whb-header .wd-header-cart .cart-widget-opener .wd-tools-count,
.whb-header .wd-header-cart .cart-widget-opener .wd-cart-number,
.whb-header .wd-header-cart .cart-widget-opener .wd-tools-count > span,
.whb-header .wd-header-cart .cart-widget-opener .wd-cart-number > span {
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
}

/* Scroll-to-top Woodmart */
.wd-scroll-top-btn,
.wd-scroll-top {
	background-color: var(--pcp-primary) !important;
	border-color: var(--pcp-primary) !important;
	color: #fff !important;
}

.wd-scroll-top-btn:hover,
.wd-scroll-top:hover {
	background-color: var(--pcp-blue-primary-hover) !important;
	border-color: var(--pcp-blue-primary-hover) !important;
}
