/* ============================
   STILI SOLO PER ARCHIVIO PRODOTTI
   Wrapper: body.archive
   ============================ */

/* 1) Container generale */
body.archive .products.elementor-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: start !important;
  gap: 20px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* 2) Card prodotto: 3 colonne desktop */
body.archive .products.elementor-grid li.product {
  flex: 0 0 calc((100% - 2 * 20px) / 3) !important;
  box-sizing: border-box !important;
  background: #fff !important;
  border-radius: 8px !important;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

/* 3) Hover effetto */
body.archive .products.elementor-grid li.product:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2) !important;
}

/* 4) Immagini */
body.archive .products.elementor-grid li.product figure,
body.archive .products.elementor-grid li.product figure img {
  width: 100% !important;
  display: block !important;
}
body.archive .products.elementor-grid li.product figure img {
  height: auto !important;
  transition: transform 0.3s ease, opacity 0.3s ease !important;
}
body.archive .products.elementor-grid li.product figure:hover img {
  transform: scale(1.05) !important;
  opacity: 0.9 !important;
}

/* 5) Spaziatura interna */
body.archive .products.elementor-grid li.product h2,
body.archive .products.elementor-grid li.product .entry-meta,
body.archive .products.elementor-grid li.product .entry-excerpt,
body.archive .products.elementor-grid li.product .price,
body.archive .products.elementor-grid li.product .ct-woo-card-actions {
  padding: 0 15px !important;
}

/* 6) Titolo */
body.archive .products.elementor-grid li.product h2.woocommerce-loop-product__title {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  margin: 0.5rem 0 !important;
  color: #333 !important;
}

/* 7) Meta categoria */
body.archive .products.elementor-grid li.product .entry-meta a {
  color: #0073aa !important;
  text-decoration: none !important;
  font-size: 0.9rem !important;
}
body.archive .products.elementor-grid li.product .entry-meta a:hover {
  color: #005177 !important;
}

/* 8) Estratto */
body.archive .products.elementor-grid li.product .entry-excerpt {
  font-size: 0.9rem !important;
  color: #555 !important;
  line-height: 1.5 !important;
  text-align: start !important;
}

/* 9) Prezzo */
body.archive .products.elementor-grid li.product .price {
  font-size: 1rem !important;
  color: #0073e6 !important;
  font-weight: bold !important;
  margin: 0.5rem 0 !important;
}

/* 9b) Nota "A partire da" generata dal filtro */
/* Quando il filtro sostituisce direttamente il prezzo */
body.archive .products.elementor-grid li.product .price .wc-deposit-note,
body.archive .products.elementor-grid li.product .wc-deposit-note {
  display: inline-block !important;
  margin: 0.25rem 0 0.75rem !important;
  padding: 0 !important;
  font-size: 0.95rem !important;
  line-height: 1.4 !important;
  color: var(--theme-palette-color-1, #0073e6) !important;
  font-weight: 700 !important;
}

/* 10) Pulsanti */
body.archive .products.elementor-grid li.product .button,
body.archive .products.elementor-grid li.product .added_to_cart {
  /* Reset & base */
  font-family: var(--theme-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  display: inline-block !important;
  box-sizing: border-box !important;
  max-width: 100% !important;
  width: fit-content !important;
  padding: 10px 25px !important;
  margin: 0.5rem 15px 1rem !important;
  text-decoration: none !important;
  text-transform: none !important;
  letter-spacing: var(--theme-letter-spacing, 0) !important;
  border-radius: 3px !important;
  cursor: pointer !important;
  -webkit-font-smoothing: antialiased !important;
  transition: background-color .3s, color .3s, border-color .3s, box-shadow .3s !important;
  /* Colors */
  background: transparent !important;
  color: var(--theme-palette-color-1, #0073e6) !important;
  border: 2px solid var(--theme-palette-color-1, #0073e6) !important;
  /* Accessibility */
  position: relative !important;
}

/* Stato hover / focus comune */
body.archive .products.elementor-grid li.product .button:hover,
body.archive .products.elementor-grid li.product .button:focus-visible,
body.archive .products.elementor-grid li.product .added_to_cart:hover,
body.archive .products.elementor-grid li.product .added_to_cart:focus-visible {
  outline: none !important;
  background: var(--theme-palette-color-1, #0073e6) !important;
  color: #fff !important;
  border-color: var(--theme-palette-color-2, #005bb5) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-palette-color-1, #0073e6) 40%, transparent) !important;
}

/* Pulsante principale (aggiungi al carrello) */
body.archive .products.elementor-grid li.product .button {
  --btn-bg: transparent;
}

/* Stato attivo / click */
body.archive .products.elementor-grid li.product .button:active,
body.archive .products.elementor-grid li.product .added_to_cart:active {
  transform: translateY(1px) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-palette-color-2, #1559ed) 55%, transparent) inset !important;
}

/* Pulsante già nel carrello */
body.archive .products.elementor-grid li.product .added_to_cart {
  color: var(--theme-palette-color-3, #3A4F66) !important;
  border-color: var(--theme-palette-color-3, #3A4F66) !important;
  background: transparent !important;
}
body.archive .products.elementor-grid li.product .added_to_cart:hover,
body.archive .products.elementor-grid li.product .added_to_cart:focus-visible {
  background: var(--theme-palette-color-3, #3A4F66) !important;
  border-color: var(--theme-palette-color-3, #3A4F66) !important;
  color: #fff !important;
}

/* Allineamento pulsanti a sinistra */
body.archive .products.elementor-grid li.product .ct-woo-card-actions {
  text-align: left !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  padding-left: 15px !important; /* coerente con altri elementi */
}
body.archive .products.elementor-grid li.product .ct-woo-card-actions .button,
body.archive .products.elementor-grid li.product .ct-woo-card-actions .added_to_cart {
  margin-left: 0 !important; /* rimuove margine extra sinistro */
  margin-right: 15px !important; /* mantiene spaziatura orizzontale */
}

/* Stato disabilitato (es. in attesa) */
body.archive .products.elementor-grid li.product .button[disabled],
body.archive .products.elementor-grid li.product .added_to_cart[disabled] {
  opacity: .6 !important;
  pointer-events: none !important;
}

/* Effetto focus tastiera visibile solo via keyboard */
body.archive .products.elementor-grid li.product .button:focus:not(:focus-visible),
body.archive .products.elementor-grid li.product .added_to_cart:focus:not(:focus-visible) {
  box-shadow: none !important;
}

/* ============================
   RESPONSIVE
   ============================ */

/* Tablet (≤1024px) */
@media (max-width: 1024px) {
  body.archive .products.elementor-grid li.product {
    flex: 0 0 calc((100% - 20px) / 2) !important;
  }
}

/* Mobile (≤600px) */
@media (max-width: 600px) {
  body.archive .products.elementor-grid {
    gap: 15px !important;
    padding: 0 16px !important;
  }
  body.archive .products.elementor-grid li.product {
    flex: 0 0 100% !important;
  }
}
