/* Carrinho lateral: vidro roxo, dourado, itens em cartões e rodapé com total em destaque. */
body #cart-drawer {
  --cd-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --cd-gold: #f2c14e;
  background: rgb(6 3 14 / 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body #cart-drawer[data-state="open"] { animation: cd-fade 0.45s var(--cd-ease) forwards; }
body #cart-drawer[data-state="closed"] { animation: cd-fade-out 0.38s var(--cd-ease) forwards; }
body #cart-drawer[data-state="open"] > div { animation: cd-slide-in 0.55s var(--cd-ease) forwards; }
body #cart-drawer[data-state="closed"] > div { animation: cd-slide-out 0.4s var(--cd-ease) forwards; }

@keyframes cd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cd-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes cd-slide-in { from { transform: translateX(56px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cd-slide-out { from { transform: none; opacity: 1; } to { transform: translateX(56px); opacity: 0; } }
@keyframes cd-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes cd-sheet-out { from { transform: none; } to { transform: translateY(100%); } }
@keyframes cd-item-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- Painel ---------- */
body #cart-drawer .ig-cart-panel {
  position: relative;
  padding: 22px !important;
  border: 0 !important;
  border-left: 1px solid rgb(242 193 78 / 0.3) !important;
  border-radius: 22px 0 0 22px !important;
  background:
    radial-gradient(90% 40% at 100% 0%, rgb(242 193 78 / 0.1), transparent 60%),
    radial-gradient(80% 40% at 0% 100%, rgb(137 90 246 / 0.2), transparent 60%),
    linear-gradient(180deg, #160e2c 0%, #0b0716 100%) !important;
  box-shadow: -30px 0 80px -30px rgb(0 0 0 / 0.8) !important;
}

/* ---------- Cabeçalho ---------- */
body #cart-drawer .cd-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 !important;
  padding-bottom: 16px !important;
  border-bottom: 1px solid rgb(255 255 255 / 0.08) !important;
}

body #cart-drawer .ig-cart-kicker {
  margin-bottom: 8px;
  color: var(--cd-gold);
  font: 700 11px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.14em;
}

body #cart-drawer .cd-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 800 1.6rem/1 'Plus Jakarta Sans', Manrope, sans-serif;
  letter-spacing: -0.04em;
  color: #fff;
}

body #cart-drawer .cd-count {
  padding: 5px 10px;
  border-radius: 999px;
  background: hsl(var(--primary) / 0.22);
  color: #e6dcff;
  font: 800 0.72rem/1 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}

body #cart-drawer .cd-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.04);
  color: rgb(255 255 255 / 0.8);
  transition: transform 0.35s var(--cd-ease), background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
body #cart-drawer .cd-close:hover { transform: rotate(90deg); border-color: rgb(242 193 78 / 0.5); background: rgb(242 193 78 / 0.1); color: #fff; }

/* ---------- Progresso do combo ---------- */
body #cart-drawer .cd-combo {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgb(242 193 78 / 0.3);
  border-radius: 14px;
  background: rgb(242 193 78 / 0.07);
}
body #cart-drawer .cd-combo[hidden] { display: none; }
body #cart-drawer .cd-combo__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.84rem; }
body #cart-drawer .cd-combo__row strong { color: #fff; font-weight: 800; }
body #cart-drawer .cd-combo__row span { color: #f6d680; font: 800 0.78rem/1 'JetBrains Mono', monospace; }
body #cart-drawer .cd-combo__bar { height: 6px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: rgb(255 255 255 / 0.1); }
body #cart-drawer .cd-combo__bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9a6bff, var(--cd-gold)); transition: width 0.7s var(--cd-ease); }
body #cart-drawer .cd-combo__text { margin: 9px 0 0; color: rgb(255 255 255 / 0.75); font-size: 0.78rem; font-weight: 600; line-height: 1.4; }
body #cart-drawer .cd-combo__text a { color: #cbb5ff; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
body #cart-drawer .cd-combo.is-done { border-color: rgb(110 231 183 / 0.45); background: rgb(110 231 183 / 0.08); }
body #cart-drawer .cd-combo.is-done .cd-combo__bar i { background: linear-gradient(90deg, #34d399, #6ee7b7); }

/* ---------- Lista ---------- */
body #cart-drawer #cart-drawer-wrapper { gap: 10px; padding: 14px 2px 6px !important; }

