/* ============================================================
   RestoPOS - Customer CSS  |  Mobile-First Malaysian Theme
   ============================================================ */

:root {
  --brand-dark:   #1a0a00;
  --brand-primary:#c0392b;
  --brand-warm:   #e67e22;
  --brand-gold:   #f39c12;
  --brand-light:  #fdf6ec;
  --brand-muted:  #7f8c8d;
  --card-bg:      #ffffff;
  --shadow-sm:    0 2px 8px rgba(0,0,0,.08);
  --shadow-md:    0 4px 20px rgba(0,0,0,.12);
  --radius:       14px;
  --radius-sm:    8px;
  --font-display: 'Playfair Display', serif;
  --font-body:    'Nunito', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--brand-light);
  color: var(--brand-dark);
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ── NAVBAR ── */
.resto-nav {
  background: var(--brand-dark) !important;
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--brand-warm);
  padding: .6rem 0;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: .5px;
}

/* ── HERO BANNER ── */
.hero-banner {
  background: linear-gradient(135deg, var(--brand-dark) 0%, #3d0c02 60%, var(--brand-primary) 100%);
  color: #fff;
  padding: 2rem 1rem 3rem;
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-banner h1 { font-family: var(--font-display); }
.hero-banner .hero-badge {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50px;
  padding: .3rem .9rem;
  font-size: .8rem;
  display: inline-block;
  margin-bottom: .8rem;
}

/* ── ORDER TYPE TABS ── */
.order-type-tabs .nav-link {
  border-radius: 50px;
  padding: .5rem 1.5rem;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  transition: all .2s;
  border: 2px solid transparent;
}
.order-type-tabs .nav-link.active {
  background: var(--brand-gold);
  color: var(--brand-dark);
  border-color: var(--brand-gold);
}
.order-type-tabs .nav-link:hover:not(.active) {
  border-color: rgba(255,255,255,.3);
  color: #fff;
}

/* ── CATEGORY PILLS ── */
.cat-pills { gap: .5rem; flex-wrap: nowrap; overflow-x: auto; padding: .5rem 0; }
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  white-space: nowrap;
  border: 2px solid #e0d5c5;
  border-radius: 50px;
  padding: .4rem 1.1rem;
  font-size: .85rem;
  font-weight: 600;
  color: #666;
  background: #fff;
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}
.cat-pill.active, .cat-pill:hover {
  background: var(--brand-warm);
  border-color: var(--brand-warm);
  color: #fff;
}

/* ── MENU CARD ── */
.menu-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  border: 1px solid #f0ebe0;
}
.menu-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Real image wrapper — responsive 4:3 */
.menu-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 ratio */
  overflow: hidden;
  background: linear-gradient(135deg, #fdf6ec, #f5e6d3);
}
.menu-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.menu-card:hover .menu-card-img {
  transform: scale(1.05);
}

/* Emoji/icon placeholder (no photo) */
.menu-card .img-placeholder {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fdf6ec, #f5e6d3);
  font-size: 3rem;
  color: var(--brand-warm);
}

.menu-card .card-body { padding: .85rem; }
.menu-card .item-name { font-weight: 700; font-size: .93rem; line-height: 1.3; margin-bottom: .2rem; }
.menu-card .item-desc { font-size: .76rem; color: var(--brand-muted); margin: .25rem 0; line-height: 1.4; }
.menu-card .item-price { color: var(--brand-primary); font-weight: 800; font-size: 1rem; }
.menu-card .item-meta  { font-size: .72rem; color: var(--brand-muted); margin-top: .25rem; }

/* Featured badge */
.badge-featured {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: var(--brand-gold);
  color: var(--brand-dark);
  font-size: .68rem; padding: .2rem .55rem;
  border-radius: 50px; font-weight: 700;
}

/* ── QTY WIDGET ── */
.qty-widget { display: flex; align-items: center; }

/* Plain "+" add button (qty = 0) */
.btn-add-round {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brand-warm);
  color: #fff;
  border: none;
  font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .18s, transform .15s;
  flex-shrink: 0;
}
.btn-add-round:hover   { background: var(--brand-primary); transform: scale(1.1); }
.btn-add-round:active  { transform: scale(.93); }

