/* =========================================================
   WOO – OVERRIDE BASE PULITO (Salient + WooCommerce)
   - Scope SOLO WooCommerce (niente impatti sul resto del sito)
   - Obiettivi:
     1) Link non gialli
     2) Bottoni primari leggibili
     3) Product name blu (Extra Color 1)
     4) Prezzi/importi blu (Extra Color 1)
   ========================================================= */


/* =====================================
   1) RESET COLORI BASE SOLO IN WOO
   - Neutralizza il giallo accent e il bianco forzato
   ===================================== */

/* Link generici nelle pagine Woo → Extra Color 1 */
body.woocommerce a,
body.woocommerce-page a {
  color: var(--nectar-extra-color-1) !important;
}

/* Bottoni Gutenberg (wp-element-button) nelle pagine Woo → testo normale, non bianco
   (non tocchiamo lo sfondo qui, così i primari possono avere il loro bg) */
body.woocommerce :where(.wp-element-button, .wp-block-button__link),
body.woocommerce-page :where(.wp-element-button, .wp-block-button__link) {
  color: var(--nectar-text-color, #222) !important;
}

/* Bottoni HTML classici nelle pagine Woo → testo normale (background lo diamo dopo ai primari) */
body.woocommerce button[type=submit],
body.woocommerce input[type=button],
body.woocommerce input[type=submit],
body.woocommerce-page button[type=submit],
body.woocommerce-page input[type=button],
body.woocommerce-page input[type=submit] {
  color: var(--nectar-text-color, #222) !important;
}



/* =====================================
   2) BOTTONI PRIMARI
   - es: Aggiungi al carrello, Procedi al pagamento, Effettua ordine
   - bg: accent-color
   - testo: text-color
   - hover bg: extra-color-3
   - NON tocco padding, radius, bordi = lascio quelli del tema
   ===================================== */

/* Stato normale */
body.woocommerce .single_add_to_cart_button,
body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
body.woocommerce .woocommerce-message a.button,
body.woocommerce .wc-block-cart__submit-button,
.wp-block-woocommerce-checkout .wc-block-components-checkout-place-order-button,
body.woocommerce a.button.checkout.wc-forward,
body.woocommerce button.checkout.wc-forward {
  background-color: var(--nectar-accent-color) !important;
  color: var(--nectar-text-color, #222) !important;
  font-size: 1.15rem !important;  /* H4-ish ma non enorme */
  font-weight: 600 !important;
}

/* Hover / focus */
body.woocommerce .single_add_to_cart_button:hover,
body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
body.woocommerce .woocommerce-message a.button:hover,
body.woocommerce .wc-block-cart__submit-button:hover,
.wp-block-woocommerce-checkout .wc-block-components-checkout-place-order-button:hover,
body.woocommerce .single_add_to_cart_button:focus,
body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:focus,
body.woocommerce .woocommerce-message a.button:focus,
body.woocommerce .wc-block-cart__submit-button:focus,
.wp-block-woocommerce-checkout .wc-block-components-checkout-place-order-button:focus,
body.woocommerce a.button.checkout.wc-forward:hover,
body.woocommerce button.checkout.wc-forward:hover,
body.woocommerce a.button.checkout.wc-forward:focus,
body.woocommerce button.checkout.wc-forward:focus {
  background-color: var(--nectar-extra-color-3) !important;
  color: var(--nectar-text-color, #222) !important;
}



/* =====================================
   3) TESTI CHIAVE – BLU (EXTRA COLOR 1)
   - Titoli prodotto
   - Prezzi principali
   - Importi formattati (totali, subtotali, tasse)
   ===================================== */

/* Titolo prodotto nei blocchi WooCommerce */
body.woocommerce a.wc-block-components-product-name {
  color: var(--nectar-extra-color-1) !important;
  font-weight: 600 !important;
}

/* Prezzo principale */
body.woocommerce .woocommerce-Price-amount.amount {
  color: var(--nectar-extra-color-1) !important;
  font-weight: 700 !important;
}

/* Importi formattati (es. riepilogo, tasse, subtotal/total) */
body.woocommerce .wc-block-formatted-money-amount,
body.woocommerce .wc-block-components-formatted-money-amount,
body.woocommerce .wc-block-components-totals-footer-item-tax-value {
  color: var(--nectar-extra-color-1) !important;
}



/* =====================================
   4) BOTTONI SECONDARI (CARD PRODOTTO)
   - Solo override colore testo: Extra Color 1
   - Il resto lo eredita dal tema
   ===================================== */

body.woocommerce .wc-block-components-product-button__button {
  color: var(--nectar-extra-color-1) !important;
}

body.woocommerce .wc-block-components-product-button__button:hover,
body.woocommerce .wc-block-components-product-button__button:focus {
  color: var(--nectar-extra-color-1) !important;
}


/* Casi particolari es. bottone "Procedi al pagamento" (cart) → forzo text-color sul testo interno */

body.woocommerce .wc-block-cart__submit-container
.wc-block-components-button.wc-block-cart__submit-button:not(.is-link),
body.woocommerce .wc-block-cart__submit-container
.wc-block-components-button.wc-block-cart__submit-button:not(.is-link) * {
  color: var(--nectar-text-color, #222) !important;
}



/* =====================================
   LABEL IN WOO – STOP AL GIALLO GLOBALE
   - Sovrascrive il "label span { color: #ffdb3a; }" di Salient
   - Vale SOLO nelle pagine Woo
   ===================================== */

body.woocommerce label span,
body.woocommerce-page label span {
  color: var(--nectar-text-color, #222) !important;
}



/* =====================================
   MINI CART – BOTTONI SECONDARI (contenuto Woo)
   - testo: extra color 1
   - nessun background
   - hover: bg extra 1 al 20%
   ===================================== */

body.woocommerce .woocommerce-mini-cart__buttons .button,
body.woocommerce-page .woocommerce-mini-cart__buttons .button {
  background: transparent !important;
  color: var(--nectar-extra-color-1) !important;
  box-shadow: none !important;
  border: none !important;
}

/* Hover */
body.woocommerce .woocommerce-mini-cart__buttons .button:hover,
body.woocommerce-page .woocommerce-mini-cart__buttons .button:hover {
  background-color: color-mix(in srgb, var(--nectar-extra-color-1) 20%, transparent) !important;
  color: var(--nectar-extra-color-1) !important;
}



/* =====================================
   WOO MESSAGE – STOP TESTO BIANCO DI SALIENT
   ===================================== */

body.woocommerce .woocommerce-message,
body.woocommerce .woocommerce-error,
body.woocommerce .woocommerce-info {
  color: var(--nectar-text-color, #222) !important;
  background: rgba(0,0,0,0.04) !important; /* puoi alzare o eliminare */
  border: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Link dentro i messaggi */
body.woocommerce .woocommerce-message a,
body.woocommerce .woocommerce-error a,
body.woocommerce .woocommerce-info a {
  color: var(--nectar-extra-color-1) !important;
  text-decoration: underline !important;
}



/* =====================================
   MINI CART (HEADER) – BOTTONI SECONDARI
   ===================================== */

#header-outer .widget_shopping_cart .woocommerce-mini-cart__buttons .button {
  background: transparent !important;
  color: var(--nectar-extra-color-1) !important;
  border: none !important;
  box-shadow: none !important;
}

#header-outer .widget_shopping_cart .woocommerce-mini-cart__buttons .button:hover {
  background-color: color-mix(in srgb, var(--nectar-extra-color-1) 20%, transparent) !important;
  color: var(--nectar-extra-color-1) !important;
}



/* =====================================
   WOO BUTTON – wc-forward (SECONDARY, tranne checkout)
   ===================================== */

/* Tutti i wc-forward NON di checkout → secondary */
body.woocommerce a.button.wc-forward:not(.checkout),
body.woocommerce button.wc-forward:not(.checkout) {
  background: transparent !important;
  color: var(--nectar-extra-color-1) !important;
  border: none !important;
  box-shadow: none !important;
}

/* Hover wc-forward NON checkout */
body.woocommerce a.button.wc-forward:not(.checkout):hover,
body.woocommerce button.wc-forward:not(.checkout):hover {
  background-color: color-mix(in srgb, var(--nectar-extra-color-1) 20%, transparent) !important;
  color: var(--nectar-extra-color-1) !important;
}



/* =====================================
   Override hover submit SOLO in Woo
   - per battere il generic "button[type=submit]:hover" del tema
   ===================================== */

body.woocommerce button[type=submit]:hover,
body.woocommerce input[type=submit]:hover {
  background-color: var(--nectar-extra-color-3) !important;
  color: var(--nectar-text-color, #222) !important;
}



/* =====================================
   FIX SFONDO ARCHIVE / CATEGORY PROD
   - Rimuove il grigio #f6f6f6 di Salient
   ===================================== */

/* Sfondo pagina */
body.woocommerce.post-type-archive-product,
body.woocommerce.tax-product_cat {
  background-color: #ffffff !important;
}

/* Wrapper contenuto principale */
body.woocommerce.post-type-archive-product .container-wrap,
body.woocommerce.tax-product_cat .container-wrap,
body.woocommerce.post-type-archive-product #ajax-content-wrap,
body.woocommerce.tax-product_cat #ajax-content-wrap {
  background-color: transparent !important;
}



/* =====================================
   FIX FONT SIZE wc-forward SU SINGOLO PRODOTTO
   ===================================== */

body.woocommerce.single-product a.button.wc-forward,
body.woocommerce.single-product button.wc-forward,
body.woocommerce.single-product a.button.checkout.wc-forward,
body.woocommerce.single-product button.checkout.wc-forward {
  font-size: 1.15rem !important; /* stessa dimensione dei primari */
  font-weight: 600 !important;
}

/* =============================================
   FIX SUPER MIRATO – ADD TO CART GRID (SECONDARY)
   - Toglie lo sfondo nero di :root :where(.wp-element-button,…)
   - NON tocca "Procedi al pagamento"
   ============================================= */

body.woocommerce :where(
  .wp-element-button.wc-block-components-product-button__button.add_to_cart_button,
  .wp-block-button__link.wc-block-components-product-button__button.add_to_cart_button
) {
  background-color: transparent !important; /* niente nero */
  color: var(--nectar-extra-color-1) !important;
  border: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Hover solo per questi "Aggiungi al carrello" di griglia/listing */
body.woocommerce :where(
  .wp-element-button.wc-block-components-product-button__button.add_to_cart_button:hover,
  .wp-block-button__link.wc-block-components-product-button__button.add_to_cart_button:hover
) {
  background-color: color-mix(in srgb, var(--nectar-extra-color-1) 20%, transparent) !important;
  color: var(--nectar-extra-color-1) !important;
}

/* =============================================
   HACK FILL – ADD TO CART GRID
   - Copre lo sfondo nero con un fill bianco (stesso colore dello sfondo)
   - Non tocca "Procedi al pagamento"
   ============================================= */

body.woocommerce a.wp-block-button__link.wp-element-button
.wc-block-components-product-button__button.add_to_cart_button.product_type_simple,
body.woocommerce a.wp-block-button__link.wp-element-button.wc-block-components-product-button__button.add_to_cart_button.product_type_simple {

  /* fill interno che copre il bg nero */
  box-shadow: 0 0 0 9999px #ffffff inset !important;

  /* testo come secondary */
  color: var(--nectar-extra-color-1) !important;
  border: none !important;
  text-shadow: none !important;
}

/* Hover: “finto” secondary con fill più scuro */
body.woocommerce a.wp-block-button__link.wp-element-button
.wc-block-components-product-button__button.add_to_cart_button.product_type_simple:hover,
body.woocommerce a.wp-block-button__link.wp-element-button.wc-block-components-product-button__button.add_to_cart_button.product_type_simple:hover {

  box-shadow: 0 0 0 9999px
    color-mix(in srgb, var(--nectar-extra-color-1) 20%, #ffffff) inset !important;
  color: var(--nectar-extra-color-1) !important;
}