body #cart-drawer .cd-item {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin: 0 !important;
  padding: 12px !important;
  border: 1px solid rgb(255 255 255 / 0.09) !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.06), rgb(255 255 255 / 0.025)) !important;
  transition: border-color 0.25s ease, transform 0.35s var(--cd-ease);
}
body #cart-drawer .cd-item:hover { border-color: rgb(242 193 78 / 0.35) !important; }

body #cart-drawer.cd-intro .cd-item { animation: cd-item-in 0.55s var(--cd-ease) both; }
body #cart-drawer.cd-intro .cd-item:nth-child(2) { animation-delay: 0.06s; }
body #cart-drawer.cd-intro .cd-item:nth-child(3) { animation-delay: 0.12s; }
body #cart-drawer.cd-intro .cd-item:nth-child(4) { animation-delay: 0.18s; }
body #cart-drawer.cd-intro .cd-item:nth-child(n + 5) { animation-delay: 0.24s; }

body #cart-drawer .cd-item__img {
  flex: none;
  width: 64px;
  height: 88px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 10px !important;
  object-fit: cover;
  box-shadow: 0 10px 20px -10px rgb(0 0 0 / 0.7);
}

body #cart-drawer .cd-item__main { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; }
body #cart-drawer .cd-item__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }

body #cart-drawer .cd-item__name {
  display: -webkit-box;
  overflow: hidden;
  color: #fff;
  font-size: 0.92rem !important;
  font-weight: 800;
  line-height: 1.3 !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

body #cart-drawer .cd-item__remove {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgb(255 255 255 / 0.12) !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: rgb(255 255 255 / 0.55);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.25s var(--cd-ease);
}
body #cart-drawer .cd-item__remove:hover { border-color: rgb(255 90 95 / 0.55) !important; background: rgb(255 90 95 / 0.14) !important; color: #ff9a9d; transform: scale(1.06); }

body #cart-drawer .cd-item__price { margin: 0; color: rgb(255 255 255 / 0.6); font-size: 0.82rem; font-weight: 600; }

body #cart-drawer .cd-item__bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }

body #cart-drawer .cd-qty {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 12px;
  background: rgb(0 0 0 / 0.25);
}
body #cart-drawer .cd-qty__btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0 !important;
  border-radius: 9px !important;
  background: rgb(255 255 255 / 0.06) !important;
  color: #fff;
  transition: background-color 0.2s ease, transform 0.2s var(--cd-ease);
}
body #cart-drawer .cd-qty__btn:not(:disabled):hover { background: hsl(var(--primary) / 0.4) !important; }
body #cart-drawer .cd-qty__btn:not(:disabled):active { transform: scale(0.9); }
body #cart-drawer .cd-qty__btn:disabled { opacity: 0.35; }
body #cart-drawer .cd-qty__input {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

body #cart-drawer .cd-item__line { color: var(--cd-gold); font: 800 1.02rem/1 'Plus Jakarta Sans', Manrope, sans-serif; letter-spacing: -0.02em; }
body #cart-drawer .ig-cart-quantity-note { margin: 0; color: rgb(var(--fg3)); font-size: 0.7rem; }
body #cart-drawer .cart-promo-free { margin-left: 8px; }

/* ---------- Vazio ---------- */
body #cart-drawer .cd-empty { padding: 48px 12px; gap: 6px; animation: cd-item-in 0.6s var(--cd-ease) both; }
body #cart-drawer .cd-empty h5 { margin-top: 10px; color: #fff; font: 800 1.25rem/1.2 'Plus Jakarta Sans', Manrope, sans-serif; letter-spacing: -0.03em; }
body #cart-drawer .cd-empty p { max-width: 260px; color: rgb(255 255 255 / 0.65); }
body #cart-drawer .ig-cart-empty-icon { border-color: rgb(242 193 78 / 0.4); background: rgb(242 193 78 / 0.1); color: var(--cd-gold); }
body #cart-drawer .cd-empty__main,
body #cart-drawer .cd-empty__alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 800;
  transition: transform 0.25s var(--cd-ease), background-color 0.2s ease, filter 0.2s ease;
}
body #cart-drawer .cd-empty__main { margin-top: 12px; background: radial-gradient(110% 130% at 47% 0, #b79bff 38%, #9a6bff 69%, #6a3fe0); color: #160a38; }
body #cart-drawer .cd-empty__alt { border: 1px solid rgb(242 193 78 / 0.45); color: #f6d680; }
body #cart-drawer .cd-empty__main:hover { filter: brightness(1.08); transform: translateY(-2px); }
body #cart-drawer .cd-empty__alt:hover { background: rgb(242 193 78 / 0.12); transform: translateY(-2px); }