/* Pill with − qty + (qty > 0) */
.qty-pill {
  display: flex;
  align-items: center;
  background: var(--brand-dark);
  border-radius: 50px;
  padding: 2px;
  gap: 0;
}
.qbtn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none; background: transparent;
  color: #fff; font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 1;
  transition: background .15s;
  flex-shrink: 0;
}
.qbtn:hover  { background: rgba(255,255,255,.15); }
.qbtn:active { background: rgba(255,255,255,.25); }
.qnum {
  min-width: 22px;
  text-align: center;
  color: #fff;
  font-weight: 800;
  font-size: .88rem;
  user-select: none;
  padding: 0 2px;
}

/* ── CART ── */
.cart-item {
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid #f0ebe0;
  padding: .85rem;
  margin-bottom: .6rem;
}
.qty-control {
  display: flex; align-items: center; gap: .5rem;
}
.qty-control button {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid #ddd;
  background: #fff;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  cursor: pointer;
}
.qty-control button:hover { border-color: var(--brand-warm); background: var(--brand-warm); color: #fff; }
.qty-control .qty-num { min-width: 24px; text-align: center; font-weight: 700; }

/* ── ORDER SUMMARY ── */
.order-summary-card {
  background: var(--brand-dark);
  border-radius: var(--radius);
  color: #fff;
  padding: 1.2rem;
}
.order-summary-card .label { color: rgba(255,255,255,.7); font-size: .85rem; }
.order-summary-card .value { font-weight: 700; }
.order-summary-card .total-row { border-top: 1px solid rgba(255,255,255,.2); padding-top: .8rem; margin-top: .8rem; }
.order-summary-card .total-amount { font-family: var(--font-display); font-size: 1.5rem; color: var(--brand-gold); }

/* ── ORDER TYPE SELECTOR ── */
.order-type-card {
  border: 3px solid #e0d5c5;
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fff;
}
.order-type-card:hover, .order-type-card.selected {
  border-color: var(--brand-warm);
  background: #fff9f3;
}
.order-type-card.selected { border-color: var(--brand-warm); box-shadow: 0 0 0 3px rgba(230,126,34,.15); }
.order-type-card i { font-size: 2.2rem; color: var(--brand-warm); margin-bottom: .5rem; }
.order-type-card h6 { font-weight: 700; margin-bottom: .3rem; }

/* ── PAYMENT QR ── */
.qr-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  text-align: center;
  border: 2px solid #f0ebe0;
}
.qr-card .qr-img { max-width: 220px; border: 4px solid var(--brand-gold); border-radius: var(--radius-sm); }

/* ── STATUS TRACKER ── */
.status-steps { display: flex; justify-content: space-between; position: relative; }
.status-steps::before {
  content: ''; position: absolute; top: 20px; left: 0; right: 0; height: 2px;
  background: #e0d5c5; z-index: 0;
}
.status-step { flex: 1; text-align: center; position: relative; z-index: 1; }
.status-step .step-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: #e0d5c5; color: #999;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .4rem; font-size: .9rem;
  transition: all .3s;
}
.status-step.done .step-icon { background: #27ae60; color: #fff; }
.status-step.active .step-icon { background: var(--brand-warm); color: #fff; box-shadow: 0 0 0 4px rgba(230,126,34,.2); }
.status-step .step-label { font-size: .72rem; font-weight: 600; color: #999; }
.status-step.done .step-label, .status-step.active .step-label { color: var(--brand-dark); }

/* ── FORM ── */
.form-control, .form-select {
  border: 2px solid #e8e0d4;
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  font-family: var(--font-body);
  transition: border-color .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-warm);
  box-shadow: 0 0 0 3px rgba(230,126,34,.1);
}
.btn-primary {
  background: var(--brand-warm);
  border-color: var(--brand-warm);
  font-weight: 700;
  border-radius: var(--radius-sm);
}
.btn-primary:hover { background: var(--brand-primary); border-color: var(--brand-primary); }
.btn-danger { border-radius: var(--radius-sm); }

/* ── TABLE BADGE ── */
.table-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: linear-gradient(135deg, var(--brand-warm), var(--brand-gold));
  color: #fff; border-radius: 50px;
  padding: .35rem 1rem; font-size: .85rem; font-weight: 700;
}

/* ── BOTTOM CART / CHECKOUT BAR ── */
.cart-bottom-bar,
.checkout-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: var(--brand-dark);
  padding: .75rem 1rem;
  border-top: 3px solid var(--brand-gold);
  box-shadow: 0 -4px 20px rgba(0,0,0,.22);
}

