/* Resumo do pedido e Pix (pix-checkout.js). Todas as classes começam com pxo. */

/* Camada própria: faz o resumo funcionar em qualquer página (com Tailwind ou não), sem depender
   do styles.css do quiz. Os seletores usam :where() para não passar por cima das regras abaixo. */
.pxo {
  --yolk: #fdb40c;
  --yolk-pale: #ffebb0;
  --cream: #fff8e6;
  --cacau: #2c150c;
  --cacau-soft: #4a2a1d;
  --red: #d9231a;
  --red-deep: #a8160f;
  --white: #fff;
  --display: "Fraunces", "Georgia", serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
:where(.pxo), :where(.pxo) *, :where(.pxo) *::before, :where(.pxo) *::after { box-sizing: border-box; }
:where(.pxo) :is(h2, h3, p, ul, ol, dl, dd) { margin: 0; }
:where(.pxo) ul { padding: 0; list-style: none; }
:where(.pxo) img { display: block; max-width: 100%; }
:where(.pxo) :is(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.pxo) button { cursor: pointer; }
:where(.pxo) [hidden] { display: none !important; }
:where(.pxo) :focus-visible { outline: 3px solid var(--cacau); outline-offset: 3px; }
:where(.pxo) .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 62px;
  padding: 0 34px;
  border: 0;
  border-radius: 999px;
  font-size: 1.1875rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
:where(.pxo) .btn--primary { background: var(--red); color: var(--white); box-shadow: 0 5px 0 var(--red-deep), 0 16px 26px -10px rgba(168, 22, 15, 0.55); }
:where(.pxo) .btn--primary:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--red-deep), 0 20px 28px -10px rgba(168, 22, 15, 0.55); }
:where(.pxo) .btn--primary:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--red-deep), 0 6px 12px -6px rgba(168, 22, 15, 0.55); }
:where(.pxo) .btn--primary[disabled] { background: var(--cacau-soft); box-shadow: none; cursor: not-allowed; transform: none; opacity: 0.8; }
:where(.pxo) .btn--block { width: 100%; }

.pxo {
  width: min(560px, 100vw);
  max-width: 100vw;
  height: min(100svh, 940px);
  max-height: 100svh;
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: var(--yolk);
  color: var(--cacau);
  overflow: hidden;
  font-family: var(--text);
}
.pxo[open] { display: flex; flex-direction: column; }
.pxo::backdrop { background: rgba(44, 21, 12, 0.82); }
@media (max-width: 640px) {
  .pxo { width: 100vw; height: 100svh; border-radius: 0; }
}

.pxo__head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 10px;
}
.pxo__titulo { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 0; font-weight: 900; font-size: 1.625rem; line-height: 1.1; letter-spacing: -0.01em; }
.pxo__titulo:focus { outline: none; }
.pxo__x {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--cacau);
  color: var(--yolk);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}
.pxo__body { flex: 1; overflow-y: auto; display: grid; gap: 12px; align-content: start; padding: 4px 20px 24px; }

.pxo__card { padding: 16px; border-radius: 20px; background: var(--cream); box-shadow: 0 2px 0 rgba(44, 21, 12, 0.1); }
.pxo__h3 { font-size: 1.0625rem; font-weight: 800; line-height: 1.2; }
.pxo__topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.pxo__editar {
  padding: 8px 16px;
  border: 2px solid var(--cacau);
  border-radius: 999px;
  background: transparent;
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1;
}
.pxo__editar:hover { background: var(--cacau); color: var(--yolk-pale); }
.pxo__linha { font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.pxo__linha:first-of-type { font-weight: 700; }

/* itens do pedido */
.pxo__itens { display: grid; gap: 10px; margin-top: 10px; }
.pxo__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.pxo__item:not(:has(.pxo__img)) { grid-template-columns: minmax(0, 1fr) auto; }
.pxo__img { width: 56px; height: 56px; border-radius: 12px; background: var(--white); object-fit: contain; padding: 2px; }
.pxo__nome { font-weight: 800; line-height: 1.25; }
.pxo__det { font-size: 0.875rem; font-weight: 500; color: var(--cacau-soft); line-height: 1.35; }
.pxo__valor { font-weight: 800; white-space: nowrap; }
.pxo__valor--gratis { color: var(--red-deep); }

/* frete */
.pxo__fretes { display: grid; gap: 8px; margin-top: 14px; }
.pxo__sub { font-weight: 800; }
.pxo__frete { position: relative; display: block; cursor: pointer; }
.pxo__frete input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pxo__fcard {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  grid-template-areas: "dot nome preco" ". eta eta";
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  padding: 13px 14px;
  border: 2px solid rgba(44, 21, 12, 0.16);
  border-radius: 16px;
  background: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pxo__fdot { grid-area: dot; width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid rgba(44, 21, 12, 0.3); border-radius: 50%; }
.pxo__fdot::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--cacau); transform: scale(0); transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1); }
.pxo__fnome { grid-area: nome; font-weight: 800; }
.pxo__fpreco { grid-area: preco; font-weight: 800; }
.pxo__feta { grid-area: eta; font-size: 0.9375rem; font-weight: 500; color: var(--cacau-soft); }
.pxo__frete input:checked + .pxo__fcard { border-color: var(--cacau); box-shadow: inset 0 0 0 2px var(--cacau); }
.pxo__frete input:checked + .pxo__fcard .pxo__fdot { border-color: var(--cacau); }
.pxo__frete input:checked + .pxo__fcard .pxo__fdot::after { transform: scale(1); }
.pxo__frete input:focus-visible + .pxo__fcard { outline: 3px solid var(--cacau); outline-offset: 3px; }