/* ---------- Rodapé ---------- */
body #cart-drawer .cd-foot { padding-top: 16px !important; border-top: 1px solid rgb(255 255 255 / 0.08); }

body #cart-drawer .cart-promo-line { margin-bottom: 10px; }

body #cart-drawer #cart-pricing {
  height: auto !important;
  margin-bottom: 14px !important;
  padding: 0 4px !important;
  border: 0 !important;
  background: transparent !important;
}
body #cart-drawer #cart-pricing p { color: rgb(255 255 255 / 0.75); font-size: 0.92rem; font-weight: 700; }
body #cart-drawer #cart-pricing span {
  color: var(--cd-gold);
  font: 800 1.85rem/1 'Plus Jakarta Sans', Manrope, sans-serif !important;
  letter-spacing: -0.04em;
  transition: transform 0.3s var(--cd-ease);
}

body #cart-drawer .cd-foot .btn-primary {
  position: relative;
  overflow: hidden;
  min-height: 54px !important;
  border: 1px solid #2a1569 !important;
  border-radius: 14px !important;
  background: radial-gradient(110% 130% at 47% 0, #b79bff 38%, #9a6bff 69%, #6a3fe0) !important;
  color: #160a38 !important;
  font-weight: 800;
  box-shadow: 0 18px 34px -16px rgb(0 0 0 / 0.65);
  transition: filter 0.2s ease, transform 0.25s var(--cd-ease);
}
body #cart-drawer .cd-foot .btn-primary:hover { filter: brightness(1.08); transform: translateY(-2px); }
body #cart-drawer .cd-foot .btn-primary::after {
  content: '';
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: 0;
  width: 28%;
  background: linear-gradient(100deg, transparent, rgb(236 228 255 / 0.55), transparent);
  transform: translateX(-160%) skewX(-18deg);
  animation: cd-shine 4.2s cubic-bezier(0.45, 0, 0.2, 1) 1.4s infinite;
  pointer-events: none;
}
@keyframes cd-shine { 0% { transform: translateX(-160%) skewX(-18deg); } 30%, 100% { transform: translateX(460%) skewX(-18deg); } }

body #cart-drawer .cd-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 0;
  color: rgb(255 255 255 / 0.55);
  font-size: 0.74rem;
  font-weight: 600;
}
body #cart-drawer[data-empty="true"] .cd-secure { display: none; }

body #cart-drawer .gm-cart-continue {
  border-color: rgb(255 255 255 / 0.14) !important;
  border-radius: 14px !important;
  color: rgb(255 255 255 / 0.85);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
body #cart-drawer .gm-cart-continue:hover { background: rgb(255 255 255 / 0.06) !important; border-color: rgb(242 193 78 / 0.4) !important; color: #fff; }

/* ---------- Celular: folha de baixo ---------- */
@media (max-width: 767px) {
  body #cart-drawer { align-items: flex-end; }
  body #cart-drawer[data-state="open"] > div { animation: cd-sheet-in 0.55s var(--cd-ease) forwards; }
  body #cart-drawer[data-state="closed"] > div { animation: cd-sheet-out 0.4s var(--cd-ease) forwards; }
  body #cart-drawer .ig-cart-panel {
    width: 100%;
    height: min(92dvh, 760px);
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom)) !important;
    border-left: 0 !important;
    border-top: 1px solid rgb(242 193 78 / 0.3) !important;
    border-radius: 22px 22px 0 0 !important;
  }
  body #cart-drawer .ig-cart-panel::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.22);
    transform: translateX(-50%);
  }
  body #cart-drawer .cd-head { padding-top: 6px; }
  body #cart-drawer .cd-title { font-size: 1.4rem; }
  body #cart-drawer .cd-item__img { width: 56px; height: 78px; }
}

@media (prefers-reduced-motion: reduce) {
  body #cart-drawer,
  body #cart-drawer > div,
  body #cart-drawer .cd-item,
  body #cart-drawer .cd-empty,
  body #cart-drawer .cd-foot .btn-primary::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

body #cart-drawer[data-empty="true"] #cart-drawer-wrapper { overflow: hidden; }
body #cart-drawer #cart-drawer-wrapper { scrollbar-width: thin; scrollbar-color: rgb(154 107 255 / 0.6) transparent; }