/* NovaCBD — panier : bulle qui vole, confirmation sous l'icône, tiroir à droite. Couleurs du thème (style.css). */

/* la bulle qui vole jusqu'au panier (panier.js l'anime) */
.vol {
  position: fixed; z-index: 120; pointer-events: none; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--or-clair) 30%, var(--surface)), var(--surface) 70%);
  border: 1.5px solid color-mix(in srgb, var(--or) 75%, transparent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--or) 14%, transparent), 0 18px 40px -12px rgba(0, 0, 0, .6), 0 0 30px color-mix(in srgb, var(--or) 40%, transparent);
  will-change: transform, opacity;
}
.vol svg { width: 62%; height: 62%; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)); }

/* petite bulle « Ajouté au panier », sous l'icône */
.panier-bulle {
  position: fixed; z-index: 70; display: flex; align-items: center; gap: .75rem;
  padding: .7rem .8rem .7rem .75rem; border-radius: 16px; max-width: min(320px, calc(100vw - 24px));
  background: color-mix(in srgb, var(--surface) 96%, transparent); border: 1px solid color-mix(in srgb, var(--or) 40%, transparent);
  box-shadow: 0 20px 44px -16px rgba(0, 0, 0, .65);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(-10px) scale(.94); transform-origin: 90% 0; pointer-events: none;
  transition: opacity .3s ease, transform .5s cubic-bezier(.22, 1.4, .36, 1);
}
.panier-bulle.est-visible { opacity: 1; transform: none; pointer-events: auto; }
.panier-bulle::before {                                           /* la pointe vers l'icône */
  content: ""; position: absolute; top: -6px; right: 20px; width: 11px; height: 11px; rotate: 45deg;
  background: inherit; border-left: 1px solid color-mix(in srgb, var(--or) 40%, transparent); border-top: 1px solid color-mix(in srgb, var(--or) 40%, transparent);
}
.panier-bulle__ok { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--or); color: var(--sur-or); font-weight: 800; }
.panier-bulle small { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--or-texte); }
.panier-bulle strong { display: block; font-family: var(--sans); font-weight: 800; font-size: .92rem; line-height: 1.2; }
.panier-bulle button {
  margin-left: .3rem; padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--ligne); background: none; color: var(--texte);
  font-weight: 700; font-size: .8rem; transition: border-color .2s, color .2s;
}
.panier-bulle button:hover { border-color: var(--or); color: var(--or-clair); }

/* ---------- le tiroir ---------- */

.panier { position: fixed; inset: 0; z-index: 96; }
.panier__fond {
  position: absolute; inset: 0; background: color-mix(in srgb, var(--fond-2) 60%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .4s ease;
}
.panier.est-ouvert .panier__fond { opacity: 1; }
.panier__tiroir {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid color-mix(in srgb, var(--or) 25%, transparent);
  box-shadow: -30px 0 80px -30px rgba(0, 0, 0, .7);
  transform: translateX(105%); transition: transform .5s cubic-bezier(.22, 1, .36, 1);
}
.panier.est-ouvert .panier__tiroir { transform: none; }
.panier__tete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.4rem 1.5rem 1rem; border-bottom: 1px solid var(--ligne); }
.panier__tete h2 { font-size: 1.45rem; }
.panier__nb { font-size: .82rem; color: var(--doux); }
.panier__x {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%;
  border: 1px solid var(--ligne); background: none; color: var(--texte);
  transition: border-color .2s, color .2s, transform .3s cubic-bezier(.3, 1.5, .5, 1);
}
.panier__x:hover { border-color: var(--or); color: var(--or-clair); transform: rotate(90deg); }
.panier__x svg { width: 20px; height: 20px; }

.panier__livraison { padding: .9rem 1.5rem 1rem; border-bottom: 1px solid var(--ligne); font-size: .85rem; color: var(--doux); }
.panier__livraison strong { color: var(--or-clair); }
.panier__jauge { display: block; height: 5px; margin-top: .55rem; border-radius: 5px; overflow: hidden; background: color-mix(in srgb, var(--texte) 10%, transparent); }
.panier__jauge span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--or), var(--or-clair)); transition: width .6s cubic-bezier(.22, 1, .36, 1); }