/* ── SHOP ALERT BANNER (closed / busy) ── */
.shop-alert-banner {
  position: sticky;
  top: 56px;
  z-index: 895;
  border-bottom: 3px solid;
  animation: alertSlide .4s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes alertSlide {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: none; }
}
.shop-alert-banner.alert-closed {
  background: linear-gradient(135deg, #2c0000, #7b241c);
  border-color: #e74c3c;
  color: #fff;
}
.shop-alert-banner.alert-busy {
  background: linear-gradient(135deg, #7d5a00, #b7770d);
  border-color: #f39c12;
  color: #fff;
}
.shop-alert-icon {
  font-size: 2rem;
  flex-shrink: 0;
  margin-top: .1rem;
}
.shop-alert-title {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: .25rem;
}
.shop-alert-msg {
  font-size: .85rem;
  opacity: .88;
  line-height: 1.4;
}

/* ── LOCKED ADD BUTTON (orders disabled) ── */
.btn-add-locked {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #e0d5c5;
  color: #bbb;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  cursor: not-allowed;
  flex-shrink: 0;
}

/* ── SOUND UNLOCK BANNER ── */
.sound-unlock-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9990;
  background: linear-gradient(135deg, #1a0a00, #2c1200);
  border-top: 3px solid var(--brand-gold);
  color: #fff;
  animation: slideUpBanner .4s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes slideUpBanner {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ── UTILITIES ── */
.text-rm { color: var(--brand-primary); }
.bg-brand-light { background: var(--brand-light); }
.rounded-xl { border-radius: var(--radius) !important; }
.section-title { font-family: var(--font-display); font-size: 1.4rem; color: var(--brand-dark); }

/* ── RESPONSIVE ── */
@media (min-width: 768px) {
  .menu-img-wrap   { padding-top: 68%; }       /* slightly less tall on tablet */
  .hero-banner     { padding: 3rem 2rem 4rem; }
}
@media (min-width: 992px) {
  body { padding-bottom: 0; }
  .cart-bottom-bar,
  .checkout-bar { display: none; }             /* desktop: no sticky bar needed */
}

/* ══════════════════════════════════════════════════════════
   ORDER-READY POPUP NOTIFICATION
   Full-screen modal with animated bell, melody, countdown.
══════════════════════════════════════════════════════════ */

/* ── Backdrop overlay ── */
.ordy-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(10, 4, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── Popup card ── */
.ordy-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;       /* let clicks pass to buttons inside */
}
.ordy-popup > * { pointer-events: auto; }

/* Inner card */
.ordy-popup::after { display: none; }   /* no pseudo-content */

.ordy-body {
  background: #fff;
  border-radius: 24px;
  padding: 2rem 1.5rem 1.5rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.08);
  animation: ordySlideUp .45s cubic-bezier(.34,1.56,.64,1) both;
  overflow: hidden;
}
@keyframes ordySlideUp {
  from { opacity: 0; transform: translateY(40px) scale(.94); }
  to   { opacity: 1; transform: none; }
}

/* Top green bar */
.ordy-body::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, #27ae60, #2ecc71, #f39c12, #27ae60);
  background-size: 200% 100%;
  animation: ordyBarShimmer 2s linear infinite;
}
@keyframes ordyBarShimmer {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* ── Bell animation wrapper ── */
.ordy-bell-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 1.25rem;
}

/* Ripple rings */
.ordy-ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid #27ae60;
  animation: ordyRipple 2.4s ease-out infinite;
}
.ordy-ripple-1 { animation-delay: 0s; }
.ordy-ripple-2 { animation-delay: .6s; }
.ordy-ripple-3 { animation-delay: 1.2s; }
@keyframes ordyRipple {
  0%   { transform: scale(1);   opacity: .7; }
  100% { transform: scale(2.1); opacity: 0;  }
}

/* Circle behind bell */
.ordy-bell-circle {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(39,174,96,.45);
}

/* Bell icon itself */
#ordyBellIcon {
  font-size: 2.2rem;
  color: #fff;
  animation: ordyBellSwing 0.5s ease-in-out infinite alternate;
  transform-origin: top center;
  display: block;
}
@keyframes ordyBellSwing {
  0%   { transform: rotate(-18deg); }
  100% { transform: rotate(18deg);  }
}

/* ── Text content ── */
.ordy-tag {
  display: inline-block;
  background: #d4edda;
  color: #1a7a3f;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  border-radius: 50px;
  padding: .2rem .8rem;
  margin-bottom: .6rem;
}

