/* Janela premium de opções do produto (cardápio) e editor de opções (painel do lojista). */

.cart-line .nm span { display: block; overflow-wrap: anywhere; }

.po-overlay {
  --po-bg: #17181c;
  --po-card: #212227;
  --po-line: rgba(255, 255, 255, .1);
  --po-ink: #f5f5f7;
  --po-muted: #a2a4ad;
  --po-accent: var(--store, #e11d48);
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vh, 32px) 16px;
  background: rgba(5, 6, 9, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: po-fade .18s ease-out;
}

.po-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  color: var(--po-ink);
  background: var(--po-bg);
  border: 1px solid var(--po-line);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  animation: po-rise .24s cubic-bezier(.2, .8, .2, 1);
}

.po-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 14px 22px;
}
.po-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--po-accent); }
.po-brand b { color: var(--po-ink); font: 800 22px/1 'Plus Jakarta Sans', var(--font, system-ui), sans-serif; letter-spacing: -.02em; }
.po-brand em { color: var(--po-accent); font-style: normal; }
.po-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--po-ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 12px;
  transition: background .15s;
}
.po-close:hover { background: rgba(255, 255, 255, .08); }

.po-scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(255, 255, 255, .22) transparent;
  scrollbar-width: thin;
}

.po-hero { aspect-ratio: 16 / 7.5; overflow: hidden; background: #0d0e11; }
.po-hero img { display: block; width: 100%; height: 100%; object-fit: cover; }

.po-title { padding: 18px 22px 6px; }
.po-title h2 { margin: 0; color: var(--po-ink); font: 800 clamp(21px, 4.6vw, 26px)/1.2 'Plus Jakarta Sans', var(--font, system-ui), sans-serif; letter-spacing: -.01em; overflow-wrap: anywhere; }
.po-title p { margin: 6px 0 0; color: var(--po-muted); font-size: 14px; line-height: 1.45; }
.po-base { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: 8px; }
.po-base strong { color: var(--po-accent); font: 800 21px/1.2 'Plus Jakarta Sans', var(--font, system-ui), sans-serif; }
.po-base s { color: var(--po-muted); font-size: 14px; }

.po-group { margin: 12px 16px 0; padding: 14px; background: var(--po-card); border: 1px solid var(--po-line); border-radius: 16px; }
.po-group h3 { margin: 0; color: var(--po-ink); font: 700 17px/1.3 'Plus Jakarta Sans', var(--font, system-ui), sans-serif; overflow-wrap: anywhere; }
.po-hint { margin: 2px 0 10px; color: var(--po-muted); font-size: 13px; }
.po-items { display: grid; gap: 8px; }
.po-items-plain { gap: 2px; }

.po-name { flex: 1; min-width: 0; color: var(--po-ink); font-size: 15px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.po-price { flex: none; color: var(--po-accent); font-size: 14px; font-weight: 700; white-space: nowrap; }

/* Escolha obrigatória */
.po-radio {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px;
  cursor: pointer;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--po-line);
  border-radius: 12px;
  transition: border-color .15s, background .15s;
}
.po-radio input, .po-check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.po-radio i {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid #8b8d96;
  border-radius: 50%;
  transition: border-color .15s;
}
.po-radio i::after { width: 10px; height: 10px; content: ''; background: var(--po-accent); border-radius: 50%; transform: scale(0); transition: transform .15s; }
.po-radio:has(input:checked) { background: color-mix(in srgb, var(--po-accent) 14%, transparent); border-color: var(--po-accent); }
.po-radio input:checked + i { border-color: var(--po-accent); }
.po-radio input:checked + i::after { transform: scale(1); }
.po-radio input:focus-visible + i, .po-check input:focus-visible + i { outline: 2px solid var(--po-accent); outline-offset: 2px; }

/* Ingredientes removíveis */
.po-check { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px; cursor: pointer; border-radius: 10px; }
.po-check i { display: grid; flex: none; place-items: center; width: 22px; height: 22px; border: 2px solid #8b8d96; border-radius: 6px; transition: background .15s, border-color .15s; }
.po-check input:checked + i { background: var(--po-accent); border-color: var(--po-accent); }
.po-check input:checked + i::after { width: 6px; height: 11px; margin-top: -2px; content: ''; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }

/* Adicionais */
.po-addon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-height: 56px;
  padding: 8px 10px 8px 14px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--po-line);
  border-radius: 12px;
  transition: border-color .15s;
}
.po-addon.on { border-color: var(--po-accent); }
.po-stepper { display: inline-flex; flex: none; align-items: center; gap: 6px; }
.po-stepper b { min-width: 20px; color: var(--po-ink); font-size: 15px; text-align: center; }
.po-stepper b[hidden], .po-stepper button[hidden] { display: none; }
.po-stepper button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--po-accent);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  background: transparent;
  border: 1.5px solid var(--po-accent);
  border-radius: 10px;
  transition: background .15s, color .15s;
}
.po-stepper button:hover { color: #fff; background: var(--po-accent); }

.po-foot {
  flex: none;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--po-bg);
  border-top: 1px solid var(--po-line);
}
.po-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 18px;
  color: #fff;
  font: 700 clamp(15px, 3.8vw, 17px)/1.25 'Plus Jakarta Sans', var(--font, system-ui), sans-serif;
  cursor: pointer;
  background: var(--po-accent);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--po-accent) 38%, transparent);
  transition: filter .15s, transform .1s;
}
.po-add svg { flex: none; }
.po-add b { font-weight: 800; white-space: nowrap; }
.po-add:hover { filter: brightness(1.08); }
.po-add:active { transform: scale(.985); }
.po-add:focus-visible, .po-close:focus-visible, .po-stepper button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Celular: painel que sobe de baixo, ocupando a largura toda */
@media (max-width: 600px) {
  .po-overlay { align-items: flex-end; padding: 0; }
  .po-modal {
    max-width: none;
    max-height: calc(100dvh - 24px);
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
    animation-name: po-sheet;
  }
  .po-head { padding: 10px 10px 10px 18px; }
  .po-title { padding: 16px 18px 4px; }
  .po-group { margin-inline: 12px; }
  .po-foot { padding-inline: 12px; }
}