.panier__liste { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: .6rem 1.5rem; }
.panier__article {
  display: grid; grid-template-columns: 64px 1fr auto; gap: .9rem; align-items: center; padding: .9rem 0;
  border-bottom: 1px solid var(--ligne);
  animation: article-entree .5s cubic-bezier(.22, 1, .36, 1) calc(var(--i, 0) * 50ms) backwards;
}
.panier__article:last-child { border-bottom: 0; }
.panier__article.sort { animation: article-sortie .32s ease-in forwards; }
@keyframes article-entree { from { opacity: 0; transform: translateX(24px); } }
@keyframes article-sortie { to { opacity: 0; transform: translateX(40px); max-height: 0; padding-block: 0; } }
.panier__visuel { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: color-mix(in srgb, var(--or) 10%, var(--fond)); border: 1px solid var(--ligne); }
.panier__visuel svg { width: 72%; height: 72%; }
.panier__infos { min-width: 0; }
.panier__infos strong { display: block; font-family: var(--sans); font-weight: 800; font-size: .98rem; line-height: 1.25; }   /* pas Rammetto : son % est dessiné « °/o » */
.panier__infos > span { display: block; margin-top: .15rem; font-size: .76rem; color: var(--doux); }
.panier__qte { display: inline-flex; align-items: center; margin-top: .5rem; border: 1px solid var(--ligne); border-radius: 999px; }
.panier__qte button { width: 30px; height: 30px; border: 0; background: none; color: var(--texte); font-size: 1.05rem; border-radius: 50%; transition: background-color .2s, color .2s; }
.panier__qte button:hover { background: color-mix(in srgb, var(--or) 18%, transparent); color: var(--or-clair); }
.panier__qte button:disabled { opacity: .3; pointer-events: none; }
.panier__qte output { min-width: 2.4rem; text-align: center; font-family: var(--chiffres); font-weight: 700; font-size: .88rem; }
.panier__droite { display: grid; justify-items: end; gap: .4rem; }
.panier__prix { font-family: var(--chiffres); font-weight: 700; font-size: 1.02rem; }
.panier__retirer { border: 0; background: none; padding: 0; color: var(--doux); font-size: .74rem; text-decoration: underline; text-underline-offset: 3px; transition: color .2s; }
.panier__retirer:hover { color: #e9a08a; }

.panier__vide { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 2rem; text-align: center; color: var(--doux); }
.panier__vide svg { width: 54px; height: 54px; color: color-mix(in srgb, var(--or) 60%, transparent); }
.panier.est-vide .panier__vide { display: flex; }
.panier.est-vide .panier__liste, .panier.est-vide .panier__livraison { display: none; }
.panier.est-vide .panier__payer { opacity: .4; pointer-events: none; }

.panier__pied { padding: 1.1rem 1.5rem 1.4rem; border-top: 1px solid var(--ligne); background: color-mix(in srgb, var(--fond) 40%, var(--surface)); }
.panier__pied dl { display: grid; gap: .35rem; margin: 0 0 1rem; }
.panier__pied dl > div { display: flex; justify-content: space-between; font-size: .9rem; color: var(--doux); }
.panier__pied dd { margin: 0; font-family: var(--chiffres); font-weight: 600; color: var(--texte); }
.panier__total { margin-top: .35rem; padding-top: .6rem; border-top: 1px dashed var(--ligne); color: var(--texte) !important; font-weight: 700; }
.panier__total dd { font-size: 1.3rem; font-weight: 800; color: var(--or-clair); }
.panier__pied .btn { width: 100%; }
.panier__pied .btn + .btn { margin-top: .6rem; }
.panier__note { margin: .8rem 0 0; font-size: .78rem; text-align: center; color: var(--or-clair); }
.panier__note:empty { display: none; }

/* code promo, dans le pied du tiroir */
.panier__promo { display: flex; gap: .4rem; margin-bottom: .4rem; }
.panier__promo input {
  flex: 1; min-width: 0; padding: .65rem .9rem; border-radius: 999px; border: 1px solid var(--ligne);
  background: color-mix(in srgb, var(--texte) 5%, transparent); color: var(--texte); font: 700 .85rem var(--sans); letter-spacing: .08em; text-transform: uppercase;
}
.panier__promo input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--doux); }
.panier__promo input:focus { outline: none; border-color: var(--or); }
.panier__promo button {
  padding: .6rem 1rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--or) 60%, transparent);
  background: none; color: var(--or-clair); font-weight: 700; font-size: .82rem; transition: background-color .2s;
}
.panier__promo button:hover { background: color-mix(in srgb, var(--or) 14%, transparent); }
.panier__promo-info { margin: 0 0 .8rem; min-height: 1.1em; font-size: .78rem; color: var(--accent-texte); }
.panier__promo-info.est-erreur { color: #e9a08a; }
.panier__remise dd { color: var(--accent-texte) !important; }
.panier__promo-retirer { border: 0; background: none; color: var(--doux); font-size: 1rem; line-height: 1; padding: 0 .2rem; }
.panier__promo-retirer:hover { color: #e9a08a; }
