/* ==========================================================================
   Pagina Cart — Figma "Pure Man Care Marketplace | New UI" (node 676:12037)
   Solo CSS, nessun override template. Stila il markup WooCommerce/Dokan
   standard. Auto-caricato dal loader ricorsivo Impreza__auto-load-css-recursive.
   Scope: body.woocommerce-cart per non toccare altre pagine.
   Token colore Figma:
     Dark charcoal #080707 · Charcoal #3F3A35 · Light charcoal #766F67
     Ashes (bordo) #DCD4CD · White #FFFFFF · Light blue #E6EDFF
     Card cream: linear #FFF3DF -> #E9D8B8 (141.56deg)
     Bottone navy: linear #41476F -> #262A42
   ========================================================================== */

/* ---- Sfondo pagina crema (Figma #F9F1E3) ---- */
/* .l-canvas è bianco e copre tutta l'altezza pagina: va colorato anche lui,
   altrimenti sotto al contenuto (dove .l-main finisce) resta il bianco. */
body.woocommerce-cart,
body.woocommerce-cart .l-canvas,
body.woocommerce-cart .l-main { background-color: #F9F1E3; }

/* ---- Contenuto centrato verticalmente nella pagina (tra header e footer) ---- */
body.woocommerce-cart .l-main {
  min-height: calc(100vh - var(--header-height, 88px));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 40px;
  padding-bottom: 64px;
}
@media (max-width: 768px) {
  body.woocommerce-cart .l-main {
    padding-top: 24px;
    padding-bottom: 40px;
  }
}

/* ---- Layout: tabella a sinistra + card totali a destra (Figma gap 24) ---- */
.woocommerce-cart .woocommerce {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px;
}
/* Notices sempre a piena larghezza sopra al layout */
.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper {
  flex: 0 0 100%;
  width: 100%;
}
.woocommerce-cart .woocommerce-cart-form {
  flex: 1 1 520px;
  min-width: 0;
  margin: 0;
}
.woocommerce-cart .cart-collaterals {
  flex: 0 0 450px;
  width: 450px;
  max-width: 100%;
}
.woocommerce-cart .cart-collaterals .cross-sells { display: none; } /* fuori dal Figma */

/* ---- Tabella carrello ---- */
.woocommerce-cart table.shop_table.cart {
  width: 100% !important;
  table-layout: auto;
  border: 0;
  border-collapse: collapse;
  margin: 0;
  background: transparent;
}
.woocommerce-cart table.shop_table.cart th,
.woocommerce-cart table.shop_table.cart td {
  border: 0;
  background: transparent;
}

/* Intestazione colonne: Helvetica Neue Bold 14, bordo #766F67 */
.woocommerce-cart table.shop_table.cart thead th {
  padding: 8px 0;
  font-family: "Helvetica Neue", sans-serif;
  font-size: 14px;
  font-weight: 700 !important;
  line-height: 1.4;
  color: #080707 !important;
  text-align: left;
  border-bottom: 1px solid #766F67 !important;
  text-transform: none;
}
/* Header remove/thumbnail restano (vuoti) per non rompere l'allineamento
   colonne thead/tbody. "Products" sta sopra il nome. */
.woocommerce-cart table.shop_table.cart thead th.product-remove { width: 28px; padding: 8px 12px 8px 0; }
.woocommerce-cart table.shop_table.cart thead th.product-thumbnail { width: 96px; }
.woocommerce-cart table.shop_table.cart thead th.product-name { padding-left: 0; }
.woocommerce-cart table.shop_table.cart thead th.product-price,
.woocommerce-cart table.shop_table.cart thead th.product-quantity,
.woocommerce-cart table.shop_table.cart thead th.product-subtotal {
  width: 140px;
}

/* Righe prodotto: bordo #DCD4CD, py 16 */
.woocommerce-cart table.shop_table.cart tbody td {
  padding: 16px 0;
  vertical-align: middle;
  border-bottom: 1px solid #DCD4CD;
  font-family: "Helvetica Neue", sans-serif;
}
.woocommerce-cart table.shop_table.cart tbody td.product-price,
.woocommerce-cart table.shop_table.cart tbody td.product-quantity,
.woocommerce-cart table.shop_table.cart tbody td.product-subtotal {
  width: 140px;
}

/* Remove × 16px, prima della thumbnail */
.woocommerce-cart td.product-remove {
  width: 28px;
  padding-right: 12px !important;
}
.woocommerce-cart td.product-remove a.remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 18px;
  line-height: 1;
  color: #080707 !important;
  background: transparent !important;
  border-radius: 0;
}
.woocommerce-cart td.product-remove a.remove:hover { opacity: .6; }

