/* cart.css - Panier
   Réutilise le design system de theme.css, les tokens absents sont aliasés. */

.cart {
  --surf: var(--blanc);
  --line: var(--ligne);
  --ink:  var(--noir);
  --g900: var(--noir);
  --g100: #dcdcdc;
  --bg:   var(--fond);
  --or600: var(--or-h);
}

/* En-tête compact sur le panier (on voit le panier plus vite) */
.woocommerce-cart .cathead .wrap { padding: 12px 32px 14px; }
.woocommerce-cart .cathead .crumb { margin-bottom: 7px; }
.woocommerce-cart .cathead h1 { font-size: clamp(22px, 2.6vw, 30px); margin: 2px 0 0; }
.woocommerce-cart .cathead .ccount { margin-top: 3px; }

.cart { padding: 24px 0 72px; }
.cart-grid { display: grid; grid-template-columns: 1fr 360px; gap: 34px; align-items: start; }

/* Carte blanche des articles */
.cart-panel { background: var(--surf); border: 1px solid var(--line); border-radius: var(--r); padding: 2px 22px; box-shadow: var(--sh-sm); margin-top: 6px; }
.cart-panel .citem:first-child { border-top: none; }

/* Bandeau réglementaire */
.cbanner { display: flex; gap: 12px; align-items: flex-start; background: #fff8e1; border: 1px solid #f3df9e; border-radius: var(--rs); padding: 14px 16px; font-size: 14px; color: #6b5800; margin-bottom: 6px; }
.cbanner svg { width: 20px; height: 20px; flex: 0 0 auto; color: #b88a00; margin-top: 1px; }
.cbanner b { color: #5a4500; }

/* Lignes article */
.citem { display: grid; grid-template-columns: 92px 1fr auto; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); align-items: center; transition: opacity .2s; }
.citem.is-removing { opacity: .4; pointer-events: none; }
.citem .ci-img { width: 92px; height: 92px; border-radius: var(--rs); background: var(--g50); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.citem .ci-img a, .citem .ci-img img { width: 100%; height: 100%; display: block; }
.citem .ci-img img { object-fit: cover; }
.citem .ci-img svg { width: 30px; height: 30px; color: #b5b5b5; }
.ci-info .sbrand { margin-bottom: 3px; }
.ci-info h3 { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 8px; }
.ci-info h3 a:hover { box-shadow: inset 0 -2px 0 var(--or); }
.ci-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ci-unit { font-size: 13px; color: var(--muted); }
.ci-right { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; text-align: right; }
.ci-line { font-size: 17px; font-weight: 800; white-space: nowrap; }

/* Sélecteur de quantité (scopé : ne pas écraser le .qty du mini-cart) */
.cart .qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 50px; overflow: hidden; }
.cart .qty button { width: 34px; height: 38px; border: none; background: var(--surf); font-size: 18px; line-height: 1; color: var(--g700); cursor: pointer; }
.cart .qty button:hover { background: var(--g50); color: var(--ink); }
.cart .qty .q { width: 42px; height: 38px; border: none; text-align: center; font-family: var(--f); font-weight: 700; font-size: 15px; color: var(--ink); outline: none; -moz-appearance: textfield; background: transparent; }
.cart .qty .q::-webkit-outer-spin-button, .cart .qty .q::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart .qty--single { padding: 0 14px; }
.cart .qty--single .q { width: auto; min-width: 20px; }

.ci-remove { background: none; border: none; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding-bottom: 2px; }
.ci-remove:hover { color: #c0392b; box-shadow: inset 0 -2px 0 #c0392b; }
.ci-remove svg { width: 14px; height: 14px; }

/* Récapitulatif */
.summary { position: sticky; top: calc(var(--header-h) + 16px); background: var(--surf); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--sh-sm); }
.summary h2 { font-size: 17px; margin-bottom: 14px; }
.srow { display: flex; justify-content: space-between; align-items: center; font-size: 14.5px; padding: 7px 0; color: #3c3c3c; }
.srow.muted { color: var(--muted); font-size: 13px; }
.srow .free { color: var(--success); font-weight: 700; }
.sdiv { border-top: 1px solid var(--line); margin: 10px 0; }
.stotal { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0 2px; }
.stotal .l { font-weight: 800; font-size: 16px; }
.stotal .v { font-weight: 800; font-size: 24px; }
.stax { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }

/* Code promo (scopé) */
.summary .promo { display: flex; gap: 8px; margin: 14px 0 4px; }
.summary .promo input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 50px; padding: 10px 14px; font-family: var(--f); font-size: 13.5px; outline: none; }
.summary .promo input:focus { border-color: var(--g700); }
.summary .promo button { border: 1.5px solid var(--g700); background: var(--surf); border-radius: 50px; padding: 0 16px; font-weight: 700; font-size: 13.5px; cursor: pointer; flex: 0 0 auto; font-family: var(--f); }
.summary .promo button:hover { background: var(--g900); color: #fff; }
.promo-coupons { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.promo-coupons:empty { display: none; }
.cpn { display: inline-flex; align-items: center; gap: 7px; background: var(--g50); border: 1px solid var(--line); border-radius: 50px; padding: 5px 8px 5px 12px; font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.cpn-x { border: none; background: #e2e2e2; width: 17px; height: 17px; border-radius: 50%; color: #555; font-size: 12px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cpn-x:hover { background: var(--g700); color: #fff; }
#promoMsg { font-size: 12.5px; min-height: 15px; font-weight: 600; margin-top: 8px; }

.btn-checkout { width: 100%; justify-content: center; margin-top: 8px; }
.continue { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--ink); }
.continue svg { width: 15px; height: 15px; }
.continue:hover { box-shadow: inset 0 -2px 0 var(--or); }
.sreassure { display: flex; flex-direction: column; gap: 11px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.sreassure div { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.sreassure svg { width: 17px; height: 17px; color: var(--g700); flex: 0 0 auto; }

/* Panier vide */
.cart-empty { text-align: center; padding: 70px 20px; }
.cart-empty svg { width: 56px; height: 56px; color: var(--g100); }
.cart-empty b { display: block; font-size: 21px; margin: 16px 0 6px; }
.cart-empty p { color: var(--muted); margin-bottom: 22px; }

/* État de chargement (AJAX) */
.summary.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }

/* Suggestions « Complétez votre commande » */
.csuggest { margin-top: 44px; }
.csuggest-head { margin-bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.csuggest-head h2 { font-size: clamp(19px, 2.2vw, 24px); font-weight: 800; letter-spacing: -.02em; }
.csuggest-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.csuggest-nav { display: flex; gap: 10px; flex: 0 0 auto; }
.csuggest-nav button { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surf); color: var(--g700); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color .15s, background .15s; }
.csuggest-nav button:hover { border-color: var(--g700); }
.csuggest-nav button:disabled { opacity: .35; cursor: default; }
.csuggest-nav svg { width: 20px; height: 20px; }
.csuggest-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: 8px; scrollbar-width: none; }
.csuggest-track::-webkit-scrollbar { display: none; }
.cs-card { flex: 0 0 218px; scroll-snap-align: start; background: var(--surf); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-sm); display: flex; flex-direction: column; transition: box-shadow .16s, transform .16s; }
.cs-card:hover { box-shadow: var(--sh-md); transform: translateY(-3px); }
.cs-img { aspect-ratio: 4/3; background: var(--g50); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cs-img img { width: 100%; height: 100%; object-fit: cover; }
.cs-img svg { width: 30px; height: 30px; color: #c4c4c4; }
.cs-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cs-name { font-size: 13.5px; font-weight: 700; line-height: 1.3; color: var(--ink); display: block; margin-bottom: 6px; }
.cs-name:hover { box-shadow: inset 0 -2px 0 var(--or); }
.cs-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cs-pr { font-size: 15.5px; font-weight: 800; }
.cs-pr del { font-size: 12px; font-weight: 500; color: var(--muted); margin-right: 4px; }
.cs-pr ins { text-decoration: none; }
.cs-add { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--g700); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s, color .15s; }
.cs-add:hover { background: var(--or); color: var(--noir); }
.cs-add svg { width: 18px; height: 18px; }
@media (max-width: 560px) { .cs-card { flex-basis: 158px; } }

/* Responsive */
@media (max-width: 920px) {
  .cart-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 560px) {
  .citem { grid-template-columns: 72px 1fr; gap: 14px; }
  .citem .ci-img { width: 72px; height: 72px; }
  .citem .ci-right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; text-align: left; }
}
