/* Deals D1: the deals strip on Home, the deal tags on menu cards, the deal page and the dish lines
   under a deal in the cart and the order history. Colours come from the theme tokens only. */

/* ---- tags on cards ---- */
.deal-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.deal-card-tags:empty { display: none; }
.badge.deal-badge {
  background: color-mix(in srgb, var(--gold) 18%, transparent);
  color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
}
.deal-save {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 700; line-height: 1;
  padding: 4px 8px; border-radius: 999px;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 14%, transparent);
}
.deal-when { display: block; font-size: 12px; color: var(--orange); font-weight: 600; margin-top: 4px; }
.deal-when.deal-off, .deal-off { color: var(--muted); font-weight: 600; }

/* ---- the strip on Home ---- */
.deals-strip { margin: 6px 0 4px; }
.deals-strip .h-row { margin-bottom: 8px; }
.deals-scroll { gap: 12px; padding-bottom: 10px; }
.deal-tile {
  flex: 0 0 auto; width: 236px; min-width: 236px;
  display: flex; flex-direction: column; text-align: start;
  padding: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 7%, var(--card)) 0%, var(--card) 70%);
  color: var(--text); font: inherit; cursor: pointer;
  box-shadow: var(--card-shadow); scroll-snap-align: start;
  transition: transform var(--cx-fast, 140ms) ease;
}
.deal-tile:active { transform: scale(0.98); }
.deal-tile-photo { position: relative; display: block; height: 128px; background: var(--bg-2, var(--card)); }
.deal-tile-photo img, .deal-tile-photo .cx-ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.deal-tile-photo .badge { position: absolute; top: 10px; inset-inline-start: 10px; margin: 0; background: rgba(10, 8, 7, 0.72); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 55%, transparent); backdrop-filter: blur(6px); }
.deal-tile-copy { display: flex; flex-direction: column; gap: 5px; padding: 11px 12px 13px; }
.deal-tile-copy strong { font-size: 15px; line-height: 1.3; }
.deal-tile-price { color: var(--gold); font-weight: 700; font-size: 14px; }
.deal-tile-copy .deal-save { align-self: flex-start; }
.deal-tile-copy .deal-when { margin-top: 0; }
.deal-tile.is-off { opacity: 0.6; }
.deal-tile.is-off .deal-tile-photo img { filter: grayscale(0.7); }

/* ---- dish lines under a deal (cart, tracking, history) ---- */
.deal-dishes { list-style: none; margin: 4px 0 2px; padding: 0 0 0 0; padding-inline-start: 12px; border-inline-start: 2px solid var(--line); }
.deal-dishes li { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.deal-dishes li b { font-weight: 600; color: var(--text); white-space: nowrap; }
.active-order-item .deal-dishes { margin-top: 2px; }

/* ---- the deal page ---- */
.deal-screen .deal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.deal-screen .deal-head .badge { position: static; margin: 0; }
.deal-screen .deal-head .deal-when { margin: 0; }
.deal-unavailable {
  margin: 10px 0; padding: 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--text); font-weight: 600; font-size: 14px;
}
.deal-sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 14px 0 6px; }
.deal-size {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; text-align: start; cursor: pointer;
}
.deal-size b { font-size: 15px; }
.deal-size span { color: var(--gold); font-weight: 700; font-size: 14px; }
.deal-size small { color: var(--muted); font-size: 11.5px; }
.deal-size.on { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange) inset; background: color-mix(in srgb, var(--orange) 9%, var(--card)); }
.deal-size.is-off { opacity: 0.5; cursor: not-allowed; }