/* Thumbnail 72px */
.woocommerce-cart td.product-thumbnail {
  width: 96px;
  padding-right: 12px !important;
}
.woocommerce-cart td.product-thumbnail img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 0;
}

/* Nome prodotto: Lora Bold Italic 16 */
.woocommerce-cart td.product-name a {
  font-family: "Lora", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  color: #080707 !important;
  text-decoration: none;
}
/* Vendor Dokan (sold by): "Vendor: Nome" — Helvetica 12 */
.woocommerce-cart td.product-name .wc-item-meta,
.woocommerce-cart td.product-name .dokan-store-name,
.woocommerce-cart td.product-name .variation {
  margin-top: 6px;
  font-family: "Helvetica Neue", sans-serif;
  font-size: 12px;
  line-height: 1.4;
  color: #3F3A35;
}
.woocommerce-cart td.product-name .wc-item-meta strong,
.woocommerce-cart td.product-name .variation dt {
  font-weight: 500;
  color: #080707;
}

/* Prezzo: Helvetica Regular 16 */
.woocommerce-cart td.product-price {
  font-size: 16px;
  font-weight: 400;
  color: #080707;
}
/* Subtotale riga: Helvetica Bold 16 */
.woocommerce-cart td.product-subtotal {
  font-size: 16px;
  font-weight: 700;
  color: #080707;
}
.woocommerce-cart td.product-price .amount,
.woocommerce-cart td.product-subtotal .amount { color: #080707; }

/* Quantità: stepper − [n] + (Figma). Bottoni iniettati da mu-plugin
   pmc-cart-quantity-stepper: .pmc-qty-btn con SVG cerchiato ic:round-minus/plus. */
.woocommerce-cart td.product-quantity .quantity {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.woocommerce-cart td.product-quantity .quantity input.qty {
  width: 28px;
  height: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  font-family: "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: #080707;
  text-align: center;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  -moz-appearance: textfield;
  appearance: textfield;
}
.woocommerce-cart td.product-quantity .quantity input.qty::-webkit-outer-spin-button,
.woocommerce-cart td.product-quantity .quantity input.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.woocommerce-cart td.product-quantity .quantity .pmc-qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #080707;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: none;
}
.woocommerce-cart td.product-quantity .quantity .pmc-qty-btn svg {
  display: block;
  width: 100%;
  height: 100%;
}
.woocommerce-cart td.product-quantity .quantity .pmc-qty-btn:hover { opacity: .7; }
.woocommerce-cart td.product-quantity .quantity .pmc-qty-btn:disabled {
  opacity: .4;
  cursor: default;
}

/* ---- Riga azioni: coupon (sinistra) + Update cart (destra), stessa riga ----
   body + !important + width:auto per battere Impreza che forza .coupon a width:100% (stack). */
/* NB: il <td> resta table-cell (NON flex): display:flex sul td lo estrae dal
   table-layout e lo restringe. Uso i float per tenerlo a piena larghezza. */
body.woocommerce-cart table.shop_table.cart td.actions {
  padding: 24px 0 0 !important;
  border-bottom: 0;
}
body.woocommerce-cart table.shop_table.cart td.actions::after {
  content: "";
  display: block;
  clear: both;
}
body.woocommerce-cart td.actions .coupon {
  display: flex !important;
  align-items: center;
  gap: 8px;
  float: left !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
}
/* Update cart a destra */
body.woocommerce-cart td.actions button[name="update_cart"] {
  float: right !important;
  margin: 0 !important;
}
body.woocommerce-cart td.actions .coupon input#coupon_code {
  width: 274px;
  max-width: 100%;
  flex: 0 0 274px;
  height: 42px;
  padding: 10px 12px;
  font-family: "Helvetica Neue", sans-serif;
  font-size: 16px;
  color: #766F67;
  background: #fff;
  border: 1px solid #766F67;
  border-radius: 12px;
}
.woocommerce-cart td.actions .coupon input#coupon_code::placeholder { color: #766F67; }

