/* ==========================================================================
   El Tokhey Cafe — playful kids/cartoon theme (matches the teddy-bear logo)
   Palette: white/off-white bg, sky-blue primary, peach accent, mint secondary,
   bear-tan warm tone, blue-grey text. RTL Arabic. Bright, bubbly, friendly.
   ========================================================================== */

:root {
  --bg:        #ffffff;
  --bg-soft:   #fbf8f4;
  --primary:   #7fb3e6;
  --primary-d: #5b95d1;
  --accent:    #f2a45c;
  --accent-d:  #e08b3d;
  --mint:      #a8d8c0;
  --mint-d:    #7cc0a1;
  --tan:       #e6c396;
  --text:      #4a5b7a;
  --muted:     #8a97b0;
  --line:      #eadfd0;
  --card:      #ffffff;
  --danger:    #e57373;
  --danger-d:  #d84c4c;
  --ok:        #6bbf8a;
  --radius:    22px;
  --radius-lg: 30px;
  --shadow:    0 10px 30px rgba(91,149,209,.12);
  --shadow-sm: 0 4px 14px rgba(91,149,209,.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(168,216,192,.18), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(242,164,92,.16), transparent 40%),
    var(--bg-soft);
  color: var(--text);
  font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  min-height: 100%;
  line-height: 1.6;
}

body { padding-bottom: 40px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.cafe-header {
  text-align: center;
  padding: 26px 16px 14px;
}
.cafe-logo {
  max-width: 168px;
  max-height: 168px;
  width: auto;
  height: auto;
  margin: 0 auto 6px;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(91,149,209,.20));
}
.cafe-logo-fallback {
  font-size: 34px;
  font-weight: 800;
  color: var(--primary-d);
  letter-spacing: -.5px;
  margin: 6px 0;
}
.cafe-tagline {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}
.cafe-tagline .star { color: var(--accent); }

/* ---------- Banners ---------- */
.banner {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 6px 0 18px;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.banner-closed {
  background: #fdece5;
  color: var(--accent-d);
  border: 1.5px dashed var(--accent);
}
.banner-note {
  background: #eef6fd;
  color: var(--primary-d);
  border: 1.5px solid #d7e8f8;
  font-weight: 600;
  font-size: 14px;
}

/* ---------- Section headings ---------- */
.cat-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-d);
  margin: 26px 4px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cat-title::before { content: "☕"; font-size: 18px; }

/* ---------- Menu grid ---------- */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.menu-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.menu-card.in-cart {
  border-color: var(--primary);
  box-shadow: 0 8px 22px rgba(127,179,230,.22);
}
.menu-card .m-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  object-fit: cover;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #eef6fd, #f3ece1);
}
.menu-card .m-img-svg {
  object-fit: contain;
  padding: 10px;
  background: linear-gradient(135deg, #eef6fd, #f6ede0);
}
.menu-card .m-img-ph {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #eef6fd, #f6ede0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.menu-card .m-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 2px;
}
.menu-card .m-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  min-height: 0;
}
.menu-card .m-price {
  font-weight: 800;
  color: var(--accent-d);
  font-size: 15px;
  margin-bottom: 10px;
}
.menu-card .m-price small { font-weight: 600; font-size: 12px; color: var(--muted); }
.menu-card .m-foot { margin-top: auto; }

/* qty stepper */
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 5px;
  border: 1.5px solid var(--line);
}
.stepper button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, transform .1s ease;
}
.stepper button:hover { background: var(--primary-d); }
.stepper button:active { transform: scale(.92); }
.stepper button:disabled { opacity: .4; cursor: default; }
.stepper button.minus { background: var(--tan); }
.stepper button.minus:hover { background: #d9b27f; }
.stepper .q { font-weight: 800; font-size: 16px; min-width: 22px; text-align: center; color: var(--text); }

.add-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  padding: 10px;
  cursor: pointer;
  transition: background .12s ease, transform .1s ease;
}
.add-btn:hover { background: var(--primary-d); }
.add-btn:active { transform: scale(.97); }

/* ---------- Cart ---------- */
.cart {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin: 26px 0 18px;
  box-shadow: var(--shadow);
}
.cart h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-d);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.cart-line:last-of-type { border-bottom: none; }
.cart-line .cl-name { font-weight: 600; font-size: 14px; }
.cart-line .cl-qty { color: var(--muted); font-size: 13px; margin-inline-start: 6px; }
.cart-line .cl-price { font-weight: 800; color: var(--accent-d); font-size: 14px; white-space: nowrap; }
.cart-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 10px 0; }
.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid var(--line);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.cart-total .amount { color: var(--accent-d); }

