/* =========================================================
   Tutu 3D Studio, carrinho (sacola) t3v-cart 1.0.0
   Tudo com prefixo .t3c-: não mexe no resto do site.
   Usa os tokens v2.6 quando existem e tem valores de reserva
   para funcionar mesmo numa página sem tokens.css.
   Celular: painel que sobe de baixo. Computador: gaveta lateral.
   ========================================================= */
.t3c {
  --t3c-bg: var(--bg-surface, #0E0E12);
  --t3c-raised: var(--bg-raised, #17171D);
  --t3c-line: var(--border, #24242C);
  --t3c-text: var(--text, #ECECF2);
  --t3c-strong: var(--text-strong, #FFFFFF);
  --t3c-muted: var(--text-muted, #B4B4C0);
  --t3c-lime: var(--color-lime, #D4FB45);
  --t3c-cyan: var(--color-cyan, #29F7EF);
  --t3c-ok: var(--color-success, #4BF2A4);
  --t3c-warn: var(--color-warning, #FFC640);
  --t3c-display: var(--font-display, "Sora", system-ui, sans-serif);
  --t3c-body: var(--font-body, "Space Grotesk", system-ui, sans-serif);
  --t3c-mono: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  --t3c-snap: var(--ease-snap, cubic-bezier(.3, 1.3, .6, 1));
  --t3c-step: var(--ease-stepper, cubic-bezier(.22, 1, .36, 1));
  --t3c-out: cubic-bezier(.2, .8, .2, 1);
  --t3c-btn-radius: var(--radius-button, 12px 12px 12px 0);
  --t3c-card-radius: var(--radius-card, 0 24px 24px 24px);
  --t3c-gutter: 16px;
}
.t3c *, .t3c *::before, .t3c *::after { box-sizing: border-box; }
.t3c svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; flex: none; }
.t3c :focus-visible { outline: 3px solid var(--t3c-cyan); outline-offset: 2px; }
html.t3c-locked { overflow: hidden; }

/* ---------- Painel ---------- */
.t3c-panel {
  position: fixed; inset: auto 0 0 0;
  width: 100%; max-width: none; max-height: 92svh; margin: 0; padding: 0;
  display: flex; flex-direction: column; overflow: hidden;
  border: 0; border-radius: 24px 24px 0 0;
  background: var(--t3c-bg); color: var(--t3c-text);
  font: 400 16px/1.5 var(--t3c-body);
}
.t3c-panel:not([open]) { display: none; }
.t3c-panel::backdrop { background: rgba(0, 0, 0, .72); }
.t3c-panel[open] { animation: t3c-up .44s var(--t3c-step); }
.t3c-panel[open]::backdrop { animation: t3c-fade-in .3s var(--t3c-out); }
.t3c-panel.is-closing { animation: t3c-down .26s var(--t3c-out) forwards; }
.t3c-panel.is-closing::backdrop { animation: t3c-fade-out .26s var(--t3c-out) forwards; }
@keyframes t3c-up { from { transform: translateY(100%); } }
@keyframes t3c-down { to { transform: translateY(100%); } }
@keyframes t3c-fade-in { from { opacity: 0; } }
@keyframes t3c-fade-out { to { opacity: 0; } }

.t3c-grab { display: grid; place-items: center; height: 22px; flex: none; touch-action: none; cursor: grab; }
.t3c-grab::before { content: ""; width: 44px; height: 5px; border-radius: 3px; background: var(--t3c-line); }
.t3c-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none;
  padding: 4px 20px 14px; border-bottom: 1px solid var(--t3c-line); touch-action: none;
}
.t3c-head h2 { margin: 0; font: 800 22px/1.1 var(--t3c-display); color: var(--t3c-strong); letter-spacing: -.02em; }
.t3c-body { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 8px 20px 20px; }
.t3c-foot {
  flex: none; display: grid; gap: 10px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--t3c-line); background: var(--t3c-bg);
}
.t3c-foot[hidden] { display: none; }

@media (min-width: 900px) {
  .t3c-panel { inset: 0 0 0 auto; width: 440px; height: 100%; max-height: none; border-radius: 24px 0 0 24px; }
  .t3c-panel[open] { animation: t3c-in .44s var(--t3c-step); }
  .t3c-panel.is-closing { animation: t3c-out .26s var(--t3c-out) forwards; }
  .t3c-grab { display: none; }
  .t3c-head { padding-top: 16px; }
}
@keyframes t3c-in { from { transform: translateX(100%); } }
@keyframes t3c-out { to { transform: translateX(100%); } }

/* ---------- Botões ---------- */
.t3c-iconbtn {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 1px solid var(--t3c-line); border-radius: var(--t3c-btn-radius);
  background: var(--t3c-raised); color: var(--t3c-strong); cursor: pointer;
  transition: transform .2s var(--t3c-snap), border-color .2s;
}
.t3c-iconbtn:hover { border-color: var(--t3c-cyan); }
.t3c-iconbtn:active { transform: scale(.92); }
.t3c-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 22px;
  border: 2px solid var(--t3c-lime); border-radius: var(--t3c-btn-radius);
  background: var(--t3c-lime); color: #000;
  font: 700 17px/1 var(--t3c-display); text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s var(--t3c-snap);
}
.t3c-btn:hover { transform: translateY(-2px); }
.t3c-btn:active { transform: translateY(1px) scale(.98); }
.t3c-btn--wa { width: 100%; }
.t3c-btn--ghost { background: transparent; color: var(--t3c-strong); border-color: var(--t3c-line); min-height: 48px; font-size: 15px; }

/* ---------- Itens ---------- */
.t3c-list { margin: 0; padding: 0; list-style: none; }
.t3c-item {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--t3c-line);
  transition: opacity .24s, transform .3s var(--t3c-out);
}
.t3c-item.is-new { animation: t3c-drop .55s var(--t3c-snap); }
.t3c-item.is-leaving { opacity: 0; transform: translateX(40px); }
@keyframes t3c-drop { from { opacity: 0; transform: translateY(-24px); } }
.t3c-thumb {
  width: 56px; height: 56px; display: grid; place-items: center; overflow: hidden;
  border-radius: 0 12px 12px 12px; background: var(--c); color: #000;
}
.t3c-thumb img { width: 100%; height: 100%; object-fit: cover; }
.t3c .t3c-thumb svg { width: 50%; height: auto; aspect-ratio: 85 / 122; fill: currentColor; stroke: none; }
.t3c-name { font: 700 15px/1.25 var(--t3c-display); color: var(--t3c-strong); overflow-wrap: anywhere; }
.t3c-meta { font-size: 13px; color: var(--t3c-muted); }
.t3c-right { display: grid; justify-items: end; gap: 6px; }
.t3c-right strong { font: 700 15px/1 var(--t3c-display); color: var(--t3c-strong); font-variant-numeric: tabular-nums; }
.t3c-qty { display: inline-flex; align-items: center; border: 1px solid var(--t3c-line); border-radius: var(--t3c-btn-radius); }
.t3c-qty button {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; background: transparent; color: var(--t3c-strong); cursor: pointer;
}
.t3c-qty button:disabled { opacity: .35; cursor: default; }
.t3c-qty svg { width: 18px; height: 18px; }
.t3c-qty output { min-width: 24px; text-align: center; font: 700 14px/1 var(--t3c-mono); }

/* ---------- Formulário de retirada ---------- */
.t3c-form { display: grid; gap: 14px; margin-top: 20px; }
.t3c-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.t3c-fieldset legend { margin-bottom: 10px; padding: 0; font: 700 16px/1.2 var(--t3c-display); color: var(--t3c-strong); }
.t3c-opts { display: grid; gap: 8px; }
.t3c-opt {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  min-height: 56px; padding: 12px 14px;
  border: 2px solid var(--t3c-line); border-radius: var(--t3c-btn-radius);
  cursor: pointer; transition: border-color .2s;
}
.t3c-opt.is-on { border-color: var(--t3c-lime); }
.t3c-opt input { width: 22px; height: 22px; margin: 0; accent-color: var(--t3c-lime); }
.t3c-opt small { display: block; font-size: 12px; color: var(--t3c-muted); }
.t3c-opt b { font: 600 13px/1 var(--t3c-mono); }
.t3c-field { display: grid; gap: 6px; }
.t3c-field label { font-size: 14px; font-weight: 600; color: var(--t3c-strong); }
.t3c-field input, .t3c-field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--t3c-line); border-radius: var(--t3c-btn-radius);
  background: var(--t3c-raised); color: var(--t3c-strong);
  font: 400 16px/1.4 var(--t3c-body); /* 16 px evita o zoom automático do iPhone */
}
.t3c-field textarea { min-height: 84px; resize: vertical; }
.t3c-field small { font-size: 12px; color: var(--t3c-muted); }
.t3c-note { margin: 0; font-size: 13px; color: var(--t3c-muted); }
.t3c-note--warn {
  margin-top: 12px; padding: 10px 12px;
  border: 2px solid var(--t3c-warn); border-radius: var(--t3c-btn-radius); color: var(--t3c-text);
}

/* ---------- Rodapé do painel ---------- */
.t3c-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.t3c-total strong { font: 800 24px/1 var(--t3c-display); color: var(--t3c-strong); font-variant-numeric: tabular-nums; }
.t3c-compose { display: grid; gap: 4px; font: 500 12px/1.4 var(--t3c-mono); color: var(--t3c-muted); }
.t3c-compose[hidden] { display: none; }
.t3c-compose span { opacity: 0; transform: translateY(6px); animation: t3c-rise .3s var(--t3c-out) forwards; animation-delay: calc(var(--i) * 70ms); }
.t3c-compose span:last-child { color: var(--t3c-lime); }
@keyframes t3c-rise { to { opacity: 1; transform: none; } }
.t3c-after { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 13px; color: var(--t3c-muted); }
.t3c-after[hidden] { display: none; }
.t3c-after button {
  min-height: 44px; padding: 0 10px; border: 0; background: none;
  color: var(--t3c-cyan); font: 600 13px/1 var(--t3c-body); text-decoration: underline; cursor: pointer;
}

/* ---------- Sacola vazia ---------- */
.t3c-empty { display: grid; justify-items: center; gap: 10px; padding: 48px 12px; text-align: center; }
.t3c-empty svg { width: 56px; height: 56px; color: var(--t3c-lime); }
.t3c-empty h3 { margin: 0; font: 700 20px/1.2 var(--t3c-display); color: var(--t3c-strong); }
.t3c-empty p { margin: 0 0 6px; color: var(--t3c-muted); }

/* ---------- Botão flutuante (celular) ---------- */
.t3c-fab {
  position: fixed; z-index: 45;
  left: max(var(--t3c-gutter), env(safe-area-inset-left, 0px));
  right: max(var(--t3c-gutter), env(safe-area-inset-right, 0px));
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 0 18px;
  border: 0; border-radius: var(--t3c-btn-radius);
  background: var(--t3c-lime); color: #000;
  font: 700 16px/1 var(--t3c-display); cursor: pointer;
  transform: translateY(160%); visibility: hidden;
  transition: transform .5s var(--t3c-snap), visibility 0s linear .5s;
}
.t3c-fab.is-on { transform: none; visibility: visible; transition: transform .5s var(--t3c-snap), visibility 0s; }
.t3c-fab__n { margin-left: 6px; padding: 5px 8px; border-radius: 4px; background: #000; color: var(--t3c-lime); font: 700 13px/1 var(--t3c-mono); }
@media (min-width: 900px) { .t3c-fab { display: none; } }

/* ---------- Peça voando, contador e aviso ---------- */
.t3c-fly {
  position: fixed; left: 0; top: 0; z-index: 120; pointer-events: none;
  width: 22px; height: 22px; background: var(--c); border: 2px solid #000; border-radius: 0 0 8px 0;
}
.t3c-bump { animation: t3c-bump .45s var(--ease-snap, cubic-bezier(.3, 1.3, .6, 1)); }
@keyframes t3c-bump { 40% { transform: scale(1.5); } }
.t3c-toast {
  position: fixed; left: 50%; z-index: 130;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100% - 32px); padding: 12px 16px;
  border-radius: var(--t3c-btn-radius); background: #fff; color: #000;
  font: 600 14px/1.3 var(--t3c-body);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity .2s, transform .35s var(--t3c-snap);
}
.t3c-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .t3c-toast { bottom: 28px; } }
.t3c-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .t3c *, .t3c *::before, .t3c *::after, .t3c-bump { animation: none !important; transition: none !important; }
}

/* 1.1.0: total no Pix */
.t3c-total--pix { margin-top: 6px; color: #D4FB45; }
.t3c-total--pix strong { color: #D4FB45; font-size: 20px; }
.t3c-save { margin: 2px 0 0; font: 500 12px/1.3 var(--t3c-mono, monospace); color: #D4FB45; text-align: right; }

/* 1.2.0: promoções com brinde */
.t3c-promos { display: grid; gap: 8px; margin: 4px 0 16px; padding: 12px; border: 1px solid var(--t3c-lime); border-radius: 0 14px 14px 14px; background: rgba(212, 251, 69, .06); }
.t3c-gifts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.t3c-gift { display: flex; align-items: center; gap: 10px; }
.t3c-gift img, .t3c-gift__ico { width: 40px; height: 40px; flex: none; border-radius: 0 10px 10px 10px; object-fit: cover; }
.t3c-gift__ico { display: grid; place-items: center; background: var(--t3c-lime); color: #000; }
.t3c-gift__ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.t3c-gift > span:not(.t3c-gift__ico) { display: grid; gap: 2px; flex: 1; min-width: 0; font-size: 14px; color: var(--t3c-strong); }
.t3c-gift small { color: var(--t3c-muted); font-size: 12px; }
.t3c-gift strong { color: var(--t3c-lime); font-size: 13px; }
.t3c-promo__next { margin: 0; font-size: 13px; line-height: 1.45; color: var(--t3c-text); }
.t3c-promo__bar { height: 6px; border-radius: 3px; background: var(--t3c-line); overflow: hidden; }
.t3c-promo__bar i { display: block; height: 100%; background: var(--t3c-lime); border-radius: inherit; transition: width .4s; }

/* 1.3.0: promoções conferidas no servidor (desconto, brinde, itens cobertos e progresso) */
.t3c-promo { display: grid; gap: 6px; }
.t3c-promo + .t3c-promo { padding-top: 8px; border-top: 1px dashed rgba(212, 251, 69, .3); }
.t3c-promo__head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--t3c-strong); }
.t3c-promo__head svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--t3c-lime); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.t3c-promo__head b { flex: 1; min-width: 0; }
.t3c-promo__head strong { color: var(--t3c-lime); font-variant-numeric: tabular-nums; }
.t3c-promo__items { color: var(--t3c-muted); font-size: 12px; line-height: 1.4; }
.t3c-promo__wait { margin: 0 0 12px; color: var(--t3c-muted); }
.t3c-gift strong { display: grid; justify-items: end; gap: 1px; }
.t3c-gift strong small { color: var(--t3c-muted); font: 500 11px/1 var(--t3c-mono); }
.t3c-line { display: flex; justify-content: space-between; font-size: 14px; color: var(--t3c-muted); font-variant-numeric: tabular-nums; }
.t3c-line--off { color: var(--t3c-lime); margin-bottom: 4px; }
.t3c-promos .t3c-save { text-align: left; }