.ordy-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--brand-dark);
  margin-bottom: .4rem;
  line-height: 1.2;
}

.ordy-subtitle {
  color: #555;
  font-size: .9rem;
  margin-bottom: .9rem;
  line-height: 1.4;
}

/* Dish name shown for per-item notifications */
.ordy-item-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-dark);
  background: linear-gradient(135deg, #f0fff4, #d4edda);
  border: 2px solid #27ae60;
  border-radius: 10px;
  padding: .5rem 1rem;
  margin-bottom: .7rem;
  line-height: 1.3;
}

/* PICK UP button — big green CTA for per-item pickup confirmation */
.ordy-btn-pickup {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #1a7a3f, #27ae60);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: .9rem 1.5rem;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 6px 20px rgba(39,174,96,.45);
  animation: pickupPulse 1.8s ease-in-out infinite;
  letter-spacing: .3px;
}
.ordy-btn-pickup:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(39,174,96,.55);
  animation: none;
}
.ordy-btn-pickup:active { transform: scale(.97); }
.ordy-btn-pickup:disabled {
  background: #95a5a6;
  animation: none;
  box-shadow: none;
  cursor: default;
}
@keyframes pickupPulse {
  0%,100% { box-shadow: 0 6px 20px rgba(39,174,96,.45); }
  50%      { box-shadow: 0 6px 30px rgba(39,174,96,.75); }
}

/* Order number */
.ordy-order-num {
  font-size: 1.9rem;
  font-weight: 900;
  font-family: var(--font-display);
  color: var(--brand-primary);
  letter-spacing: 1px;
  margin-bottom: .6rem;
}

/* Type badge (Takeaway / Dine-In) */
.ordy-type-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border-radius: 50px;
  padding: .35rem 1rem;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  background: rgba(109,40,217,.12);
  color: #6d28d9;
}

/* ── Buttons ── */
.ordy-actions {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-bottom: .8rem;
}

.ordy-btn-primary {
  display: block;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: #fff;
  border-radius: 50px;
  padding: .75rem 1.5rem;
  font-weight: 800;
  font-size: .95rem;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 16px rgba(39,174,96,.35);
}
.ordy-btn-primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(39,174,96,.45);
}
.ordy-btn-primary:active { transform: scale(.97); }

.ordy-btn-dismiss {
  background: transparent;
  border: 2px solid #ddd;
  border-radius: 50px;
  padding: .55rem 1.5rem;
  color: #888;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.ordy-btn-dismiss:hover { border-color: #bbb; color: #555; }

/* ── Sound toggle ── */
.ordy-sound-toggle {
  margin-top: .25rem;
}
.ordy-sound-toggle button {
  background: none;
  border: none;
  color: #aaa;
  font-size: .78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .5rem;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.ordy-sound-toggle button:hover { color: #555; background: #f5f5f5; }

/* ── Countdown progress bar ── */
.ordy-countdown-track {
  width: 100%;
  height: 4px;
  background: #f0f0f0;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
  margin-top: .5rem;
}
.ordy-countdown-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #27ae60, #2ecc71);
  border-radius: inherit;
  transition: width 50ms linear;
}

/* ── Floating badge (after dismiss) ── */
.ordy-float-badge {
  position: fixed;
  bottom: 90px;
  right: 1rem;
  z-index: 9997;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: #fff;
  border-radius: 50px;
  padding: .55rem 1.1rem;
  font-size: .85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(39,174,96,.4);
  animation: ordyFloat 3s ease-in-out infinite;
  transition: transform .15s;
}
.ordy-float-badge:hover { transform: scale(1.06); }
.ordy-float-bell {
  animation: ordyBellSwing 0.6s ease-in-out infinite alternate;
  transform-origin: top center;
  display: inline-block;
}
@keyframes ordyFloat {
  0%,100% { box-shadow: 0 6px 20px rgba(39,174,96,.4); }
  50%      { box-shadow: 0 10px 32px rgba(39,174,96,.6); }
}

/* ── Mobile adjustments ── */
@media (max-width: 400px) {
  .ordy-title    { font-size: 1.3rem; }
  .ordy-order-num{ font-size: 1.5rem; }
  .ordy-body     { padding: 1.5rem 1rem 1rem; }
}
@media (min-width: 992px) {
  .ordy-float-badge { bottom: 1.5rem; }
}