/* ---------- Form ---------- */
.form-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text);
}
.field label .req { color: var(--danger-d); }
.field input, .field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-soft);
  transition: border-color .12s ease, background .12s ease;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}
.field textarea { resize: vertical; min-height: 64px; }

.btn-pill {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 16px;
  font-family: inherit;
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .1s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn-order {
  background: linear-gradient(135deg, var(--accent), var(--accent-d));
  color: #fff;
  box-shadow: 0 10px 24px rgba(242,164,92,.32);
}
.btn-order:hover { box-shadow: 0 12px 28px rgba(242,164,92,.42); }
.btn-order:active { transform: scale(.98); }
.btn-order:disabled { opacity: .55; cursor: default; box-shadow: none; }

.btn-ghost {
  background: #fff;
  color: var(--primary-d);
  border: 1.5px solid var(--primary);
}
.btn-ghost:hover { background: #eef6fd; }

.btn-mint {
  background: linear-gradient(135deg, var(--mint), var(--mint-d));
  color: #fff;
  box-shadow: 0 8px 20px rgba(124,192,161,.30);
}

/* ---------- Confirmation card ---------- */
.confirm-card {
  background: var(--card);
  border: 2px solid var(--mint);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  text-align: center;
  box-shadow: var(--shadow);
}
.confirm-card .big-emoji { font-size: 54px; margin-bottom: 6px; }
.confirm-card h2 { font-size: 22px; font-weight: 800; color: var(--mint-d); margin: 4px 0 8px; }
.confirm-card .order-no {
  display: inline-block;
  background: var(--bg-soft);
  border: 1.5px dashed var(--primary);
  color: var(--primary-d);
  font-weight: 800;
  font-size: 18px;
  border-radius: 14px;
  padding: 8px 18px;
  margin: 6px 0 12px;
}
.confirm-card p { color: var(--text); font-size: 15px; margin: 6px 0; }
.confirm-card .total-line { font-weight: 800; font-size: 17px; color: var(--accent-d); margin: 10px 0 16px; }

/* ---------- Tracking stepper ---------- */
.track-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}
.track-head { text-align: center; margin-bottom: 18px; }
.track-head .order-no {
  display: inline-block;
  background: var(--bg-soft);
  border: 1.5px dashed var(--primary);
  color: var(--primary-d);
  font-weight: 800;
  font-size: 18px;
  border-radius: 14px;
  padding: 8px 18px;
  margin-top: 6px;
}
.stepline { margin: 6px 0; }
.tstep {
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
  position: relative;
}
.tstep:last-child { padding-bottom: 0; }
.tstep .tdot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  z-index: 1;
  background: var(--bg-soft);
  border: 2px solid var(--line);
  color: var(--muted);
}
.tstep.done .tdot { background: var(--mint); border-color: var(--mint); color: #fff; }
.tstep.active .tdot { background: var(--primary); border-color: var(--primary-d); color: #fff; animation: pulse 1.4s ease-in-out infinite; }
.tstep.rejected .tdot { background: var(--danger); border-color: var(--danger-d); color: #fff; }
.tstep .tline {
  position: absolute;
  top: 34px;
  inset-inline-start: 16px;
  width: 2px;
  height: calc(100% - 30px);
  background: var(--line);
}
.tstep.done .tline { background: var(--mint); }
.tstep:last-child .tline { display: none; }
.tstep .tlabel .t { font-weight: 700; font-size: 15px; color: var(--text); }
.tstep .tlabel .s { font-size: 13px; color: var(--muted); }
.tstep.todo .tlabel .t { color: var(--muted); font-weight: 600; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(127,179,230,.5);} 50% { box-shadow: 0 0 0 7px rgba(127,179,230,0);} }

.track-items {
  margin: 18px 0;
  padding: 14px;
  background: var(--bg-soft);
  border-radius: 16px;
}
.track-items .ti-line { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.track-items .ti-total { display: flex; justify-content: space-between; font-weight: 800; margin-top: 8px; padding-top: 8px; border-top: 1.5px dashed var(--line); color: var(--accent-d); }

.reject-box {
  background: #fdecec;
  border: 1.5px solid var(--danger);
  color: var(--danger-d);
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 14px;
  margin: 14px 0;
  text-align: center;
}

/* ---------- Misc ---------- */
.state-msg { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 15px; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 26px 0 6px;
}
.footer-note .heart { color: var(--accent); }

.hidden { display: none !important; }

/* Toast */
.toast {
  position: fixed;
  inset-inline: 0;
  bottom: 22px;
  margin: 0 auto;
  width: max-content;
  max-width: 88%;
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 420px) {
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}
