/* nhamei — design system
   Paleta inspirada no ref do Fred (Tehniko/Behance):
   rosa #FF3399 · laranja #FF8225 · amarelo #FFCC33 · tinta #18182D
   Estilo: contornos finos escuros, pílulas, sombra dura, DM Sans. */

* { box-sizing: border-box; }

[hidden] { display: none !important; }

:root {
  --ink: #18182D;
  --pink: #FF3399;
  --pink-dark: #E0247F;
  --pink-soft: #FFE3F1;
  --orange: #FF8225;
  --orange-soft: #FFE9D6;
  --yellow: #FFCC33;
  --yellow-soft: #FFF3CC;
  --lav: #DCB5E4;
  --bg: #FFF9F3;
  --muted: #8B8798;
  --line: 2px solid var(--ink);
  --r: 20px;
  --shadow: 0 3px 0 var(--ink);
}

body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 980px; margin: 0 auto; padding: 20px 16px; }

h1 { font-size: 26px; font-weight: 900; letter-spacing: -0.03em; margin: 0 0 6px; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; }
p { line-height: 1.5; margin: 6px 0; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--pink-dark); font-weight: 700; }

.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.icon.big { width: 30px; height: 30px; }

/* ---------- marca ---------- */
.wordmark {
  font-weight: 900;
  letter-spacing: -0.05em;
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .dot { color: var(--pink); }
.wordmark .tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-left: 8px;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: var(--line);
  position: sticky; top: 0; z-index: 40;
}
.order-chip {
  background: var(--yellow); border: var(--line); color: var(--ink);
  padding: 6px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- cards ---------- */
.card {
  background: #fff; border: var(--line); border-radius: var(--r);
  padding: 22px; margin: 16px 0;
}
.card.pink { background: var(--pink-soft); }
.card.yellow { background: var(--yellow-soft); }
.card.center { text-align: center; }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--yellow-soft); border: var(--line); border-radius: 16px;
  padding: 14px 16px; margin: 14px 0; font-size: 14px; line-height: 1.45;
}
.notice .icon { margin-top: 2px; color: var(--orange); }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: var(--line); border-radius: 999px;
  background: #fff; color: var(--ink);
  padding: 11px 20px;
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; text-decoration: none; text-align: center;
  box-shadow: var(--shadow);
  transition: transform .1s, box-shadow .1s;
  white-space: nowrap;
}

