/* =====================================================
   WL — PANIER (VERSION FINALE CLEAN)
   Objectifs :
   - Coupon propre (desktop + mobile)
   - Bouton "mettre à jour le panier" supprimé
   - Labels Prix/Quantité/Sous-total supprimés dans les cellules (desktop)
   - Totaux : montants pas collés au bord + TVA ne déborde pas
   - Ligne "⚠️ Sans caution..." : icône + texte sur 1 seule ligne, centrée
   - Marges gauche/droite légères
===================================================== */

body.woocommerce-cart{
  --wl-green:#678269;
  --wl-peach:#DFB690;
  --wl-bg:#F6F9F7;
}

/* Marges globales */
body.woocommerce-cart .woocommerce{
  padding-left: 18px !important;
  padding-right: 18px !important;
}
@media (max-width:768px){
  body.woocommerce-cart .woocommerce{
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* Enlever l'effet "tout en gras" */
body.woocommerce-cart .woocommerce-cart-form,
body.woocommerce-cart .cart_totals{ font-weight: 400; }
body.woocommerce-cart .woocommerce-cart-form th,
body.woocommerce-cart .cart_totals th{ font-weight: 600; }
body.woocommerce-cart .woocommerce-cart-form td,
body.woocommerce-cart .cart_totals td{ font-weight: 500; }

/* Supprimer "Mettre à jour le panier" */
body.woocommerce-cart button[name="update_cart"],
body.woocommerce-cart .actions button[name="update_cart"]{
  display:none !important;
}

/* =============================
   Bandeau info (ton bloc custom)
============================= */
body.woocommerce-cart .wl-cart-info{
  background: var(--wl-bg);
  border: 2px solid rgba(223,182,144,.75);
  border-left: 8px solid var(--wl-green);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 16px 0 18px;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.35;
}
body.woocommerce-cart .wl-cart-info strong{
  color: var(--wl-green);
  font-weight: 800;
  display:inline-block;
  margin-bottom:6px;
}

/* =============================
   Coupon
============================= */
body.woocommerce-cart td.actions .coupon{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
body.woocommerce-cart td.actions .coupon #coupon_code{
  flex: 1 1 220px;
  min-width: 220px;
  max-width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
}
body.woocommerce-cart td.actions .coupon button{
  flex: 0 1 280px;
  min-width: 280px;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--wl-peach);
  border: 0;
  font-weight: 700;
  white-space: normal;
  line-height: 1.15;
}

/* Mobile coupon en colonne */
@media (max-width:768px){
  body.woocommerce-cart td.actions .coupon{
    display:grid;
    grid-template-columns: 1fr;
    gap:10px;
  }
  body.woocommerce-cart td.actions .coupon #coupon_code,
  body.woocommerce-cart td.actions .coupon button{
    width:100%;
    min-width:0;
  }
}

/* =============================
   Labels mobile (data-title) SANS ":"
============================= */
@media (max-width:768px){
  body.woocommerce-cart table.shop_table_responsive tr.cart_item td:not(.product-remove)::before{
    content: attr(data-title);
    font-weight: 600;
    opacity: .75;
  }
}

/* Desktop : enlever les dénominations dans les cellules (déjà en entête) */
@media (min-width:769px){
  body.woocommerce-cart table.shop_table_responsive tr td::before{
    display:none !important;
    content:none !important;
  }
}

/* =============================
   Bouton commander
============================= */
body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button{
  background: var(--wl-green) !important;
  color:#fff !important;
  border-radius: 14px;
  padding: 16px 18px;
  font-weight: 800;
}
@media (max-width:768px){
  body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button{
    width:100%;
  }
}

/* =====================================================
   TOTAL PANIER — réglages propres desktop
===================================================== */
@media (min-width:769px){

  /* Montants pas collés au bord */
  body.woocommerce-cart .cart_totals table.shop_table td{
    text-align:right !important;
    padding-right: 18px !important;
  }

  /* TVA : reste dans la cellule et ne déborde pas */
  body.woocommerce-cart .cart_totals .includes_tax,
  body.woocommerce-cart .cart_totals small.includes_tax{
    display: inline-block !important;
    max-width: 170px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    font-size: 12px !important;
    opacity: .75 !important;
    margin-left: 6px !important;
    text-align: right !important;
    vertical-align: middle !important;
  }

  /* Ligne warning (celle "Sans caution...") :
     on la centre, et on force tout en inline + pas de <br> */
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child td,
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child th{
    text-align:center !important;
    white-space: nowrap !important;   /* 1 seule ligne */
    padding: 14px 16px !important;
  }

  body.woocommerce-cart .cart_totals table.shop_table tr:last-child td br,
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child th br{
    display:none !important;
  }

  body.woocommerce-cart .cart_totals table.shop_table tr:last-child td *,
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child th *{
    display:inline !important;
    float:none !important;
    width:auto !important;
    margin:0 !important;
    vertical-align: middle !important;
  }
}
/* =====================================================
   WL — FIX "CAUTION" SUR 1 LIGNE + SUPPRIMER ".." MOBILE
===================================================== */

/* 1) Desktop : empêcher le retour à la ligne sur l'intitulé caution */
@media (min-width: 769px){
  body.woocommerce-cart .cart_totals table.shop_table th,
  body.woocommerce-cart .cart_totals table.shop_table td{
    vertical-align: middle;
  }

  /* on force la cellule de gauche (label) à ne pas casser en 2 lignes */
  body.woocommerce-cart .cart_totals table.shop_table th{
    white-space: nowrap !important;
  }
}

/* 2) Mobile : enlever les petits points / ":" parasites avant "Sans caution..." */
@media (max-width: 768px){
  /* si le thème ajoute un pseudo-élément avant la ligne warning */
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child td::before,
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child th::before{
    content: none !important;
    display: none !important;
  }
}
/* =====================================================
   WL — MOBILE : "Sans caution..." sur 1 seule ligne + enlever ".."
===================================================== */

@media (max-width: 768px){

  /* Cible la dernière ligne du tableau Total panier */
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child td,
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child th{
    text-align: center !important;
    white-space: nowrap !important;        /* ✅ 1 seule ligne */
    font-size: 14px !important;           /* un poil plus petit pour tenir */
  }

  /* Enlève les pseudo éléments qui créent ".." / ":" / labels */
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child td::before,
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child th::before,
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child td::after,
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child th::after{
    content: none !important;
    display: none !important;
  }

  /* Si un <br> est injecté, on le supprime */
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child br{
    display: none !important;
  }

  /* Tout ce qui est dedans reste inline (pas de bloc qui force la 2e ligne) */
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child td *,
  body.woocommerce-cart .cart_totals table.shop_table tr:last-child th *{
    display: inline !important;
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    vertical-align: middle !important;
  }
}