/* ---- Bottoni navy (Apply code, Proceed to checkout) ---- */
.woocommerce-cart td.actions .coupon button[name="apply_coupon"],
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 10px 24px;
  font-family: "Helvetica Neue", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: #fff !important;
  text-transform: none;
  background: linear-gradient(96deg, #41476F 0%, #262A42 100%) !important;
  border: 1px solid #fff;
  border-radius: 999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, .16);
}
/* Impreza applica border-image (rettangolo, ignora border-radius) + colore scuro
   sul :hover di .button/.alt: neutralizza per tenere pill + testo bianco */
.woocommerce-cart td.actions .coupon button[name="apply_coupon"]:hover,
body.woocommerce-cart .cart_totals .wc-proceed-to-checkout a.checkout-button:hover {
  filter: brightness(1.08);
  border-image: none !important;
  color: #fff !important;
}

/* Update cart: azzurrino chiaro (inline, non a blocco: resta sulla riga a destra) */
.woocommerce-cart td.actions button[name="update_cart"] {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  height: 42px;
  padding: 10px 24px;
  font-family: "Helvetica Neue", sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #080707 !important;
  text-transform: none;
  background: #E6EDFF !important;
  border: 1px solid rgba(37, 57, 112, .16);
  border-radius: 999px;
  box-shadow: none;
  opacity: 1;
}
.woocommerce-cart td.actions button[name="update_cart"]:hover {
  border-image: none !important; /* stesso rettangolo Impreza: neutralizza */
}
.woocommerce-cart td.actions button[name="update_cart"]:disabled {
  opacity: .5;
}

