/* ============================================================
   FONT BASE — Inclusive Sans OVUNQUE
   ============================================================ */
body .b2b-cart-wrapper,
body .b2b-cart-wrapper * {
  font-family: 'Inclusive Sans', sans-serif !important;
}

/* ============================================================
   WRAPPER GENERALE
   ============================================================ */
.b2b-cart-wrapper {
  font-family: 'Inclusive Sans', sans-serif !important;
  background: #f8f8f8;
  padding: 40px;
  border-radius: 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.b2b-cart-header {
  font-family: 'Inclusive Sans', sans-serif !important;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
  text-transform: uppercase;
  border-bottom: 2px solid #000;
  padding-bottom: 10px;
}

/* ============================================================
   RIEPILOGO TOTALI
   ============================================================ */
.b2b-cart-summary {
  font-family: 'Inclusive Sans', sans-serif !important;
  font-size: 16px;
}

.b2b-cart-row-checkout {
  margin-bottom: 8px;
}

/* Pulsante invia ordine */
.b2b-cart-button {
  font-family: 'Inclusive Sans', sans-serif !important;
  display: inline-block;
  background: #F02900;
  color: #fff !important;
  padding: 14px 28px;
  width: 100%;
  font-weight: bold;
  text-align: center;
  margin-top: 20px;
  text-decoration: none;
  border-radius: 5px !important;
}

.b2b-cart-button a {
  color: #ffffff !important;
}

/* Il pulsante è un <button> dentro un form POST: neutralizza gli stili tema/Elementor */
.b2b-order-form {
  margin: 0;
}

button.b2b-cart-button,
button.b2b-cart-button:hover,
button.b2b-cart-button:focus {
  background: #F02900 !important;
  border: none !important;
  font-size: inherit;
  line-height: inherit;
  text-transform: none;
  cursor: pointer;
}

.b2b-order-form button:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* ============================================================
   LISTA ARTICOLI
   ============================================================ */
.b2b-cart-items-wrapper {
  width: 100%;
}

/* INTESTAZIONI */
.b2b-cart-head {
  font-family: 'Inclusive Sans', sans-serif !important;
  display: grid;
  grid-template-columns: 40px 60px 1fr 100px 120px;
  padding: 10px 0;
  border-bottom: 1px solid #ddd;
  font-weight: 400;
  font-size: 14px;
  text-align: center;
}

.b2b-cart-head-desc {
  font-family: 'Inclusive Sans', sans-serif !important;
  text-align: left;
  padding-left: 12px;
}

/* ============================================================
   RIGA PRODOTTO
   ============================================================ */
.b2b-cart-item {
  font-family: 'Inclusive Sans', sans-serif !important;
  display: grid;
  grid-template-columns: 40px 60px 1fr 100px 120px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #ddd;
  text-align: center;
}

/* Cestino */
.b2b-cart-remove {
  display: flex;
  justify-content: center;
  align-items: center;
}

.b2b-remove-link {
  text-decoration: none;
  cursor: pointer;
}

/* Icona cestino personalizzata */
.trashicon {
  font-family: 'Material Icons' !important;
  font-size: 20px;
  color: #aaaaaa;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.trashicon:hover {
  opacity: 0.6;
}

/* Miniatura */
.b2b-cart-thumb {
  display: flex;
  justify-content: center;
  align-items: center;
}

.b2b-cart-thumb img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

/* Nome prodotto */
.b2b-cart-name {
  text-align: left;
  padding-left: 12px;
  font-size: 15px;
  font-weight: 500;
}

/* Quantità */
.b2b-cart-qty {
  font-family: 'Inclusive Sans', sans-serif !important;
  text-align: center;
}

.b2b-qty-input {
  font-family: 'Inclusive Sans', sans-serif !important;
  width: 60px;
  padding: 4px;
  font-size: 14px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 5px !important;
}

/* Prezzo totale riga */
.b2b-cart-price {
  font-family: 'Inclusive Sans', sans-serif !important;
  font-size: 15px;
  font-weight: 600;
}

/* ============================================================
   COUPON SU UNA RIGA — AGGIORNATO
   ============================================================ */
.b2b-cart-coupon {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  align-items: center;
}

.b2b-cart-coupon-input {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 5px !important;
  min-width: 0;
}

.b2b-cart-coupon-button {
  font-family: 'Inclusive Sans', sans-serif !important;
  padding: 10px 20px;
  background: #000 !important;
  color: #fff !important;
  font-weight: bold;
  border: none !important;
  cursor: pointer;
  border-radius: 5px !important;
  white-space: nowrap;
}

.b2b-cart-coupon-button:hover {
  opacity: 0.8;
}

/* Totale evidenziato */
.b2b-cart-total {
  font-weight: 600;
  font-size: 16px;
  margin-top: 10px;
}

/* Totali in attesa del ricalcolo dopo un cambio quantità (cart.js):
   attenuati e non cliccabili, così non si invia l'ordine con valori vecchi */
.b2b-is-updating {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.15s;
}

/* Riga contributo spese nella lista articoli (plugin b2b-spese) */
/* Versione slim: righe basse, icona e testi piccoli */
.b2b-cart-item--spese,
.recap-item--spese {
  background: #fafafa;
  padding: 6px 0;
}

.b2b-cart-item--spese .b2b-cart-name,
.recap-item--spese .recap-name {
  font-size: 14px;
}

.b2b-cart-item--spese .b2b-cart-price,
.recap-item--spese .recap-price {
  font-size: 14px;
}

.b2b-cart-item--spese .material-icons,
.recap-item--spese .material-icons {
  font-size: 20px;
  color: #888;
}

.b2b-spese-nota {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 400;
  color: #777;
}

.b2b-cart-item-compact--spese {
  padding: 4px 0;
  font-size: 13px;
}

/* Soglia raggiunta: verde */
.b2b-cart-item--spese.is-gratuite,
.recap-item--spese.is-gratuite,
.b2b-cart-item-compact--spese.is-gratuite {
  background: #eaf6ec;
}

.is-gratuite .material-icons,
.is-gratuite .b2b-cart-price,
.is-gratuite .recap-price,
.is-gratuite .b2b-ci-total {
  color: #2e7d32;
}

/* Avviso soglia spese gratuite (plugin b2b-spese) */
.b2b-spese-notice {
  margin: 10px 0;
  padding: 8px 12px;
  font-size: 14px;
  background: #f6f6f6;
  border-left: 3px solid currentColor;
}

/* Riepilogo contabile: etichetta a sinistra, valore a destra */
.b2b-cart-row-checkout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  margin-bottom: 8px;
}

