/* Shared WhatsApp ordering demo for the intralogix.ai pages: phone, chat, sheets, controls.
   The chat keeps WhatsApp's own colours so it reads as WhatsApp; the controls under the phone
   take the page's --ink, --ink-soft and --bg. Add .wa-dark or .wa-light to pin the chat's look. */

.ilx-demo {
  --wa-wall: #EFE7DD;
  --wa-dots: rgba(102, 119, 129, .16);
  --wa-in: #FFFFFF;
  --wa-out: #D9FDD3;
  --wa-text: #111B21;
  --wa-meta: #667781;
  --wa-bar: #F0F2F5;
  --wa-btn: #027EB5;
  --wa-tick: #53BDEB;
  --wa-sys: #FFFFFF;
  --wa-sheet: #FFFFFF;
  --wa-line: rgba(102, 119, 129, .24);
  --wa-green: #1DAA61;
  --wa-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --phone-frame: #160A18;
  --phone-w: 360px;
  --chat-h: 470px;
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ilx-demo:not(.wa-light) {
    --wa-wall: #0B141A; --wa-dots: rgba(134, 150, 160, .10); --wa-in: #202C33; --wa-out: #005C4B;
    --wa-text: #E9EDEF; --wa-meta: #8696A0; --wa-bar: #202C33; --wa-btn: #53BDEB; --wa-sys: #182229;
    --wa-sheet: #233138; --wa-line: rgba(134, 150, 160, .22); --wa-green: #21C063; --phone-frame: #0D0610;
  }
}
:root[data-theme="dark"] .ilx-demo:not(.wa-light),
.ilx-demo.wa-dark {
  --wa-wall: #0B141A; --wa-dots: rgba(134, 150, 160, .10); --wa-in: #202C33; --wa-out: #005C4B;
  --wa-text: #E9EDEF; --wa-meta: #8696A0; --wa-bar: #202C33; --wa-btn: #53BDEB; --wa-sys: #182229;
  --wa-sheet: #233138; --wa-line: rgba(134, 150, 160, .22); --wa-green: #21C063; --phone-frame: #0D0610;
}

/* ───────── Phone ───────── */
.ilx-demo .phone {
  position: relative;
  width: min(var(--phone-w), 100%);
  padding: 10px;
  border-radius: 38px;
  background: var(--phone-frame);
  box-shadow: 0 30px 60px -24px rgba(22, 10, 24, .55), inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.ilx-demo .screen {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 28px;
  background: var(--wa-wall);
  font-family: var(--wa-font);
}
.ilx-demo .phone-bar { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; background: var(--wa-bar); color: var(--wa-text); }
.ilx-demo .avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #F3664B; color: #3A1B3D; font: 700 .8rem/1 var(--wa-font); }
.ilx-demo .who { display: grid; line-height: 1.2; font-size: .95rem; }
.ilx-demo .who small { color: var(--wa-meta); font-size: .75rem; }

/* ───────── Chat ───────── */
.ilx-demo .chat {
  height: var(--chat-h);
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 10px;
  background-color: var(--wa-wall);
  background-image: radial-gradient(var(--wa-dots) 1px, transparent 1.2px);
  background-size: 14px 14px;
  color: var(--wa-text);
  font-size: .84rem;
  line-height: 1.35;
}
.ilx-demo .chat::-webkit-scrollbar { display: none; }
.ilx-demo .chat > :first-child { margin-top: auto; }

.ilx-demo .msg {
  position: relative;
  flex: none;
  max-width: 84%;
  padding: 6px 9px 5px;
  border-radius: 9px;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .13);
  overflow-wrap: anywhere;
}
.ilx-demo .msg p { margin: 0; }
.ilx-demo .msg p::after { content: ""; display: block; clear: both; }
.ilx-demo .msg time { float: right; margin: 6px 0 -2px 10px; font-size: .66rem; line-height: 1; color: var(--wa-meta); }
.ilx-demo .msg.in { align-self: flex-start; background: var(--wa-in); border-top-left-radius: 2px; }
.ilx-demo .msg.out { align-self: flex-end; background: var(--wa-out); border-top-right-radius: 2px; }
.ilx-demo .msg.out time::after { content: " ✓✓"; color: var(--wa-tick); letter-spacing: -2px; }

.ilx-demo .wa-btns { display: grid; margin: 7px -9px -5px; border-top: 1px solid var(--wa-line); }
.ilx-demo .wa-btn {
  appearance: none;
  margin: 0;
  width: 100%;
  padding: 9px 8px;
  border: 0;
  border-bottom: 1px solid var(--wa-line);
  border-radius: 0;
  background: none;
  color: var(--wa-btn);
  font: 500 .84rem/1.2 var(--wa-font);
  text-align: center;
  cursor: pointer;
  transition: background-color .15s ease;
}
.ilx-demo .wa-btn:last-child { border-bottom: 0; border-radius: 0 0 9px 9px; }
.ilx-demo .wa-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--wa-btn) 9%, transparent); }
.ilx-demo .wa-btn:disabled { cursor: default; opacity: .6; }
.ilx-demo .wa-btn.pressed { background: color-mix(in srgb, var(--wa-btn) 22%, transparent); opacity: 1; }
.ilx-demo .wa-btn:focus-visible { outline: 2px solid var(--wa-btn); outline-offset: -3px; }
.ilx-demo .wa-list::before { content: "☰  "; }
.ilx-demo .wa-location::before { content: "📍 "; }
.ilx-demo .wa-cta::after { content: "  ↗"; }

.ilx-demo .sys {
  align-self: center;
  flex: none;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--wa-sys);
  color: var(--wa-meta);
  font-size: .7rem;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .1);
}
.ilx-demo .sys.end button {
  appearance: none; border: 0; background: none; padding: 0; margin: 0;
  color: var(--wa-btn); font: 600 .7rem var(--wa-font); cursor: pointer; text-decoration: underline;
}

