/* =====================================================================
   Panier CSB : panier latéral (tout le site), boutons, lignes de panier, récapitulatif.
   Chargé par partials/home/header-04.php. Pages boutique : assets/css/csb-boutique.css.
   ===================================================================== */
:root {
	--shop-blanc: #FFFFFF;
	--shop-doux: #F7F8F5;
	--shop-vert: #004540;
	--shop-vert-2: #0B5A53;
	--shop-mil: #FFE175;
	--shop-encre: #16231A;
	--shop-gris: #56635A;
	--shop-trait: #E2E8E3;
	--shop-erreur: #B42318;
	--shop-rayon: 12px;
	--shop-ease: cubic-bezier(.2, .7, .2, 1);
}

/* --- Boutons ----------------------------------------------------------------------------------- */
.shop-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 24px; border-radius: 999px; border: 1.5px solid transparent; font-family: var(--csb-font-texte); font-size: 15px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s, transform .15s; }
.shop-btn:active { transform: translateY(1px); }
.shop-btn--primary { background: var(--shop-vert); color: #fff; }
.shop-btn--primary:hover, .shop-btn--primary:focus-visible { background: var(--shop-vert-2); color: #fff; }
.shop-btn--ghost { background: #fff; color: var(--shop-vert); border-color: var(--shop-vert); }
.shop-btn--ghost:hover, .shop-btn--ghost:focus-visible { background: var(--shop-doux); color: var(--shop-vert); }
.shop-btn--block { display: flex; width: 100%; }
.shop-btn--lg { min-height: 56px; font-size: 16px; }
.shop-btn[disabled] { opacity: .6; cursor: progress; }
.shop-btn:focus-visible, .csb-cart :is(a, button, input):focus-visible, .csb-cart-link:focus-visible { outline: 3px solid var(--shop-mil); outline-offset: 2px; box-shadow: 0 0 0 5px var(--shop-vert); }

/* --- Panier latéral ------------------------------------------------------------------------------ */
html.csb-cart-lock, html.csb-cart-lock body { overflow: hidden; }
.csb-cart { position: fixed; inset: 0; z-index: 10050; }
.csb-cart[hidden] { display: none; }
.csb-cart-overlay { position: absolute; inset: 0; background: rgba(22, 35, 26, .45); opacity: 0; transition: opacity .28s var(--shop-ease); }
.csb-cart-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); display: flex; flex-direction: column; background: #fff; box-shadow: -12px 0 40px rgba(22, 35, 26, .16); transform: translateX(100%); transition: transform .28s var(--shop-ease); outline: none; }
.csb-cart.is-open .csb-cart-overlay { opacity: 1; }
.csb-cart.is-open .csb-cart-panel { transform: none; }
.csb-cart-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 18px 24px; border-bottom: 1px solid var(--shop-trait); }
body .csb-cart h2:not(#csb) { margin: 0; font-size: 22px; line-height: 1.2; color: var(--shop-vert); }
.csb-cart-head-count { font-family: var(--csb-font-texte); font-size: 15px; font-weight: 600; color: var(--shop-gris); }
.csb-cart-close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--shop-encre); font-size: 20px; cursor: pointer; }
.csb-cart-close:hover { background: var(--shop-doux); }
.csb-cart-flash:empty { display: none; }
.csb-cart-flash { margin: 0; padding: 12px 24px; background: #EAF4EE; color: var(--shop-vert); font-size: 14px; font-weight: 600; line-height: 1.45; }
.csb-cart-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.csb-cart-body > .cl-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 24px; }
.cs--drawer { flex: none; padding: 16px 24px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--shop-trait); background: var(--shop-doux); }
.cs--drawer .shop-btn + .shop-btn { margin-top: 10px; }

