/* Woo Notices Popup – Custom Style (Manrope + clean layout) */

/* Nasconde le notices standard Woo (no flash) */
.woocommerce-notices-wrapper,
.woocommerce-notices,
.woocommerce-message,
.woocommerce-error,
.woocommerce-info{
  display:none !important;
  visibility:hidden !important;
  opacity:0 !important;
  height:0 !important;
  overflow:hidden !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
}

/* Popup centrata */
#wcnpop.wcnpop{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 36px));
  background: #013423;
  color: #f4f4f4;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  z-index: 999999;
  overflow: hidden;
  font-family: "Manrope", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#wcnpop *{
  font-family: inherit;
  box-sizing: border-box;
}

#wcnpop[hidden]{ display:none !important; }

/* Barra timer */
#wcnpop .wcnpop__bar{
  height: 5px;
  width: 0%;
  background: #07F157;
  transition: width 5000ms linear;
}

/* Contenuto: niente spazio vuoto a destra */
#wcnpop .wcnpop__content{
  padding: 20px;
  font-size: 15px;
  line-height: 1.4;
}


/* Pulsante chiusura (forzato contro temi/Elementor) */
#wcnpop .wcnpop__close{
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;

  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;

  border: none !important;
  outline: none !important;
  box-shadow: none !important;

  background: #f4f4f4 !important;
  color: #013423 !important;

  cursor: pointer !important;
  font-size: 22px !important;
  line-height: 38px !important;
  padding: 0 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  -webkit-tap-highlight-color: transparent !important;
}

#wcnpop .wcnpop__close:hover,
#wcnpop .wcnpop__close:focus{
  background: #013423 !important;
  color: #f4f4f4 !important;
  outline: 1px solid rgba(244,244,244,.35) !important;
}


#wcnpop .wcnpop__close:hover{
  background:#013423;
  color:#f4f4f4;
  outline: 1px solid rgba(244,244,244,.35);
}

/* Notices dentro popup (riabilitate) */
#wcnpop .woocommerce-message,
#wcnpop .woocommerce-info,
#wcnpop .woocommerce-error{
  display:block !important;
  visibility:visible !important;
  opacity:1 !important;
  height:auto !important;
  overflow: visible !important;

  margin: 0 !important;
  padding: 16px !important;
  padding-left: 48px !important; /* spazio per l'icona */
  border-radius: 12px !important;
  background: #f4f4f4 !important;
  color: #013423 !important;
  border: none !important;

  position: relative;
}

/* Fix icona: non deve sovrapporsi al testo */
#wcnpop .woocommerce-message::before,
#wcnpop .woocommerce-info::before,
#wcnpop .woocommerce-error::before{
  position: absolute !important;
  left: 16px !important;
  top: 18px !important;
  margin: 0 !important;
  transform: none !important;
  opacity: 1 !important;
}

/* Spaziatura tra testo e bottone */
#wcnpop .woocommerce-message,
#wcnpop .woocommerce-info,
#wcnpop .woocommerce-error{
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

/* Woo di solito mette il bottone prima del testo: lo portiamo sotto */
#wcnpop .woocommerce-message a.button,
#wcnpop .woocommerce-info a.button,
#wcnpop .woocommerce-error a.button{
  order: 2;
}
#wcnpop .woocommerce-message,
#wcnpop .woocommerce-info,
#wcnpop .woocommerce-error{
  /* il testo resta sopra */
}
#wcnpop .woocommerce-message a.button + *,
#wcnpop .woocommerce-info a.button + *,
#wcnpop .woocommerce-error a.button + *{
  order: 1;
}

/* Pulsante "Vai al carrello" – piena larghezza, dentro al box chiaro */
#wcnpop .woocommerce-message a.button.wc-forward,
#wcnpop .woocommerce-message a.button,
#wcnpop .woocommerce-info a.button,
#wcnpop .woocommerce-error a.button{
  display:block !important;
  width:100% !important;
  margin: 0 !important;
  padding:14px 16px !important;
  background:#07F157 !important;
  color:#013423 !important;
  font-size:16px !important;
  font-weight: 700 !important;
  text-align:center !important;
  border-radius:12px !important;
  border:none !important;
  text-decoration:none !important;
  box-shadow: none !important;
}

#wcnpop .woocommerce-message a.button:hover,
#wcnpop .woocommerce-info a.button:hover,
#wcnpop .woocommerce-error a.button:hover{
  background:#013423 !important;
  color:#f4f4f4 !important;
}

/* Link generici nella notice */
#wcnpop .woocommerce-message a:not(.button),
#wcnpop .woocommerce-info a:not(.button),
#wcnpop .woocommerce-error a:not(.button){
  color: #013423 !important;
  text-decoration: underline;
}

/* Se ci sono più notices, distanziale */
#wcnpop .woocommerce-message + .woocommerce-message,
#wcnpop .woocommerce-message + .woocommerce-info,
#wcnpop .woocommerce-message + .woocommerce-error,
#wcnpop .woocommerce-info + .woocommerce-message,
#wcnpop .woocommerce-info + .woocommerce-info,
#wcnpop .woocommerce-info + .woocommerce-error,
#wcnpop .woocommerce-error + .woocommerce-message,
#wcnpop .woocommerce-error + .woocommerce-info,
#wcnpop .woocommerce-error + .woocommerce-error{
  margin-top: 14px !important;
}

@media (max-width: 480px){
  #wcnpop.wcnpop{ width: calc(100vw - 24px); }
}


/* === CLOSE BUTTON COLOR FIX (ULTIMATE) === */
#wcnpop .wcnpop__close,
#wcnpop .wcnpop__close svg,
#wcnpop .wcnpop__close::before,
#wcnpop .wcnpop__close::after{
  background-color: #f4f4f4 !important;
  color: #013423 !important;
  fill: #013423 !important;
  stroke: #013423 !important;
}

#wcnpop .wcnpop__close:hover,
#wcnpop .wcnpop__close:hover svg,
#wcnpop .wcnpop__close:hover::before,
#wcnpop .wcnpop__close:hover::after,
#wcnpop .wcnpop__close:focus,
#wcnpop .wcnpop__close:focus svg{
  background-color: #013423 !important;
  color: #f4f4f4 !important;
  fill: #f4f4f4 !important;
  stroke: #f4f4f4 !important;
}



/* === CLOSE BUTTON: CLICK + COLOR HARD FORCE === */
#wcnpop{ pointer-events: none !important; }              /* popup container ignores */
#wcnpop .wcnpop__bar,
#wcnpop .wcnpop__content{ pointer-events: auto !important; }
#wcnpop .wcnpop__close{
  pointer-events: auto !important;
  z-index: 9999999 !important;

  background-color: #f4f4f4 !important;
  color: #013423 !important;

  border: none !important;
  box-shadow: none !important;
  background-image: none !important;
  filter: none !important;
  opacity: 1 !important;
}

#wcnpop .wcnpop__close .wcnpop__closeicon{
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}

#wcnpop .wcnpop__close .wcnpop__closeicon path{
  stroke: currentColor !important;
  stroke-width: 2.5 !important;
  stroke-linecap: round !important;
  fill: none !important;
}

#wcnpop .wcnpop__close:hover,
#wcnpop .wcnpop__close:focus{
  background-color: #013423 !important;
  color: #f4f4f4 !important;
  outline: none !important;
}