.ilx-demo .pin-map {
  display: block;
  width: 190px;
  max-width: 100%;
  height: 78px;
  margin-bottom: 6px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 44%, #EA4335 0 6px, transparent 7px),
    linear-gradient(115deg, transparent 44%, #F7D774 44% 49%, transparent 49%),
    linear-gradient(20deg, transparent 58%, #FFFFFF 58% 62%, transparent 62%),
    #CFE6C8;
}

.ilx-demo .typing {
  align-self: flex-start;
  flex: none;
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--wa-in);
  box-shadow: 0 1px .5px rgba(11, 20, 26, .13);
}
.ilx-demo .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--wa-meta); animation: ilxBlink 1s infinite; }
.ilx-demo .typing i:nth-child(2) { animation-delay: .15s; }
.ilx-demo .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ilxBlink { 50% { opacity: .25; transform: translateY(-2px); } }

.ilx-demo .enter { animation: ilxIn .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ilxIn { from { transform: translateY(10px) scale(.98); opacity: .2; } to { transform: none; opacity: 1; } }

/* ───────── Input bar ───────── */
.ilx-demo .phone-input { display: flex; align-items: center; gap: 8px; padding: 9px 10px 12px; background: var(--wa-bar); }
.ilx-demo .phone-input .wa-field {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--wa-in);
  color: var(--wa-text);
  font-size: .84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ilx-demo .phone-input .ph { color: var(--wa-meta); }
.ilx-demo .typed:not(:empty) + .ph { display: none; }
.ilx-demo .typed:not(:empty)::after { content: ""; display: inline-block; width: 1px; height: 1em; margin-left: 1px; vertical-align: -2px; background: var(--wa-btn); animation: ilxCaret 1s steps(1) infinite; }
@keyframes ilxCaret { 50% { opacity: 0; } }
.ilx-demo .send { position: relative; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--wa-green); }
.ilx-demo .send::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 11px;
  border-left: 11px solid #FFFFFF;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

/* ───────── Bottom sheets (list picker, payment) ───────── */
.ilx-demo .screen-dim { position: absolute; inset: 0; z-index: 2; background: rgba(11, 20, 26, .45); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.ilx-demo .screen.dimmed .screen-dim { opacity: 1; pointer-events: auto; }
.ilx-demo .sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  max-height: 80%;
  overflow-y: auto;
  padding: 6px 0 16px;
  border-radius: 18px 18px 0 0;
  background: var(--wa-sheet);
  color: var(--wa-text);
  transform: translateY(105%);
  visibility: hidden;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s;
}
.ilx-demo .sheet.open { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.ilx-demo .sheet-grip { width: 36px; height: 4px; margin: 4px auto 8px; border-radius: 4px; background: var(--wa-line); }
.ilx-demo .sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 8px 16px; font-size: .95rem; }
.ilx-demo .sheet-x { appearance: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--wa-meta); font-size: 1.35rem; line-height: 1; cursor: pointer; }
.ilx-demo .sheet-row {
  appearance: none;
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 11px 16px;
  border: 0;
  border-top: 1px solid var(--wa-line);
  background: none;
  color: var(--wa-text);
  font: .88rem/1.3 var(--wa-font);
  text-align: left;
  cursor: pointer;
}
.ilx-demo .sheet-row small { display: block; color: var(--wa-meta); font-size: .76rem; }
.ilx-demo .sheet-row:hover { background: color-mix(in srgb, var(--wa-btn) 8%, transparent); }
.ilx-demo .sheet-row:focus-visible, .ilx-demo .sheet-x:focus-visible, .ilx-demo .pay-go:focus-visible { outline: 2px solid var(--wa-btn); outline-offset: -3px; }
.ilx-demo .pay { display: grid; justify-items: center; gap: 6px; padding: 8px 18px 4px; text-align: center; }
.ilx-demo .pay-to, .ilx-demo .pay-note { color: var(--wa-meta); font-size: .8rem; }
.ilx-demo .pay-amt { font-size: 1.9rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ilx-demo .pay-go {
  appearance: none;
  width: 100%;
  margin-top: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--wa-green);
  color: #FFFFFF;
  font: 600 .92rem/1 var(--wa-font);
  cursor: pointer;
}
.ilx-demo .pay-go.pressed { filter: brightness(.9); }
.ilx-demo .pay-ok { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--wa-green); color: #FFFFFF; font-size: 1.4rem; animation: ilxPop .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ilxPop { from { transform: scale(.4); } to { transform: none; } }

/* ───────── Controls under the phone ───────── */
.ilx-demo .demo-controls {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--ink, #3A1B3D) 24%, transparent);
  border-radius: 999px;
}
.ilx-demo .demo-controls button {
  appearance: none;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink, #3A1B3D);
  font: 600 .88rem/1 var(--font-display, inherit);
  cursor: pointer;
}
.ilx-demo .demo-controls button[aria-pressed="true"] { background: var(--ink, #3A1B3D); color: var(--bg, #FBF1EF); }
.ilx-demo .demo-controls button:focus-visible { outline: 2px solid var(--accent, #F3664B); outline-offset: 2px; }
.ilx-demo .demo-hint { max-width: 36ch; min-height: 2.7em; margin: 0; color: var(--ink-soft, #6E5570); font-size: .82rem; line-height: 1.35; text-align: center; }

@media (max-width: 560px) {
  .ilx-demo { --chat-h: 430px; }
}
@media (prefers-reduced-motion: reduce) {
  .ilx-demo *, .ilx-demo *::before, .ilx-demo *::after { animation: none !important; transition: none !important; }
}
