.modal {
  width: min(460px, calc(100% - 32px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  color: var(--text);
  background: transparent;
  box-shadow: 0 24px 72px rgb(5 31 24 / 30%);
}

.modal::backdrop { background: rgb(5 36 27 / 56%); backdrop-filter: blur(3px); }
.modal-surface { position: relative; padding: 30px; background: #fff; }
.modal-close { position: absolute; top: 14px; right: 14px; display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 50%; color: #52625e; background: #eef4f1; font-size: 1.4rem; cursor: pointer; }
.modal-close:hover { color: #fff; background: var(--green); }
.option-product { display: flex; align-items: center; gap: 14px; padding-right: 35px; }
.option-emoji { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #e5f0eb, #f8eee1); font-size: 2.5rem; }
.option-product h2 { font-size: 1.4rem; }
.option-base-price { margin: 4px 0 0; color: var(--green); font-size: 1.05rem; font-weight: 800; }
.option-groups { display: grid; gap: 14px; margin-top: 22px; }
.option-section { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.option-label { display: grid; gap: 4px; font-weight: 800; }
.option-label small { color: var(--green); font-weight: 700; }
.switch { position: relative; display: inline-block; width: 50px; height: 30px; }
.switch input { width: 0; height: 0; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #c9d7d1; transition: .18s; cursor: pointer; }
.switch span::after { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; content: ""; transition: .18s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.spice-section { display: block; padding: 18px; }
.spice-section legend { padding: 0 5px; font-weight: 800; }
.spice-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 5px; }
.spice-options label { position: relative; cursor: pointer; }
.spice-options input { position: absolute; opacity: 0; }
.spice-options span { display: block; padding: 10px 4px; border: 1px solid var(--line); border-radius: 8px; text-align: center; font-size: .9rem; font-weight: 700; }
.spice-options input:checked + span { color: #fff; border-color: var(--green); background: var(--green); }
.option-choice-group { display: block; margin: 0; padding: 14px; }
.option-choice-group legend { padding: 0 5px; font-weight: 800; }
.option-choice-group .spice-options { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
.option-choice-group .spice-options small { display: block; margin-top: 2px; color: inherit; font-size: .72rem; }
.no-options { margin: 22px 0 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.modal-action { min-height: 54px; margin-top: 22px; border-radius: 10px; box-shadow: 0 7px 14px rgb(18 102 80 / 20%); }
.order-modal { width: min(600px, calc(100% - 32px)); }
.modal-title-row { display: flex; align-items: center; justify-content: space-between; padding-right: 34px; }
.count-badge { padding: 5px 9px; border-radius: 99px; color: var(--green); background: #e5f0eb; font-size: .8rem; font-weight: 800; }
.modal-description { margin: 8px 0 18px; color: var(--muted); font-size: .84rem; }
.order-items { display: grid; max-height: 330px; gap: 8px; overflow: auto; }
.order-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 24px; gap: 10px; align-items: center; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: #fff; text-align: left; cursor: pointer; }
.order-item:hover { border-color: #d38c8c; background: #fff9f9; }
.order-item-emoji { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 8px; background: #edf4f1; font-size: 1.55rem; }
.order-item strong,.order-item small { display: block; }
.order-item small { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.order-item b { color: var(--green); white-space: nowrap; }
.order-item i { color: #c04949; font-size: 1.3rem; font-style: normal; }
.empty-order { padding: 28px; color: var(--muted); background: #f5f8f6; border-radius: 10px; text-align: center; }
.order-total { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); font-size: 1rem; font-weight: 800; }
.order-total strong { color: var(--green); font-size: 1.8rem; }
.payment-summary { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0; padding: 15px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--deep), var(--green)); }
.payment-summary strong { font-size: 1.8rem; }
.tender-screen { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 13px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; }
.tender-screen span,.payment-change span { color: var(--muted); font-size: .84rem; }
.tender-screen strong { font-size: 1.35rem; }
.calculator { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.calculator button { min-height: 48px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #fff; font: inherit; font-size: 1.15rem; font-weight: 800; cursor: pointer; }
.calculator button:hover { color: #fff; border-color: var(--green); background: var(--green); }
.calculator button[data-key="⌫"] { color: #bd4a4a; background: #fff4f4; }
.calculator .calculator-exact { grid-column: span 2; color: #fff; border-color: var(--green); background: var(--green); }
.calculator .calculator-exact:hover { color: var(--green); background: #fff; }
.payment-change { display: flex; align-items: baseline; justify-content: space-between; margin-top: 15px; padding: 13px 15px; border-radius: 10px; background: #edf5f1; }
.payment-change strong { color: var(--green); font-size: 1.4rem; }
.toast { position: fixed; z-index: 20; bottom: 28px; left: 50%; margin: 0; padding: 12px 20px; transform: translate(-50%, 20px); border-radius: 99px; color: #fff; background: #1e3730; box-shadow: 0 8px 25px rgb(0 0 0 / 20%); opacity: 0; transition: .2s; pointer-events: none; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.set-discount { display:flex; justify-content:space-between; margin:16px 0 0; padding:11px 12px; border-radius:9px; background:#edf7ef; color:#287146; font-size:.9rem; font-weight:700; }
.set-discount strong { font-size:1rem; }
@media screen and (max-width: 560px) {
  .modal { width: calc(100% - 20px); max-height: 88vh; overflow: auto; }
  .modal-surface { padding: 24px 18px 18px; }
  .option-section { margin-top: 17px; padding: 14px; }
  .order-items { max-height: 280px; }
  .order-item { grid-template-columns: 38px minmax(0, 1fr) auto 18px; gap: 7px; padding: 8px; }
  .order-item-emoji { width: 38px; height: 38px; font-size: 1.3rem; }
  .order-item b { font-size: .84rem; }
  .order-total strong { font-size: 1.55rem; }
  .toast { bottom: 82px; width: max-content; max-width: calc(100% - 24px); text-align: center; }
}