/* Celular deitado ou tela muito baixa: a foto não toma o espaço das opções */
@media (max-height: 520px) {
  .po-modal { max-height: 100dvh; }
  .po-hero { aspect-ratio: 16 / 4; }
  .po-head { padding-block: 4px; }
  .po-foot { padding-block: 8px; }
  .po-add { min-height: 46px; }
}

@keyframes po-fade { from { opacity: 0; } }
@keyframes po-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes po-sheet { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .po-overlay, .po-modal { animation: none; } }

/* ---------- Editor no painel do lojista ---------- */
.opt-editor { display: grid; gap: 12px; }
.opt-editor-help { margin: 0; color: var(--muted); font-size: 13px; }
.opt-group { display: grid; gap: 10px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.opt-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.opt-group-head .input { flex: 1 1 200px; min-width: 0; }
.opt-rows { display: grid; gap: 8px; }
.opt-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 40px; gap: 8px; align-items: center; }
.opt-row.no-price { grid-template-columns: minmax(0, 1fr) 40px; }
.opt-add-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.p-row .p-info { min-width: 0; }
.p-row .p-info .opt-badge-list { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.order-items .order-opts { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; font-weight: 400; line-height: 1.35; }
@media (max-width: 520px) {
  .opt-row { grid-template-columns: minmax(0, 1fr) 84px 40px; }
}
@media (max-width: 560px) {
  .p-row { flex-wrap: wrap; gap: 10px 12px; }
  .p-row .p-info { flex: 1 1 calc(100% - 70px); }
  .p-row .price { margin-right: auto; }
}
