/* =====================================================================
   Braillard — Page panier /cart/ (issue #19). 2 colonnes : articles | totaux.
   ===================================================================== */

.woocommerce .br-cartp,
.br-cartp{
  display: grid;
  /* Figma « shop - cart » : articles 929px | gouttière 170px | totaux 517px (échelle 1728). */
  grid-template-columns: minmax(0, 1fr) clamp(300px, 30vw, 517px);
  column-gap: 170px; /* gouttière fixe = maquette */
  align-items: start;
  font-family: var(--br-font-body); color: var(--br-black);
  /* PLEINE LARGEUR (full-bleed) : sort du conteneur de page bridé (~1140). */
  width: 100vw; max-width: 100vw;
  margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
  box-sizing: border-box;
  padding: clamp(20px, 3vw, 40px) clamp(20px, 4vw, 56px) clamp(40px, 6vw, 96px);
}

/* ---------- Colonne gauche : articles ---------- */
.br-cartp__items{ margin: 0; }
.br-cartp__head{
  display: flex; justify-content: space-between; align-items: flex-start;
  /* même hauteur que « Total panier » -> les 2 traits s'alignent (maquette). */
  min-height: clamp(46px, 3.2vw, 56px); box-sizing: border-box;
  font-size: clamp(13px, .9vw, 15px); color: #6b6660;
  border-bottom: 1px solid rgba(0,0,0,.2);
}
.br-cartp-list{ list-style: none; margin: 0; padding: 0; }
.br-cartp-item{ padding: clamp(18px, 1.9vw, 24px) 0; border-bottom: 1px solid rgba(0,0,0,.2); }
.br-cartp-item__top{ display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.br-cartp .br-cartp-item__name{
  font-weight: 500; font-size: clamp(18px, 1.4vw, 24px); line-height: 1.3;
  color: var(--br-black); text-decoration: none !important;
}
.br-cartp a.br-cartp-item__name:hover{ opacity: .6; }
.br-cartp-item__total{ font-size: clamp(15px, 1.05vw, 18px); color: var(--br-black); white-space: nowrap; }
.br-cartp-item__bottom{ display: flex; align-items: center; justify-content: space-between; margin-top: clamp(14px, 1.5vw, 20px); }

/* Stepper quantité : ⊕ (cercle) | nombre encadré | ⊖ (cercle) — comme le Figma. */
.br-cartp-qty{ display: inline-flex; align-items: center; gap: 12px; }
.br-cartp-qty__btn{
  width: 40px; height: 40px; flex: 0 0 40px; padding: 0;
  border: 1px solid rgba(0,0,0,.35); border-radius: 50%; background: none; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--br-black);
  display: inline-flex; align-items: center; justify-content: center; transition: background .2s ease;
}
.br-cartp-qty__btn:hover{ background: rgba(0,0,0,.06); }
.br-cartp-qty .quantity{ margin: 0; }
.br-cartp-qty input.qty{
  width: 56px; height: 48px; text-align: center; border: 1px solid rgba(0,0,0,.35); background: none;
  font-family: var(--br-font-body); font-size: 16px; -moz-appearance: textfield; appearance: textfield;
}
.br-cartp-qty input.qty::-webkit-outer-spin-button,
.br-cartp-qty input.qty::-webkit-inner-spin-button{ -webkit-appearance: none; margin: 0; }
.br-cartp-qty--single{ font-family: var(--br-font-body); font-size: 16px; padding: 12px 18px; border: 1px solid rgba(0,0,0,.35); }

.br-cartp a.br-cartp-remove{ color: #8a857e !important; font-size: 22px; line-height: 1; text-decoration: none !important; background: none; transition: color .2s ease; }
.br-cartp a.br-cartp-remove:hover{ color: var(--br-black) !important; }

/* bouton natif « mettre à jour » masqué (le stepper le déclenche) */
.br-cartp__hidden{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Colonne droite : totaux ---------- */
.br-cartp__aside{ position: sticky; top: 210px; }
.br-cart-totals__title{
  font-family: var(--br-font-body); font-weight: 400;
  font-size: clamp(20px, 1.55vw, 25px); color: var(--br-black); margin: 0 0 clamp(14px, 1.5vw, 20px);
  /* même hauteur que le header « Produit/Total » -> traits alignés (maquette). */
  min-height: clamp(46px, 3.2vw, 56px); box-sizing: border-box;
  border-bottom: 1px solid rgba(0,0,0,.2);
}

/* Code promo */
.br-cart-promo{ margin-bottom: clamp(14px, 1.6vw, 22px); }
.br-cart-promo__toggle{
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: 0; padding: 6px 0; cursor: pointer;
  font-family: var(--br-font-body); font-size: clamp(14px, 1vw, 16px); color: var(--br-black);
}
.br-cart-promo__toggle[aria-expanded="true"] .ph-caret-down{ transform: rotate(180deg); }
.br-cart-promo__toggle .ph-caret-down{ transition: transform .2s ease; }
.br-cart-promo__form{ display: flex; gap: 8px; margin-top: 12px; }
.br-cart-promo__input{
  flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 12px;
  border: 1px solid rgba(0,0,0,.35); border-radius: 0; font-family: var(--br-font-body); font-size: 15px;
}
.br-cart-promo__apply{
  flex: 0 0 auto; height: 44px; padding: 0 16px; cursor: pointer;
  background: transparent; color: var(--br-black); border: 1px solid var(--br-black); border-radius: 0;
  font-family: var(--br-font-body); font-size: 14px; transition: background .2s ease, color .2s ease;
}
.br-cart-promo__apply:hover{ background: var(--br-black); color: var(--br-white); }

/* Lignes de totaux */
.br-cart-totals__row{
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: clamp(12px, 1.3vw, 16px) 0; font-size: clamp(15px, 1.05vw, 18px); color: var(--br-black);
  border-top: 1px solid rgba(0,0,0,.1);
}
.br-cart-totals__subtotal{ border-top: 0; }
.br-cart-totals__total{
  border-top: 1px solid var(--br-black); margin-top: clamp(18px, 2vw, 30px); padding-top: clamp(16px, 1.6vw, 22px);
  font-size: clamp(22px, 1.7vw, 28px); font-weight: 500;
}
.br-cart-totals__total .woocommerce-Price-amount{ font-weight: 500; }
.br-cart-totals__total small,
.br-cart-totals__total .includes_tax{ display: block; font-size: 12px; font-weight: 400; color: #6b6660; margin-top: 4px; }

/* Bouton « Valider la commande » */
.br-cart-totals__checkout{
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: clamp(18px, 2vw, 28px); padding: 16px 20px; text-decoration: none !important;
  background: var(--br-black); color: var(--br-white);
  border: 1px solid var(--br-black); border-radius: 0;
  font-family: var(--br-font-body); font-size: clamp(14px, 1vw, 16px); letter-spacing: .01em;
  transition: background .2s ease, color .2s ease;
}
.br-cart-totals__checkout:hover{ background: transparent; color: var(--br-black); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px){
  .woocommerce .br-cartp, .br-cartp{ grid-template-columns: 1fr; column-gap: 0; row-gap: clamp(30px, 6vw, 48px); }
  .br-cartp__aside{ position: static; }
}
