/* ============================================================
   PIF GADGET - panier
   Gabarit WooCommerce « cart » : form.woocommerce-cart-form avec
   table.shop_table.cart, puis .cart-collaterals / .cart_totals.
   ============================================================ */

.panier {
  display: grid;
  /* sans ça, la largeur minimale du tableau élargit toute la page sur mobile */
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}

/* ---------- Tableau des articles ---------- */

.shop_table.cart { width: 100%; border-collapse: collapse; }

.shop_table.cart th {
  text-align: left;
  font-family: var(--titre);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--encre-60);
  padding: 0 10px 12px;
  border-bottom: 2px solid var(--bord);
}

.shop_table.cart td { padding: 16px 10px; border-bottom: 1px solid var(--bord); vertical-align: middle; }

.product-thumbnail img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: 12px;
  padding: 4px;
}

.product-name a { font-family: var(--titre); font-weight: 600; font-size: 1.02rem; line-height: 1.25; }
.product-name a:hover { color: var(--rouge); }
.product-name small { display: block; margin-top: 4px; color: var(--encre-60); font-size: .82rem; }

.product-price, .product-subtotal { font-family: var(--titre); font-weight: 600; white-space: nowrap; }
.product-subtotal { color: var(--rouge); }

.product-remove a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--encre-60);
  background: #F0F3F6;
  font-size: 1.1rem;
  line-height: 1;
}
.product-remove a:hover { background: var(--rouge); color: var(--blanc); }

.quantity {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--encre);
  border-radius: 999px;
  background: var(--blanc);
}
.quantity button { width: 34px; height: 38px; border: 0; background: transparent; font-family: var(--titre); font-size: 1.1rem; cursor: pointer; color: var(--encre); }
.quantity input { width: 34px; height: 38px; border: 0; text-align: center; font-family: var(--titre); font-weight: 600; background: transparent; color: var(--encre); -moz-appearance: textfield; }
.quantity input::-webkit-inner-spin-button, .quantity input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* code promo + mise à jour */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.coupon { display: flex; gap: 8px; flex: 1 1 320px; max-width: 420px; min-width: 0; }
.coupon input {
  flex: 1;
  min-width: 0;
  width: 0; /* sinon la taille native du champ (20 caractères) élargit la ligne */
  padding: 11px 16px;
  font-family: var(--texte);
  font-size: .95rem;
  border: 2px solid var(--bord);
  border-radius: 999px;
}
.coupon input:focus { outline: none; border-color: var(--encre); }
.actions .btn { padding: 11px 18px; font-size: .74rem; white-space: nowrap; }

/* ---------- Totaux ---------- */

/* tout le bloc de droite reste collé en défilant (totaux + encart
   abonnement) : collé seul, le total glissait par-dessus l'encart */
.cart-collaterals { position: sticky; top: 24px; }

.totaux { width: 100%; border-collapse: collapse; font-size: .96rem; }
.totaux th { text-align: left; font-weight: 400; color: var(--encre-60); padding: 10px 0; }
.totaux td { text-align: right; padding: 10px 0; font-family: var(--titre); font-weight: 600; }
.totaux .order-total th, .totaux .order-total td { border-top: 2px solid var(--encre); padding-top: 14px; font-size: 1.15rem; color: var(--encre); font-family: var(--titre); font-weight: 600; }
.totaux .order-total td { color: var(--rouge); font-size: 1.4rem; }
.totaux small { display: block; font-family: var(--texte); font-weight: 400; font-size: .78rem; color: var(--encre-60); }

/* barre vers la livraison offerte */
.livraison-offerte { margin: 4px 0 16px; font-size: .86rem; }
.livraison-offerte__barre { height: 8px; border-radius: 999px; background: #EEF1F5; overflow: hidden; margin-top: 8px; }
.livraison-offerte__barre span { display: block; height: 100%; width: 64%; background: var(--rouge); border-radius: inherit; }

.checkout-button { width: 100%; margin-top: 18px; }
.cart_totals .continuer { display: block; text-align: center; margin-top: 12px; font-size: .9rem; }

.paiements { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.paiements span { padding: 4px 8px; border: 1px solid var(--bord); border-radius: 6px; font-family: var(--titre); font-size: .7rem; font-weight: 600; color: var(--encre-60); }

/* renvoi abonnement sous les totaux */
.panier-abo {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--jaune);
  border: 2px solid var(--encre);
  border-radius: 18px;
  font-size: .9rem;
}
.panier-abo b { font-family: var(--titre); font-weight: 600; font-size: 1rem; display: block; margin-bottom: 4px; }
.panier-abo .lien-texte { display: inline-block; margin-top: 8px; }

/* ---------- Mobile ---------- */

@media (max-width: 960px) {
  .panier { grid-template-columns: minmax(0, 1fr); }
  .cart-collaterals { position: static; }
}

@media (max-width: 700px) {
  /* tableau → une carte par article, comme shop_table_responsive */
  .shop_table.cart, .shop_table.cart tbody { display: block; }
  .shop_table.cart thead { display: none; }
  .shop_table.cart tr {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    grid-template-areas:
      "img nom sup"
      "img prix prix"
      "qte qte total";
    gap: 8px 14px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--bord);
  }
  .shop_table.cart td { padding: 0; border: 0; }
  .product-thumbnail { grid-area: img; align-self: start; }
  .product-name { grid-area: nom; }
  .product-remove { grid-area: sup; align-self: start; }
  .product-price { grid-area: prix; font-weight: 500; color: var(--encre-60); }
  .product-price::before { content: "Prix unitaire : "; font-family: var(--texte); font-weight: 400; }
  .product-price { white-space: normal; }
  .product-name { min-width: 0; }
  .product-quantity { grid-area: qte; }
  .product-subtotal { grid-area: total; justify-self: end; font-size: 1.1rem; }
  .coupon { max-width: none; flex-basis: 100%; }
  .actions .btn--contour { width: 100%; }
}