.b2b-cart-row-checkout .label {
  font-weight: 400;
}

.b2b-cart-row-checkout .value {
  font-weight: 500;
  text-align: right;
  min-width: 120px;
}

/* ============================================================
   FONT BASE — Inclusive Sans OVUNQUE
   ============================================================ */
body .recap-wrapper,
body .recap-wrapper * {
  font-family: 'Inclusive Sans', sans-serif !important;
}

/* Le icone devono mantenere il font Material Icons (la regola sopra lo sovrascrive) */
body .recap-wrapper .material-icons,
body .b2b-cart-wrapper .material-icons {
  font-family: 'Material Icons' !important;
}

/* ============================================================
   WRAPPER GENERALE
   ============================================================ */
.recap-wrapper {
  background: #f8f8f8;
  padding: 40px;
  border-radius: 0;
}

/* ============================================================
   SEZIONE ORDINE (riga intera)
   ============================================================ */
.recap-header {
  border-bottom: 2px solid #000;
  padding-bottom: 15px;
  margin-bottom: 40px;
}

.recap-header h2 {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.recap-header p {
  margin: 4px 0;
  font-size: 15px;
}

/* ============================================================
   SEZIONE FATTURAZIONE + SPEDIZIONE (2 colonne)
   ============================================================ */
.recap-addresses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

.recap-box {
  background: #fff;
  padding: 20px;
  border: 1px solid #ddd;
}

.recap-box h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.recap-box p {
  margin: 4px 0;
  font-size: 15px;
}

/* ============================================================
   SEZIONE DETTAGLIO ORDINE (riga intera)
   ============================================================ */
.recap-items-wrapper {
  margin-bottom: 40px;
}

.recap-items-wrapper h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
}

/* Head tabellare */
.recap-items-head {
  display: grid;
  grid-template-columns: 60px 1fr 100px 140px 140px; /* thumb | nome | qty | unit | totale */
  padding: 10px 0;
  border-bottom: 1px solid #ddd;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.recap-head-desc {
  text-align: left;
  padding-left: 12px;
}