.pxo__totais { margin: 14px 0 0; display: grid; gap: 6px; }
.pxo__totais > div { display: flex; justify-content: space-between; gap: 16px; }
.pxo__totais dt { font-weight: 600; }
.pxo__totais dd { margin: 0; font-weight: 700; text-align: right; }
.pxo__total { margin-top: 4px; padding-top: 10px; border-top: 2px dashed rgba(44, 21, 12, 0.28); font-size: 1.25rem; }
.pxo__total dt, .pxo__total dd { font-weight: 800; }

/* formulários de edição */
.pxo__form { display: grid; gap: 12px; margin-top: 6px; }
.pxo__field label { display: block; margin-bottom: 6px; font-size: 0.9375rem; font-weight: 700; }
.pxo__field input, .pxo__field select {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 2px solid rgba(44, 21, 12, 0.2);
  border-radius: 14px;
  background: var(--white);
  font-size: 1.0625rem;
  font-weight: 600;
}
.pxo__field input:focus-visible, .pxo__field select:focus-visible { outline: 3px solid var(--cacau); outline-offset: 2px; border-color: var(--cacau); }
.pxo__field input[aria-invalid="true"] { border-color: var(--red); }
.pxo__err { margin-top: 4px; font-size: 0.875rem; font-weight: 700; color: var(--red-deep); }
.pxo__err:empty { display: none; }
.pxo__dica { font-size: 0.875rem; font-weight: 600; color: var(--cacau-soft); }
.pxo__dica:empty { display: none; }
.pxo__row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.pxo__row2--cidade { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.pxo__acoes { display: flex; gap: 10px; }
.pxo__btn { flex: 1; min-height: 48px; border: 2px solid var(--cacau); border-radius: 999px; font-size: 1rem; font-weight: 800; }
.pxo__btn--pri { background: var(--cacau); color: var(--yolk-pale); }
.pxo__btn--sec { background: transparent; color: var(--cacau); }

.pxo__aviso { padding: 12px 14px; border-radius: 14px; background: rgba(217, 35, 26, 0.12); font-weight: 700; line-height: 1.4; color: var(--red-deep); }
.pxo__aviso--info { background: rgba(44, 21, 12, 0.08); color: var(--cacau-soft); font-weight: 600; }
.pxo__teste { width: 100%; min-height: 48px; border: 2px dashed var(--cacau); border-radius: 14px; background: transparent; font-weight: 800; }
.pxo__teste:disabled { opacity: 0.6; cursor: wait; }
.pxo__qr--img { width: min(260px, 100%); height: auto; }
.pxo__espera { padding: 14px; border-radius: 14px; background: var(--yolk-pale, rgba(253, 180, 12, 0.18)); color: var(--cacau); font-weight: 700; }
.pxo__cta { margin-top: 4px; }
.pxo__cta:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }
.pxo__link { margin: 0; padding: 8px 0; border: 0; background: none; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; text-align: center; }

/* Pix */
.pxo__pix { display: grid; gap: 12px; }
.pxo__pixvalor { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; font-weight: 900; font-size: 2.75rem; line-height: 1; color: var(--red-deep); }
.pxo__qr { justify-self: center; width: min(260px, 100%); padding: 10px; border-radius: 16px; background: var(--white); }
.pxo__qr svg { display: block; width: 100%; height: auto; }
.pxo__code {
  width: 100%;
  padding: 12px;
  border: 2px dashed rgba(44, 21, 12, 0.4);
  border-radius: 14px;
  background: var(--white);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.4;
  resize: none;
  word-break: break-all;
}
.pxo__passos { margin: 0; padding-left: 1.2rem; display: grid; gap: 4px; font-weight: 500; list-style: decimal; }

/* order bump dentro do resumo (usa as classes .bump do styles.css) */
.pxo__body > .bump { margin-top: 14px; }
.pxo__body .bump__destaque { margin-top: 6px; font-weight: 800; color: var(--cacau); }
}