.deal-step { margin: 18px 0 8px; }
.deal-step h4 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 16px; }
.deal-step-no {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 13px; font-weight: 700;
  background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange);
}
.deal-step.done .deal-step-no, .deal-included .deal-step-no { background: var(--green); color: #fff; }
.deal-progress { margin-inline-start: auto; font-size: 12px; font-weight: 700; color: var(--muted); padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); }
.deal-step.done .deal-progress { color: var(--green); border-color: color-mix(in srgb, var(--green) 50%, transparent); }
.deal-included ul { list-style: none; margin: 0; padding: 10px 12px; border-radius: 14px; border: 1px dashed var(--line); }
.deal-included li { padding: 4px 0; font-size: 14px; }
.deal-included li small { color: var(--muted); margin-inline-start: 6px; }
.deal-included li.is-off { color: var(--muted); text-decoration: line-through; }

.deal-opts { display: flex; flex-direction: column; gap: 8px; }
.deal-opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 60px; padding: 8px 12px 8px 8px; padding-inline: 8px 12px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  color: var(--text); font: inherit; text-align: start; cursor: pointer;
}
.deal-opt.on { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 8%, var(--card)); }
.deal-opt.is-off { opacity: 0.5; cursor: not-allowed; }
.deal-opt.is-off img { filter: grayscale(1); }
.deal-opt-photo { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 10px; overflow: hidden; background: var(--bg-2, var(--card)); }
.deal-opt-photo img, .deal-opt-photo .cx-ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.deal-opt-name { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.deal-opt-name b { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.deal-opt-name small { color: var(--muted); font-size: 12px; }
.deal-upgrade { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--gold); }
.deal-tick { flex: 0 0 auto; width: 22px; height: 22px; border: 2px solid var(--line); background: transparent; display: inline-grid; place-items: center; }
.deal-tick.deal-tick-radio { border-radius: 50%; }
.deal-tick.deal-tick-check { border-radius: 7px; }
.deal-opt.on .deal-tick { border-color: var(--orange); background: var(--orange); }
.deal-opt.on .deal-tick::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.deal-counter { flex: 0 0 auto; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.deal-counter button { width: 36px; height: 36px; border: 0; background: none; color: var(--text); font: inherit; font-size: 18px; cursor: pointer; }
.deal-counter button:disabled { color: var(--muted); opacity: 0.5; cursor: not-allowed; }
.deal-counter span { min-width: 22px; text-align: center; font-weight: 700; }
.deal-opt.on .deal-counter { border-color: var(--orange); }
.deal-saving { margin: 14px 0 4px; font-size: 13px; font-weight: 600; color: var(--green); }

/* ---- Deals D2: today's rules (sold out, few left, order types, the customer's limit) ---- */
.deal-low { display: block; font-size: 12px; font-weight: 700; color: var(--orange); margin-top: 4px; }
p.deal-low { margin: 8px 0 0; font-size: 13px; }
.deal-when.deal-type { color: var(--muted); }
.deal-unavailable.deal-type { background: color-mix(in srgb, var(--orange) 10%, transparent); }
.deal-line-note {
  margin: 6px 0 2px; padding: 6px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 600; line-height: 1.4;
  color: var(--text); background: color-mix(in srgb, var(--orange) 12%, transparent);
  border-inline-start: 3px solid var(--orange);
}

/* ---- Deals D2: the deal detector in the cart (one suggestion at a time) ---- */
#dealDetect:empty { display: none; }
.deal-detect {
  display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: start;
  margin: 14px 0 6px; padding: 14px; border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 12%, var(--card)) 0%, var(--card) 75%);
  color: var(--text); box-shadow: var(--card-shadow);
}
.deal-detect-icon {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 16px; color: var(--gold); background: color-mix(in srgb, var(--gold) 18%, transparent);
}
.deal-detect-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.deal-detect-copy strong { font-size: 15px; line-height: 1.35; }
.deal-detect-copy small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.deal-detect-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; }
.deal-detect-actions .btn.deal-detect-switch { flex: 0 0 auto; width: auto; min-height: 40px; padding: 0 22px; }
.deal-detect-actions .deal-detect-no { color: var(--muted); font-weight: 600; }