/* Riga prodotto */
.recap-item {
  display: grid;
  grid-template-columns: 60px 1fr 100px 140px 140px; /* thumb | nome | qty | unit | totale */
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #ddd;
  text-align: center;
}

/* Miniatura */
.recap-thumb {
  display: flex;
  justify-content: center;
  align-items: center;
}

.recap-thumb img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

/* Nome prodotto */
.recap-name {
  text-align: left;
  padding-left: 12px;
  font-size: 15px;
  font-weight: 500;
}

/* Quantità */
.recap-qty {
  font-size: 15px;
  font-weight: 500;
}

/* Prezzo unitario */
.recap-unit {
  font-size: 15px;
  font-weight: 600;
}

/* Totale riga */
.recap-price {
  font-size: 15px;
  font-weight: 600;
}

/* ============================================================
   SEZIONE RIEPILOGO CONTABILE (riga intera)
   ============================================================ */
.recap-totals {
  background: #fff;
  padding: 20px;
  border: 1px solid #ddd;
}

.recap-totals h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.recap-totals p {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  margin-bottom: 8px;
}

.recap-total-final {
  font-size: 18px;
  font-weight: 700;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 2px solid #000;
}


/* ============================================================
   SEZIONE COMPACT
   ============================================================ */

.b2b-cart-items-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.b2b-cart-item-compact {
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.b2b-ci-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}

.b2b-ci-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #444;
}

.b2b-ci-total {
    font-weight: 600;
}

.b2b-cart-item-compact {
    position: relative;
    padding: 8px 0;
    border-bottom: 1px solid #e5e5e5;
}

.b2b-ci-remove {
    position: absolute;
    right: 0;
    top: 0;
    cursor: pointer;
    color: #f02900;
}

.b2b-ci-remove .material-icons {
    font-size: 18px;
}

.b2b-ci-name {
    font-size: 14px;
    font-weight: 600;
    margin-right: 24px;
}

.b2b-ci-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-top: 4px;
}

.b2b-cart-coupon-row {
    display: block !important;
}

.b2b-coupon-message {
    display: block;
    margin-top: 6px;
    font-size: 0.7em;
}

/* Overlay nero */
.b2b-order-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999999999 !important;
    color: #fff;
    font-size: 22px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* Mostra overlay */
.b2b-order-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Loader pallini */
.b2b-loader {
    margin-top: 20px;
    display: flex;
    gap: 8px;
}

.b2b-loader div {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    animation: b2b-bounce 0.6s infinite alternate;
}

.b2b-loader div:nth-child(2) {
    animation-delay: 0.2s;
}

.b2b-loader div:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes b2b-bounce {
    from { transform: translateY(0); opacity: 0.4; }
    to   { transform: translateY(-10px); opacity: 1; }
}

/*SUMMARY MOBILE*/

/* ============================================================
   MOBILE — Sommario ordine
   ============================================================ */
@media (max-width: 768px) {

  /* Wrapper */
  .recap-wrapper {
    padding: 20px;
  }

  /* Header */
  .recap-header h2 {
    font-size: 20px;
  }

  .recap-header p {
    font-size: 14px;
  }

  /* Indirizzi → stack verticale */
  .recap-addresses {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Head tabellare nascosto */
  .recap-items-head {
    display: none;
  }

  /* Card prodotto */
  .recap-item {
    grid-template-columns: 60px 1fr;
    grid-template-rows: auto auto auto;
    padding: 16px 0;
    row-gap: 6px;
    text-align: left;
  }

  /* Miniatura */
  .recap-thumb {
    grid-row: span 3;
  }

  /* Nome */
  .recap-name {
    font-size: 15px;
    font-weight: 600;
    padding-left: 0;
  }

  /* Quantità */
  .recap-qty::before {
    content: "Quantità: ";
    font-weight: 400;
  }

  /* Prezzo unitario */
  .recap-unit::before {
    content: "Unitario: ";
    font-weight: 400;
  }

  /* Totale riga */
  .recap-price::before {
    content: "Totale: ";
    font-weight: 400;
  }

  /* Totals */
  .recap-totals {
    padding: 16px;
  }

  .recap-totals p {
    font-size: 14px;
  }

  .recap-total-final {
    font-size: 16px;
  }
}