/* --- Lignes de panier (panier latéral, page panier, récapitulatif, confirmation) ------------------ */
.cl-list { list-style: none; margin: 0; padding: 0; }
.cl { display: grid; grid-template-columns: 80px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--shop-trait); }
.cl:last-child { border-bottom: 0; }
.cl.is-new { animation: cl-new 1.4s var(--shop-ease); }
@keyframes cl-new { 0% { background: #FFF6CC; } 100% { background: transparent; } }
.cl-media { position: relative; display: block; width: 80px; height: 80px; border-radius: 10px; overflow: visible; background: var(--shop-doux); }
.cl-media img { width: 80px; height: 80px; object-fit: cover; border-radius: 10px; display: block; }
.cl-ph { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 10px; background: var(--shop-doux); color: #8FA697; font-size: 28px; }
.cl-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cl-info p { margin: 0; }
.cl-name { font-family: var(--csb-font-texte); font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--shop-encre); text-decoration: none; }
a.cl-name:hover { color: var(--shop-vert); text-decoration: underline; }
.cl-meta { font-size: 13.5px; line-height: 1.45; color: var(--shop-gris); }
.cl-price { font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--shop-vert); }
.cl-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; }
.cl-unit { font-size: 13.5px; color: var(--shop-gris); }
.cl-stepper { display: inline-flex; align-items: center; border: 1px solid #CBD5CE; border-radius: 999px; background: #fff; }
.cl-step { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; color: var(--shop-encre); font-size: 13px; cursor: pointer; border-radius: 50%; }
.cl-step:hover:not([disabled]) { background: var(--shop-doux); }
.cl-step[disabled] { color: #B5C0B8; cursor: not-allowed; }
.cl-stepper input { width: 44px; height: 40px; border: 0; background: transparent; text-align: center; font-size: 15px; font-weight: 700; color: var(--shop-encre); -moz-appearance: textfield; }
.cl-stepper input::-webkit-outer-spin-button, .cl-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cl-remove { margin-left: auto; min-height: 40px; padding: 0 4px; border: 0; background: transparent; color: var(--shop-gris); font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cl-remove:hover { color: var(--shop-erreur); }
.cl-qty-badge { position: absolute; top: -8px; right: -8px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--shop-gris); color: #fff; font-size: 12.5px; font-weight: 700; line-height: 24px; text-align: center; }

/* --- Récapitulatif chiffré ----------------------------------------------------------------------- */
.cs-rows { margin: 0 0 12px; }
.cs-row { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: 14px; line-height: 1.45; }
.cs-row dt { font-weight: 500; color: var(--shop-gris); }
.cs-row dd { margin: 0; text-align: right; color: var(--shop-encre); font-weight: 600; }
.cs-total { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--shop-trait); font-size: 16px; }
.cs-total dt, .cs-total dd { color: var(--shop-encre); font-weight: 700; }
.cs-note { margin: 0 0 16px; font-size: 13px; line-height: 1.55; color: var(--shop-gris); }
.cs-link { display: block; margin-top: 12px; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--shop-vert); text-decoration: underline; text-underline-offset: 3px; }

/* --- États --------------------------------------------------------------------------------------- */
.cart-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 48px 24px; text-align: center; }
.cart-empty-ic { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 14px; border-radius: 50%; background: var(--shop-doux); color: var(--shop-vert); font-size: 28px; }
.cart-empty p { margin: 0; }
.cart-empty-title { font-family: var(--csb-font-titre); font-size: 21px; font-weight: 600; color: var(--shop-encre); }
.cart-empty-text { margin-bottom: 20px !important; font-size: 15px; color: var(--shop-gris); }
.cart-notice { margin: 16px 24px 0; padding: 12px 14px; border-radius: 8px; background: #FFF6CC; color: #5C4A00; font-size: 13.5px; line-height: 1.5; }

/* --- Icône du header ----------------------------------------------------------------------------- */
.header-section-4 .csb-cart-link { cursor: pointer; }

@media (max-width: 480px) {
	.csb-cart-panel { width: 100vw; }
	.csb-cart-head { padding-left: 20px; }
	.csb-cart-body > .cl-list, .cs--drawer { padding-left: 20px; padding-right: 20px; }
	.cl { grid-template-columns: 64px 1fr; gap: 12px; }
	.cl-media, .cl-media img { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
	.csb-cart-overlay, .csb-cart-panel, .shop-btn { transition: none; }
	.cl.is-new { animation: none; }
}
