/* ════════════════════════════════════════════════════════════
   Panier en panneau latéral (Loïc, 21/11/2026) : collé à droite, sur toute la hauteur, il glisse depuis le bord.
   S'applique à la fenêtre du panier (templates/modal-cart.php) quand elle porte .cz-drawer, c.-à-d. quand
   CUSTOMIIZER_CART_DRAWER vaut true (assets.php). À false, l'ancienne fenêtre (styles/cart-modal.css) revient
   telle quelle : ce fichier n'est alors plus chargé.
   ════════════════════════════════════════════════════════════ */

.cart-modal.cz-drawer {
  padding: 0;
  justify-content: flex-end;
  align-items: stretch;
  animation: czDrawerFade 0.2s ease;
}

.cart-modal.cz-drawer .cart-modal-content {
  width: 440px;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(53, 248, 251, 0.16);
  border-radius: 0;
  box-shadow: -1.5rem 0 4rem rgba(0, 0, 0, 0.55);
  animation: czDrawerIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* La liste des articles prend toute la place libre et défile seule : total et bouton restent en bas. */
.cart-modal.cz-drawer .cart-body {
  flex: 1 1 auto;
  min-height: 9rem;
}

.cart-modal.cz-drawer .cart-header {
  padding: 1rem 1.375rem 0.875rem;
}

.cart-modal.cz-drawer .cart-footer {
  border-top: 1px solid rgba(53, 248, 251, 0.14);
  padding-top: 0.875rem;
}

/* « Plus que X € pour obtenir … de livraison offerts » : une phrase qui passe à la ligne, pas trois colonnes. */
.cart-modal.cz-drawer .cart-shipping-offer__text {
  display: block;
}

.cart-modal.cz-drawer .cart-shipping-offer__text i {
  margin-right: 0.4rem;
}

@keyframes czDrawerIn {
  from { transform: translateX(100%); }
  to { transform: none; }
}

@keyframes czDrawerFade {
  from { background-color: rgba(0, 0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .cart-modal.cz-drawer,
  .cart-modal.cz-drawer .cart-modal-content { animation: none; }
}

/* Mobile : plein écran (l'ancienne fenêtre montait par le bas sur 80 % de la hauteur). */
@media screen and (max-width: 767px) {
  .cart-modal.cz-drawer {
    justify-content: flex-end;
    align-items: stretch;
  }
  .cart-modal.cz-drawer .cart-modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100dvh;
    max-height: none !important;
    border-left: 0;
    border-radius: 0 !important;
  }
}

/* ── Bandeau du haut : points du client connecté, ou invitation à se connecter ── */
.cz-drawer-banner {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.375rem;
  background: linear-gradient(135deg, #087E83, #35F8FB);
  color: #052326;
  font-size: var(--text-sm);
  line-height: 1.35;
}

.cz-drawer-banner__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(5, 35, 38, 0.14);
  font-size: 1rem;
}

.cz-drawer-banner__text { flex: 1; min-width: 0; }
.cz-drawer-banner__text strong { font-weight: 800; }

.cz-drawer-banner__btn {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  background: #052326;
  color: #ffffff;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cz-drawer-banner__btn:hover,
.cz-drawer-banner__btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0.5rem 1rem rgba(5, 35, 38, 0.3);
}

/* Visiteur : accroche centrée, deux boutons côte à côte (« Déjà membre » / « Je m’inscris »). */
.cz-drawer-banner--guest {
  flex-direction: column;
  align-items: stretch;
  gap: 0.625rem;
  text-align: center;
}

.cz-drawer-banner__title {
  margin: 0;
  font-size: var(--text-sm);
}

.cz-drawer-banner__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.cz-drawer-banner--guest .cz-drawer-banner__btn {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: var(--text-sm);
}

.cz-drawer-banner__btn--ghost {
  background: rgba(255, 255, 255, 0.92);
  color: #052326;
}

/* Panier vide : message centré dans le panneau, bouton vers la création ; le pied (note + boutique) est masqué. */
.cart-modal.cz-drawer .cart-body:has(.empty-cart) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-modal.cz-drawer .empty-cart-message { display: none; }

.cart-modal.cz-drawer .empty-cart-drawer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: 19rem;
  text-align: center;
}

.empty-cart-drawer__title {
  margin: 0;
  font-size: var(--text-2xl, 1.6rem);
  font-weight: 800;
  line-height: 1.15;
  color: #ffffff;
}

.empty-cart-drawer__text {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: rgba(232, 247, 243, 0.7);
}

.empty-cart-drawer__cta {
  margin-top: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #35F8FB, #087E83);
  color: #ffffff;
  font-weight: 700;
  font-size: var(--text-sm);
  text-decoration: none;
}

.cart-modal.cz-drawer .cart-modal-content:has(.empty-cart) .cart-footer { display: none; }

/* Thème clair : bandeau canard, texte blanc. */
html[data-theme="light"] .cart-modal.cz-drawer .cart-modal-content {
  border-left: 1px solid rgba(3, 111, 123, 0.21);
  box-shadow: -1.5rem 0 4rem rgba(10, 12, 15, 0.18);
}

html[data-theme="light"] .cart-modal.cz-drawer .cart-footer {
  border-top: 1px solid rgba(3, 111, 123, 0.16);
}

html[data-theme="light"] .cz-drawer-banner {
  background: #036F7B;   /* aplat canard, comme les boutons d'action du thème clair */
  color: #ffffff;
}

html[data-theme="light"] .cz-drawer-banner__icon { background: rgba(255, 255, 255, 0.18); }

html[data-theme="light"] .cz-drawer-banner__btn {
  background: #ffffff;
  color: #036F7B;
}

html[data-theme="light"] .cz-drawer-banner__btn--ghost {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

html[data-theme="light"] .empty-cart-drawer__title { color: #0A0C0F; }
html[data-theme="light"] .empty-cart-drawer__text { color: #4A5560; }

/* Bouton de Lya (extension lya-chatbot, z-index 99999) : passe sous le panneau tant qu'il est ouvert, au lieu de
   couvrir le bouton « Continuer mes achats » (Loïc, 21/11/2026). */
body:has(#cartModal.cz-drawer[style*="flex"]) #lya-bubble {
  z-index: 999;
}