/* ---- Card "Cart totals" (cream) ---- */
.woocommerce-cart .cart_totals {
  padding: 24px 32px;
  background: linear-gradient(141.56deg, #FFF3DF 0%, #E9D8B8 70.59%);
  border-radius: 20px;
}
.woocommerce-cart .cart_totals h2 {
  margin: 0 0 24px;
  font-family: "Lora", serif;
  font-style: italic;
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  color: #080707;
  text-transform: none;
}
.woocommerce-cart .cart_totals table.shop_table {
  width: 100%;
  border: 0;
  margin: 0 0 24px;
  background: transparent;
}
/* Righe flex: etichetta a sinistra, valore a destra (fix overlap mobile) */
.woocommerce-cart .cart_totals table.shop_table tbody { display: block; width: 100%; }
.woocommerce-cart .cart_totals table.shop_table tr {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.woocommerce-cart .cart_totals table.shop_table th,
.woocommerce-cart .cart_totals table.shop_table td {
  padding: 8px 0;
  border: 0;
  background: transparent;
  font-family: "Lora", serif;
  font-style: italic;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  color: #080707;
  text-align: left;
}
.woocommerce-cart .cart_totals table.shop_table td { text-align: right; }
/* Divider sotto il subtotale (Figma #766F67) */
.woocommerce-cart .cart_totals tr.cart-subtotal {
  border-bottom: 1px solid #766F67;
  padding-bottom: 16px;
}
.woocommerce-cart .cart_totals tr.order-total {
  padding-top: 16px;
  align-items: baseline;
}
/* Total: valore Lora Bold Italic 24 */
.woocommerce-cart .cart_totals tr.order-total td .amount,
.woocommerce-cart .cart_totals tr.order-total td strong {
  font-family: "Lora", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 24px;
  color: #080707;
}

/* Proceed to checkout a piena larghezza dentro la card */
.woocommerce-cart .cart_totals .wc-proceed-to-checkout { padding: 0; }
.woocommerce-cart .cart_totals .wc-proceed-to-checkout a.checkout-button {
  display: flex;
  width: 100%;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .woocommerce-cart .woocommerce-cart-form,
  .woocommerce-cart .cart-collaterals {
    flex: 0 0 100%;
    width: 100%;
  }
  .woocommerce-cart td.actions {
    justify-content: flex-start;
  }
  .woocommerce-cart td.actions .coupon {
    flex-wrap: wrap;
  }
  .woocommerce-cart td.actions .coupon input#coupon_code { width: 100%; }
}

/* ---- Mobile: righe prodotto -> card impilate label:valore (Figma 393) ---- */
@media (max-width: 768px) {
  /* La tabella deve comportarsi da blocco, altrimenti va in min-content e sfora il viewport */
  .woocommerce-cart .woocommerce { display: block; }
  .woocommerce-cart .woocommerce-cart-form { margin-bottom: 24px; }
  .woocommerce-cart table.shop_table.cart { display: block; width: 100% !important; }
  .woocommerce-cart table.shop_table.cart thead { display: none; }
  .woocommerce-cart table.shop_table.cart tbody { display: block; width: 100%; }

  .woocommerce-cart table.shop_table.cart tbody tr.cart_item {
    display: grid;
    grid-template-columns: 72px 1fr;
    grid-template-areas:
      "thumb name"
      "thumb price"
      "thumb qty"
      "thumb subtotal";
    column-gap: 12px;
    row-gap: 8px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #DCD4CD;
    position: relative;
  }
  /* Solo le celle prodotto diventano flex; la riga .actions resta intatta */
  .woocommerce-cart table.shop_table.cart tbody tr.cart_item td {
    display: flex;
    align-items: center;
    width: auto !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .woocommerce-cart tr.cart_item td.product-thumbnail {
    grid-area: thumb;
    align-self: center;
    justify-content: center;
    width: 72px !important;
  }
  .woocommerce-cart tr.cart_item td.product-thumbnail img { width: 72px; height: 72px; }

  .woocommerce-cart tr.cart_item td.product-name {
    grid-area: name;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center;
    gap: 4px;
    text-align: left;
    padding-right: 24px !important; /* spazio per la × */
  }
  .woocommerce-cart tr.cart_item td.product-name > * { text-align: left; }
  .woocommerce-cart tr.cart_item td.product-price { grid-area: price; }
  .woocommerce-cart tr.cart_item td.product-quantity { grid-area: qty; }
  .woocommerce-cart tr.cart_item td.product-subtotal { grid-area: subtotal; }

  /* Etichette label:valore (Helvetica Bold 14). Alta specificità + !important perché
     Impreza nasconde td.product-price (display:none) nel cart responsive. */
  body.woocommerce-cart table.shop_table.cart tr.cart_item td.product-price,
  body.woocommerce-cart table.shop_table.cart tr.cart_item td.product-quantity,
  body.woocommerce-cart table.shop_table.cart tr.cart_item td.product-subtotal {
    display: flex !important;
    justify-content: space-between;
  }
  .woocommerce-cart tr.cart_item td.product-price::before,
  .woocommerce-cart tr.cart_item td.product-quantity::before,
  .woocommerce-cart tr.cart_item td.product-subtotal::before {
    content: attr(data-title);
    font-family: "Helvetica Neue", sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.4;
    color: #080707;
  }

  /* Remove × in alto a destra della card */
  .woocommerce-cart tr.cart_item td.product-remove {
    position: absolute;
    top: 16px;
    right: 0;
    width: 16px !important;
    padding: 0 !important;
  }

  /* Stepper 24px su mobile (Figma) */
  .woocommerce-cart td.product-quantity .quantity .pmc-qty-btn {
    width: 24px;
    height: 24px;
  }

  /* Azioni (Figma mobile): Update cart sopra, poi coupon dentro una card.
     Ordine via flex order (nel markup Woo coupon precede update). */
  body.woocommerce-cart td.actions {
    display: flex !important;
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }
  body.woocommerce-cart td.actions::after { display: none; }
  body.woocommerce-cart td.actions button[name="update_cart"] {
    order: 1;
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
  }
  /* Card coupon: bg bianco 50%, radius 20, shadow, padding 24 */
  body.woocommerce-cart td.actions .coupon {
    order: 2;
    float: none !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100% !important;
    margin: 0 !important;
    padding: 24px;
    background: rgba(255, 255, 255, .5);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
  }
  body.woocommerce-cart td.actions .coupon input#coupon_code {
    flex: 0 0 auto;
    width: 100%;
  }
  body.woocommerce-cart td.actions .coupon button[name="apply_coupon"] {
    width: 100%;
    margin: 0 !important;
  }
}