/* evita o zoom do toque duplo em botões no celular */
button, .btn, input, .polaroid, .dropzone { touch-action: manipulation; }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn.primary { background: var(--pink); color: #fff; }
.btn.primary:hover { background: var(--pink-dark); }
.btn.orange { background: var(--orange); color: #fff; }
.btn.yellow { background: var(--yellow); }
.btn.ghost { box-shadow: none; border-color: transparent; background: transparent; }
.btn.ghost:active { transform: none; }
.btn.small { padding: 7px 14px; font-size: 13px; box-shadow: 0 2px 0 var(--ink); }
.btn.small:active { transform: translateY(2px); }
.btn.big { padding: 14px 26px; font-size: 16px; }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn.iconbtn {
  width: 42px; height: 42px;
  min-width: 42px; min-height: 42px; max-width: 42px; max-height: 42px;
  padding: 0 !important; flex: 0 0 42px;
  border-radius: 50%;
}
.btn.wa { border-color: #1FAF38; color: #128C7E; }
.btn.wa:hover { background: #E9F9EE; }

/* ---------- formulários ---------- */
.field { display: block; margin: 16px 0; }
.field span {
  display: block; font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.field input {
  width: 100%; padding: 13px 16px; font-size: 16px; font-family: inherit;
  border: var(--line); border-radius: 14px; background: #fff; color: var(--ink);
}
.field input:focus { outline: 3px solid var(--pink-soft); border-color: var(--pink); }

/* nome fixo (vem do pedido Shopee, não editável) */
.static-input {
  width: 100%; padding: 13px 16px; font-size: 16px; font-weight: 700;
  border: var(--line); border-radius: 14px; background: var(--yellow-soft);
}

.field.invalid input { border-color: var(--pink); outline: 3px solid var(--pink-soft); }
.field-hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.field-error { color: var(--pink-dark); font-weight: 700; font-size: 13px; margin: 6px 0 0; }

/* ---------- login / páginas centradas ---------- */
.center-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.login-card { width: 100%; max-width: 380px; text-align: center; padding: 32px 26px; }
.login-card .wordmark { font-size: 40px; }
.login-card .btn { width: 100%; margin-top: 4px; }
.login-card .field { text-align: left; }

/* ---------- admin ---------- */
.new-order { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.new-order .field { flex: 1 1 220px; margin: 0; }

/* construtor de itens do pedido */
.item-row {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 8px; margin-bottom: 8px;
  border: 1.5px solid #EFE7DC; border-radius: 12px; background: #fff;
}
.item-row select, .item-row .ir-qty {
  padding: 9px 12px; border: var(--line); border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 600; background: #fff;
}
.item-row .ir-qty { width: 78px; }
.ir-combo { display: flex; align-items: center; gap: 6px; }
.ir-combo .ir-clabel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ir-combo .ir-combos { width: 62px; padding: 9px 10px; border: var(--line); border-radius: 10px; font-family: inherit; font-size: 14px; font-weight: 700; }
.ir-combo .ir-total { font-size: 13px; font-weight: 700; color: var(--pink-dark); white-space: nowrap; }
.ir-opt { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; cursor: pointer; }
.ir-opt input { width: 16px; height: 16px; accent-color: var(--pink); }
.ir-opt.sp { color: #2E6B36; }
.ir-opt.tx { color: var(--pink-dark); }
.item-row .ir-remove { margin-left: auto; }
#newOrderForm > .btn.big { margin-top: 4px; }

/* célula de itens na tabela */
.items-cell { min-width: 118px; }
.item-line { display: flex; align-items: center; gap: 6px; margin: 1px 0; font-size: 12.5px; line-height: 1.35; }
.item-name { font-weight: 700; min-width: 46px; }
.item-qty { color: var(--muted); font-variant-numeric: tabular-nums; }
/* pontinhos compactos de Spotify/Frase */
.item-line .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.item-line .dot.sp { background: #2E6B36; }
.item-line .dot.tx { background: var(--pink); }
.item-line .partial { margin-left: auto; font-size: 11px; font-weight: 800; color: #B54A00; background: var(--orange-soft); padding: 0 6px; border-radius: 999px; }
/* mini-tags (usadas no upload) */
.mini-tag { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.mini-tag.sp { background: #E3F3E4; color: #2E6B36; }
.mini-tag.tx { background: var(--pink-soft); color: var(--pink-dark); }

.link-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.link-row code {
  background: #fff; border: var(--line); padding: 10px 16px; border-radius: 999px;
  font-family: inherit; font-weight: 700; font-size: 14px; word-break: break-all;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1.5px solid #EFE7DC; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
th {
  color: var(--muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline { display: inline; }

.badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; border: 1.5px solid var(--ink);
}
.badge.ok { background: var(--pink-soft); color: var(--pink-dark); }
.badge.wait { background: var(--yellow-soft); }
.badge.warn { background: var(--orange-soft); color: #B54A00; }
.badge.done { background: #F1E4F5; color: #7A4E8A; }
.badge.gift {
  background: var(--pink-soft); color: var(--pink-dark);
  display: inline-flex; align-items: center; gap: 4px; margin-top: 4px;
}
.badge.gift {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
}
.badge.gift .icon { width: 13px; height: 13px; }
.badge.gift-pending { display: inline-block; background: #F4EEF6; color: #8B7E93; margin-top: 6px; font-weight: 600; }

/* checkbox de cupom no formulário de novo pedido */
.coupon-toggle {
  flex: 1 1 100%;
  display: flex; align-items: center; gap: 10px;
  margin-top: 4px; padding: 12px 14px;
  border: 2px dashed var(--pink); border-radius: 14px; background: var(--pink-soft);
  font-size: 14px; cursor: pointer;
}
.coupon-toggle input { width: 20px; height: 20px; accent-color: var(--pink); cursor: pointer; flex: 0 0 auto; }
.coupon-toggle .icon { color: var(--pink-dark); flex: 0 0 auto; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }

/* filtros de pedidos */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter {
  border: var(--line); border-radius: 999px; background: #fff; color: var(--ink);
  padding: 7px 14px; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.filter:hover { background: var(--yellow-soft); }
.filter.active { background: var(--ink); color: #fff; }

/* controle de status na tabela */
.status-form { margin: 0; }
.status-select {
  border: var(--line); border-radius: 999px;
  padding: 6px 30px 6px 14px; font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2318182D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
/* status colorido: recebidas=verde, produzindo=laranja, pronto=azul */
.status-select.prod-recebido { background-color: #E3F3E4; color: #2E6B36; border-color: #2E6B36; }
.status-select.prod-produzindo { background-color: var(--orange-soft); color: #B54A00; border-color: #B54A00; }
.status-select.prod-pronto { background-color: #E0EEFF; color: #1B4F8A; border-color: #1B4F8A; }
/* aguardando = amarelo */
.status-pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; border: var(--line);
}
.status-pill.aguardando { background: var(--yellow); color: #6B5500; }

.badge.tag-gift {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 6px;
  background: var(--yellow-soft); color: #7A6A2E;
}
.badge.tag-gift .icon { width: 12px; height: 12px; }

.sel-col { width: 34px; }
.sel-col input { width: 20px; height: 20px; accent-color: var(--pink); cursor: pointer; }

/* ---------- tabela de pedidos enxuta ---------- */
.orders-table th, .orders-table td { vertical-align: middle; }
.section-actions { display: flex; gap: 8px; }
.ped-cell strong { font-size: 14px; }
.ped-cliente { font-size: 12px; color: var(--muted); margin-top: 2px; }
.acoes-col { text-align: right; }

/* botões-ícone das ações */
.actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: nowrap; }
.iconbtn.act {
  width: 34px; height: 34px; min-width: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: var(--line); border-radius: 50%; background: #fff; color: var(--ink);
  cursor: pointer;
}
.iconbtn.act:hover { background: var(--yellow-soft); }
.iconbtn.act .icon { width: 17px; height: 17px; }
.iconbtn.act.pdf { background: var(--pink); border-color: var(--pink); color: #fff; }
.iconbtn.act.pdf:hover { background: var(--pink-dark); }
.iconbtn.act.wa { border-color: #1FAF38; color: #128C7E; }
.iconbtn.act.wa:hover { background: #E9F9EE; }
.iconbtn.act.danger { border-color: #e3b7b3; color: var(--pink-dark); }
.iconbtn.act.danger:hover { background: #fbeeed; }
.iconbtn.act.details-toggle .chev { transition: transform .15s; }
.iconbtn.act.details-toggle.open { background: var(--ink); color: #fff; }
.iconbtn.act.details-toggle.open .chev { transform: rotate(180deg); }

/* painel de detalhes */
.details-row > td { background: #FBF6EF; padding: 14px 16px; }
.details-grid { display: flex; flex-wrap: wrap; gap: 24px; }
.det-block { min-width: 150px; }
.det-label { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.det-pdf { font-size: 12px; color: #7A4E8A; font-weight: 700; margin-top: 4px; }

/* ---------- página do cliente ---------- */
.intro { margin: 10px 0 4px; }
.intro p { color: #55506B; font-size: 15px; }

/* contador regressivo de 12h */
.timer {
  display: flex; align-items: center; gap: 14px;
  border: var(--line); border-radius: 16px;
  background: var(--yellow-soft); box-shadow: var(--shadow);
  padding: 12px 16px; margin: 16px 0;
}
.timer-icon {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px;
  background: var(--yellow); border: var(--line);
  display: flex; align-items: center; justify-content: center;
}
.timer-icon .icon { width: 24px; height: 24px; }
.timer-label { font-size: 12px; font-weight: 700; color: #7A6A2E; text-transform: uppercase; letter-spacing: 0.04em; }
.timer-clock {
  font-size: 30px; font-weight: 900; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.timer.urgent { background: var(--orange-soft); }
.timer.urgent .timer-icon { background: var(--orange); color: #fff; }
.timer.urgent .timer-clock { color: #B54A00; }
.timer.expired { background: #FDECEC; }
.timer.expired .timer-icon { background: var(--pink); color: #fff; }
.timer.expired .timer-clock { font-size: 22px; color: var(--pink-dark); }

.dropzone {
  width: 100%; display: flex; align-items: center; gap: 16px;
  padding: 22px 20px; margin: 16px 0;
  background: #fff; border: 2px dashed var(--ink); border-radius: var(--r);
  font-family: inherit; font-size: 15px; color: var(--ink);
  cursor: pointer; text-align: left;
}
.dropzone:hover { background: var(--pink-soft); }
.dropzone strong { font-size: 16px; }
.dropzone small { color: var(--muted); }
.dz-badge {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 18px;
  background: var(--yellow); border: var(--line);
  display: flex; align-items: center; justify-content: center;
}
.dz-badge.shape { background: var(--pink-soft); overflow: hidden; }
.dz-badge.shape svg { display: block; max-width: 100%; max-height: 46px; }

#formArea { padding-bottom: 90px; }
.photo-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
}
.photo-card {
  background: #fff; border: var(--line); border-radius: var(--r);
  padding: 12px; text-align: center;
}
.photo-num {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}

.polaroid {
  background: #fff; border: var(--line); border-radius: 10px;
  padding: 8% 8% 0; cursor: pointer;
  box-shadow: var(--shadow);
}
.polaroid canvas { width: 100%; display: block; background: var(--pink-soft); border-radius: 4px; }
.polaroid-band { height: 30px; }

.card-buttons { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 12px 0 10px; }
.card-buttons .adjust { flex: 1 1 auto; }
.card-buttons .band { flex-basis: 100%; order: 2; }
.card-buttons .remove { flex: 0 0 auto; }

/* botão "Adicionar mais" em destaque, centralizado abaixo da grade */
.add-more-wrap { display: flex; justify-content: center; margin-top: 14px; }
.btn.add-more { padding: 11px 22px; font-size: 15px; }

.stepper {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--yellow-soft); border: var(--line); border-radius: 999px;
  padding: 4px;
}
.stepper button {
  width: 34px; height: 34px; border-radius: 50%; border: var(--line);
  background: #fff; color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.stepper button:active { background: var(--pink-soft); }
.stepper .copies { font-weight: 900; min-width: 34px; font-size: 15px; }
.stepper .del { border-color: var(--pink-dark); color: var(--pink-dark); }
.stepper .del:active { background: var(--pink-soft); }
.stepper .qty-input {
  width: 42px; text-align: center; font-weight: 900; font-size: 15px;
  border: var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  padding: 5px 2px; font-family: inherit;
}
.stepper .qty-input:focus { outline: 2px solid var(--pink); border-color: var(--pink); }

/* ---------- seções de produto (upload) ---------- */
.prod-section { margin: 22px 0; padding-top: 18px; border-top: 2px dashed #EFE7DC; }
.prod-section:first-of-type { border-top: none; }
.prod-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.prod-head h2 { margin: 0; }
.prod-sub { font-size: 13px; color: var(--muted); font-weight: 600; }
.prod-counter { font-size: 16px; font-weight: 900; color: var(--pink-dark); white-space: nowrap; }

/* moldura polaroid (preview do modelo) */
.pf-holder { cursor: pointer; display: flex; justify-content: center; }
.polaroid-frame {
  position: relative; background: #fff; border: var(--line); border-radius: 8px;
  box-shadow: var(--shadow); overflow: hidden;
}
.pf-photo { position: absolute; display: block; background: var(--pink-soft); object-fit: cover; }
.pf-band { position: absolute; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pf-code { max-width: 97%; max-height: 94%; object-fit: contain; }
.pf-code.fill { max-width: none; max-height: none; width: 100%; height: 100%; object-fit: fill; }
.pf-text { font-family: 'Shantell Sans', cursive; font-weight: 700; color: #18182D; font-size: 11px; line-height: 1; text-align: center; padding: 0 4px; white-space: nowrap; overflow: hidden; }

/* modal band (spotify/frase) */
.band-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.band-tabs .bt { flex: 1; border: var(--line); border-radius: 999px; background: #fff; padding: 8px; font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.band-tabs .bt.active { background: var(--ink); color: #fff; }
.sp-preview { min-height: 60px; display: flex; align-items: center; justify-content: center; margin-top: 8px; background: #fff; border: 1.5px dashed #d8c8b0; border-radius: 12px; padding: 8px; }
.sp-preview img { max-width: 100%; max-height: 90px; }
.swatches { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; }
.swatch { width: 100%; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--ink); cursor: pointer; padding: 0; }
.swatch.on { outline: 3px solid var(--pink); outline-offset: 2px; }
.char-count { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 4px; }
.text-preview {
  margin-top: 10px; min-height: 34px; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1.5px dashed #d8c8b0; border-radius: 12px; padding: 6px 10px;
  font-family: 'Shantell Sans', cursive; font-weight: 700; color: #18182D; font-size: 18px;
  text-align: center; overflow: hidden;
}

/* revisão por produto */
.review-block { margin: 16px 0; }
.review-block h3 { margin: 0 0 8px; font-size: 16px; }

/* aviso de rascunho recuperado */
.banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--pink-soft); border: var(--line); border-radius: 14px;
  padding: 12px 16px; margin: 14px 0; font-size: 14px; font-weight: 600; color: var(--ink);
}
.banner .icon { flex: 0 0 auto; color: var(--pink-dark); }
/* pílula flutuante "rascunho salvo" */
.draft-note {
  position: fixed; right: 14px; bottom: 82px; z-index: 60;
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 7px 14px; font-size: 12px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(24,24,45,.25);
}

/* ---------- barra fixa ---------- */
.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; align-items: stretch; gap: 10px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: #fff; border-top: var(--line);
}
.sticky-bar.single #continueBtn { flex: 1; }
.add-btn {
  flex: 1; flex-direction: column; gap: 1px; padding: 8px;
}
.add-btn .add-label { display: flex; align-items: center; gap: 6px; }
.add-info { font-size: 11px; font-weight: 700; color: var(--pink-dark); }
.add-btn:disabled .add-info { color: var(--muted); }
#continueBtn { flex: 1.2; font-size: 16px; }
#counter { font-weight: 900; }

.progress-wrap {
  border: var(--line); border-radius: 999px; height: 14px;
  background: #fff; overflow: hidden; margin: 14px 0;
}
.progress-bar {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--pink); transition: width .3s;
}

/* ---------- revisão ---------- */
.review-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  margin: 14px 0;
}
.review-item { position: relative; }
.review-item .polaroid { cursor: default; box-shadow: none; }
.review-item .polaroid-band { height: 22px; }
.copies-badge {
  position: absolute; top: -8px; right: -6px;
  background: var(--pink); color: #fff; border: var(--line);
  border-radius: 999px; padding: 3px 10px;
  font-size: 12px; font-weight: 900;
}
.review-summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.summary-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: var(--line); border-radius: 999px; background: #fff;
  padding: 8px 16px; font-size: 13px; font-weight: 700;
}
.summary-chip .icon { width: 16px; height: 16px; color: var(--pink); }
.review-actions { display: flex; gap: 10px; margin-top: 18px; }
.review-actions .btn { flex: 1; }

/* ---------- cupom de brinde ---------- */
.coupon {
  position: relative; text-align: center;
  margin: 16px 0; padding: 26px 22px 24px;
  background: var(--yellow-soft);
  border: 3px dashed var(--ink); border-radius: var(--r);
}
.coupon-badge {
  width: 62px; height: 62px; margin: -50px auto 12px;
  border-radius: 50%; background: var(--pink); color: #fff;
  border: var(--line); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.coupon-badge .icon { width: 30px; height: 30px; }
.coupon-title { font-size: 20px; font-weight: 900; letter-spacing: -0.02em; }
.coupon-desc { margin: 2px 0 14px; font-size: 15px; color: #55506B; }
.coupon-desc strong { color: var(--pink-dark); }
.coupon-code {
  display: inline-block; background: #fff; color: var(--ink);
  border: var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 12px 24px; font-size: 26px; font-weight: 900; letter-spacing: 1px;
}
.coupon-cta { margin-top: 16px; }
.coupon-hint { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- sucesso / produção ---------- */
.status-icon {
  width: 84px; height: 84px; border-radius: 50%;
  border: var(--line); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  margin: 6px auto 18px;
}
.status-icon .icon { width: 38px; height: 38px; }
.status-icon.pink { background: var(--pink); color: #fff; }
.status-icon.yellow { background: var(--yellow); color: var(--ink); }
.status-icon.orange { background: var(--orange); color: #fff; }

/* ---------- modais ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(24, 24, 45, .65);
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
}
.modal-box {
  position: relative;
  background: #fff; border: var(--line); border-radius: 24px;
  padding: 20px; width: 100%; max-width: 560px;
}
.modal-box h2 { margin: 0 0 2px; }
.crop-area { max-height: 60vh; overflow: hidden; border-radius: 12px; margin-top: 12px; }
.crop-area img { max-width: 100%; display: block; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal-actions.split { justify-content: space-between; align-items: center; }
.modal-actions-right { display: flex; gap: 10px; }
.no-scroll { overflow: hidden; }

/* cropper: seleção redonda não — só realce rosa */
.cropper-view-box, .cropper-face { border-radius: 0; }
.cropper-line, .cropper-point { background-color: var(--pink); }
.cropper-view-box { outline: 2px solid var(--pink); }

/* ---------- mobile ---------- */
@media (max-width: 600px) {
  .container { padding: 14px 12px; }
  h1 { font-size: 23px; }
  .card { padding: 18px 16px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .photo-card { padding: 10px; }
  .card-buttons .btn.small { padding: 6px 10px; font-size: 12px; }
  .review-grid { grid-template-columns: repeat(3, 1fr); }
  .review-actions { flex-direction: column-reverse; }
  .new-order { flex-direction: column; align-items: stretch; }
  .new-order .field, .new-order .field.kits { flex: 0 0 auto; }
  .new-order button { width: 100%; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-box {
    max-width: none; border-radius: 24px 24px 0 0; border-bottom: none;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .crop-area { max-height: 55vh; }
  .modal-actions { gap: 8px; }
  .modal-actions-right { gap: 8px; }
  .modal-actions .btn { padding: 10px 12px; font-size: 14px; }
  .slot-row { gap: 6px; }
  .frame-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===== produtos com design SVG (tirinhas / uno / quadrinho) ===== */
.units { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; }
.unit-card.compact { border: var(--line); border-radius: var(--r); background: #fff; box-shadow: var(--shadow);
  padding: 12px; display: flex; gap: 14px; align-items: flex-start; }
.unit-thumb { border: none; background: none; padding: 0; cursor: pointer; flex: 0 0 auto; }
.unit-right { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.unit-title { font-weight: 700; }
.unit-title .partial { color: var(--orange); font-weight: 600; font-size: 12px; margin-left: 4px; }
.unit-btns { display: flex; gap: 8px; align-items: center; }
/* lixeira com a identidade do app (pílula ink + sombra dura + acento rosa) */
.del-unit { padding: 0 !important; width: 38px; height: 38px; flex: 0 0 38px;
  border-color: var(--pink-dark); color: var(--pink-dark); }
.del-unit:hover { background: var(--pink-soft); }
.del-unit .icon { width: 17px; height: 17px; }

/* preview fiel (SVG inline com as fotos dentro) */
.unit-preview { position: relative; width: 100%; overflow: hidden; border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(24,24,45,.18), 0 2px 8px rgba(24,24,45,.16); background: #fff; }
.unit-preview svg { display: block; width: 100%; height: 100%; }
.unit-preview.small { width: 96px; }
.unit-preview.review { width: 100%; }
/* escolha da cor da moldura (polaroids clássicas) */
.frame-choice { display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 12px 0 6px; padding: 4px 0; }
.fc-sw { width: 28px; height: 28px; border-radius: 50%; border: var(--line); padding: 0; cursor: pointer; position: relative; overflow: hidden; flex: 0 0 auto; }
.fc-sw.on { box-shadow: 0 0 0 3px var(--pink); }
.fc-custom { background: conic-gradient(red, orange, yellow, lime, cyan, blue, magenta, red); display: inline-flex; }
.fc-custom input[type=color] { position: absolute; inset: -4px; width: 200%; height: 200%; opacity: 0; cursor: pointer; padding: 0; border: none; }

/* Foto Paint: foto atrás (na janela) + PNG com transparência por cima */
.up-behind { position: absolute; object-fit: cover; display: block; }
.up-behind.empty { background: var(--pink-soft); }
.up-overlay { position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  image-rendering: pixelated; /* mantém o visual pixel-art do Paint */ }
.up-clear { position: absolute; left: 0; right: 0; bottom: 0; }
.up-zone { position: absolute; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.up-zone.left { justify-content: flex-start; }
.up-code { max-width: 100%; max-height: 100%; display: block; }
/* o PNG do scannables tem ~10% de margem interna; 111% + overflow hidden da
   zona fazem o CONTEÚDO (logo+barras) ocupar a largura exata da foto */
.up-code.wide { width: 111%; max-width: none; max-height: none; height: auto; flex: none; }
.up-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; line-height: 1; }
.up-artist { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; line-height: 1; }
.up-text { font-family: 'Shantell Sans', 'Comic Sans MS', cursive; font-weight: 600; white-space: nowrap; }
.up-fail { padding: 20px 8px; font-size: 12px; color: var(--muted); text-align: center; }

/* popup de montagem */
.unit-modal-box { max-width: 720px; width: 100%; max-height: 92vh; overflow-y: auto; }
.um-sub { margin: -6px 0 12px; }
.unit-modal-grid { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
.unit-preview-wrap { position: sticky; top: 0; }
/* preview limitado pela ALTURA da tela (tirinhas são compridas) — a largura
   vem da proporção do produto; nunca estoura a viewport */
#unitPreview { width: auto; height: auto; max-height: min(56vh, 520px); max-width: 240px; }
.unit-controls { min-width: 0; }
.um-label { font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
.um-label:first-child { margin-top: 0; }
.um-slots { display: flex; gap: 10px; flex-wrap: wrap; }
.um-slot { display: flex; flex-direction: column; gap: 6px; align-items: stretch; width: 86px; }
.um-slot-pick { border: 2px dashed var(--ink); border-radius: 12px; background: var(--pink-soft); padding: 0;
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--pink-dark); gap: 2px; }
.um-slot-pick small { font-size: 11px; font-weight: 600; }
.um-slot-pick.filled { border-style: solid; }
.um-slot-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.um-slot-acts .btn { width: 100%; justify-content: center; padding: 5px 8px; font-size: 12px; }
.um-hint { margin-top: 6px; }
#cropModal { z-index: 130; } /* fica ACIMA do popup de montagem (.modal = 100) */

.variant-row { display: flex; flex-wrap: wrap; gap: 8px; }
.vchip { border: var(--line); border-radius: 999px; background: #fff; padding: 6px 12px; font-weight: 600; font-size: 13px; cursor: pointer; }
.vchip.on { background: var(--ink); color: #fff; }
.vchip.swatchchip { width: 30px; height: 30px; padding: 0; border-radius: 50%; }
.vchip.swatchchip.on { box-shadow: 0 0 0 3px var(--pink); }
.mini-field { display: block; margin-top: 12px; }
.mini-field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.mini-field input:not([type=color]) { width: 100%; border: var(--line); border-radius: 12px; padding: 9px 11px; font: inherit; }
.mini-field.color-field input[type=color] { width: 54px; height: 34px; border: var(--line); border-radius: 10px; padding: 2px; background: #fff; cursor: pointer; }
.um-hint-inline { font-weight: 500; color: var(--pink-dark); font-size: 11px; }
.frame-wrap { position: relative; }
.frame-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 4px; max-height: 240px; overflow-y: auto; padding-bottom: 4px; }
.frame-fade { position: absolute; left: 0; right: 6px; bottom: 0; height: 34px; pointer-events: none; border-radius: 0 0 8px 8px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--bg)); transition: opacity .2s; }
/* botão X de fechar (canto do modal) */
.modal-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%;
  border: var(--line); background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2; }
.modal-x .icon { width: 20px; height: 20px; }
.modal-x:hover { background: var(--pink-soft); }
/* modal de confirmação final */
.confirm-box { max-width: 460px; text-align: center; }
.confirm-emoji { font-size: 40px; margin-bottom: 4px; }
.confirm-box h2 { margin: 0 0 8px; }
.confirm-box p { color: var(--muted); margin: 0 0 14px; }
.confirm-box .notice.warn { text-align: left; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions .btn { flex: 1; justify-content: center; }
.notice.warn { display: flex; gap: 8px; align-items: flex-start; background: var(--yellow-soft); border: var(--line);
  border-radius: 14px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px; }
.notice.warn .icon { flex: 0 0 auto; width: 20px; height: 20px; color: var(--orange); margin-top: 1px; }
@media (max-width: 640px) { .confirm-actions { flex-direction: column-reverse; } }
.frame-thumb { border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; padding: 0; cursor: pointer; background: #fff; aspect-ratio: 81/101; }
.frame-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame-thumb.on { box-shadow: 0 0 0 3px var(--pink); }
.unit-stepper { margin-top: 2px; }
.unit-stepper .qty-lbl { font-size: 12px; color: var(--muted); margin: 0 4px; }

@media (max-width: 640px) {
  .unit-modal-grid { grid-template-columns: 1fr; }
  .unit-preview-wrap { position: static; display: flex; justify-content: center; }
  #unitPreview { max-width: 200px; }
  .unit-preview.small { width: 76px; }
  .frame-grid { grid-template-columns: repeat(4, 1fr); }
}
