/* Shared "add item" sheet (all restaurant templates). Only the restaurant's colours differ:
   Category Tabs / Cards use --ct-*, Modern V2 uses --mv2-* (both come from "Дизайн"). */
.qps {
  --qps-surface: var(--ct-surface, var(--mv2-surface, #ffffff));
  --qps-text: var(--ct-text, var(--mv2-text, #111827));
  --qps-muted: var(--ct-muted, var(--mv2-muted, #6b7280));
  --qps-border: var(--ct-border, var(--mv2-border, #e5e7eb));
  --qps-accent: var(--ct-primary-bg, var(--mv2-primary-bg, #111827));
  --qps-accent-text: var(--ct-primary-text, var(--mv2-primary-text, #ffffff));
  --qps-radius: var(--ct-primary-radius, var(--mv2-primary-radius, 14px));
  --qps-image-radius: var(--ct-image-radius, var(--mv2-image-radius, 16px));
  position: fixed;
  inset: 0;
  z-index: 10060;
}
.qps[hidden] { display: none !important; }
body.qps-open { overflow: hidden !important; }
.qps-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}
.qps-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 24px);
  max-width: 480px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  background: var(--qps-surface);
  color: var(--qps-text);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  text-align: left;
}
.qps-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, .06);
  color: var(--qps-text);
  font-size: 28px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
}
.qps-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 56px 18px 18px;
}

/* Photo, title, portion, description */
.qps-image {
  margin: 0 0 16px;
  border-radius: var(--qps-image-radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: rgba(15, 23, 42, .05);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}
.qps-image[hidden], .qps-portion[hidden], .qps-desc[hidden], .qps-hint[hidden], .qps-box[hidden] { display: none !important; }
.qps-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.qps-title {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--qps-text);
}
.qps-portion {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--qps-muted);
}
.qps-desc {
  margin: 4px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--qps-border);
  border-radius: 16px;
  background: rgba(15, 23, 42, .025);
  color: var(--qps-text);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-line;
}

/* Variants and extras: one bordered box, one row per option */
.qps-box {
  margin: 16px 0 0;
  padding: 14px 14px 6px;
  border: 1px solid var(--qps-border);
  border-radius: 16px;
}
.qps-box-title { margin: 0 0 6px; font-size: 16px; font-weight: 800; color: var(--qps-text); }
.qps-hint { margin: -2px 0 6px; font-size: 13px; color: var(--qps-muted); }
.qps-row {
  display: flex !important;
  align-items: center;
  gap: 12px;
  margin: 0 !important;
  padding: 11px 0;
  border-top: 1px solid var(--qps-border);
  font-size: 15px;
  font-weight: 500;
  color: var(--qps-text);
  cursor: pointer;
}
.qps-box-title + .qps-row, .qps-hint + .qps-extras-list .qps-row:first-child, .qps-extras-list .qps-row:first-child { border-top: 0; }
.qps-row.is-disabled { opacity: .5; cursor: default; }
.qps-row input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.qps-tick {
  flex: 0 0 auto;
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid #b4b4b4;
  border-radius: 4px;
  background: transparent;
  transition: background-color .15s, border-color .15s;
}
.qps-tick-radio { border-radius: 999px; }
.qps-row input:checked + .qps-tick { background: var(--qps-accent); border-color: var(--qps-accent); }
.qps-row input:checked + .qps-tick::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid var(--qps-accent-text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.qps-row input:checked + .qps-tick-radio::after {
  left: 4px;
  top: 4px;
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--qps-accent-text);
  transform: none;
}
.qps-row input:focus-visible + .qps-tick { outline: 2px solid var(--qps-accent); outline-offset: 2px; }
.qps-row-title { flex: 1 1 auto; min-width: 0; }
.qps-free-note { color: var(--qps-muted); font-weight: 500; }
.qps-row-price { flex-shrink: 0; font-weight: 700; white-space: nowrap; }
.qps-row.is-free .qps-row-price { color: var(--qps-muted); text-decoration: line-through; }

/* Footer: quantity next to "Добави" */
.qps-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--qps-border);
  background: var(--qps-surface);
}
.qps-qty {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 52px;
  padding: 4px;
  border: 1px solid var(--qps-border);
  border-radius: 16px;
  background: rgba(15, 23, 42, .03);
}
.qps-qty-btn {
  width: 36px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--qps-text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.qps-qty-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--qps-accent) 10%, transparent);
  color: var(--qps-text);
  font-size: 17px;
  font-weight: 800;
}
.qps-add {
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--qps-radius);
  background: var(--qps-accent);
  color: var(--qps-accent-text);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
}
.qps-add:disabled { opacity: .5; cursor: default; }
.qps-price {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .22);
  line-height: 1;
  white-space: nowrap;
}
