/* Mukesh Brothers — mobile bottom dock (GSAP + Lottie) */

:root {
  --mb-nav-h: 72px;
  --mb-nav-safe: env(safe-area-inset-bottom, 0px);
  --mb-nav-total: calc(var(--mb-nav-h) + var(--mb-nav-safe) + 12px);
  --mb-nav-bg: rgba(255, 252, 247, 0.82);
  --mb-nav-border: rgba(21, 128, 61, 0.14);
  --mb-nav-accent: #15803d;
  --mb-nav-accent-soft: rgba(21, 128, 61, 0.14);
  --mb-nav-ink: #1c1917;
  --mb-nav-muted: #78716c;
  --mb-nav-glow: rgba(21, 128, 61, 0.35);
  --mb-nav-cart: #ea580c;
}

@media (min-width: 992px) {
  .mb-bottom-dock,
  #bottom-tracking-bar.mb-track-v2 {
    display: none !important;
  }
}

body.mb-has-bottom-dock {
  padding-bottom: var(--mb-nav-total);
}

.mb-bottom-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  padding: 0 10px calc(6px + var(--mb-nav-safe));
  pointer-events: none;
  visibility: visible;
}

.mb-bottom-dock.is-hidden {
  pointer-events: none;
}

.mb-bottom-dock__shell {
  pointer-events: auto;
  max-width: 440px;
  margin: 0 auto;
  position: relative;
}

.mb-bottom-dock__glow {
  position: absolute;
  inset: -8px -4px 0;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, var(--mb-nav-glow), transparent 70%);
  opacity: 0.55;
  filter: blur(12px);
  pointer-events: none;
}

.mb-bottom-dock__bar {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 2px;
  min-height: var(--mb-nav-h);
  padding: 8px 6px 6px;
  border-radius: 22px 22px 18px 18px;
  background: var(--mb-nav-bg);
  border: 1px solid var(--mb-nav-border);
  box-shadow:
    0 -2px 0 rgba(255, 255, 255, 0.9) inset,
    0 12px 40px rgba(28, 25, 23, 0.14),
    0 4px 16px rgba(28, 25, 23, 0.08);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  overflow: visible;
}

.mb-bottom-dock__indicator {
  position: absolute;
  top: 6px;
  left: 0;
  width: 25%;
  height: calc(100% - 12px);
  border-radius: 16px;
  background: linear-gradient(145deg, #ffffff 0%, var(--mb-nav-accent-soft) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 8px 20px rgba(21, 128, 61, 0.12);
  border: 1px solid rgba(21, 128, 61, 0.12);
  z-index: 0;
  will-change: transform, width;
  pointer-events: none;
}

.mb-dock-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 4px 2px 2px;
  min-height: 56px;
  text-decoration: none;
  color: var(--mb-nav-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.2s ease;
}

.mb-dock-item:focus-visible {
  outline: 2px solid var(--mb-nav-accent);
  outline-offset: 2px;
  border-radius: 14px;
}

.mb-dock-item.is-active {
  color: var(--mb-nav-ink);
}

.mb-dock-item.is-disabled {
  opacity: 0.42;
  pointer-events: none;
}

.mb-dock-item__icon-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.mb-dock-item__svg {
  width: 26px;
  height: 26px;
  display: block;
  color: var(--mb-nav-muted);
  transition: color 0.25s ease;
}

.mb-dock-item.is-active .mb-dock-item__svg {
  color: var(--mb-nav-accent);
}

.mb-dock-item__svg-path {
  vector-effect: non-scaling-stroke;
}

.mb-dock-item__ripple {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mb-nav-accent-soft);
  opacity: 0;
  pointer-events: none;
}

.mb-dock-item__label {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform-origin: center bottom;
}

.mb-dock-item.is-active .mb-dock-item__label {
  font-weight: 700;
  color: var(--mb-nav-accent);
}

/* Elevated cart tab */
.mb-dock-item--cart .mb-dock-item__icon-wrap {
  width: 48px;
  height: 48px;
  margin-top: -18px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fb923c 0%, var(--mb-nav-cart) 55%, #c2410c 100%);
  box-shadow:
    0 10px 24px rgba(234, 88, 12, 0.42),
    0 0 0 3px rgba(255, 252, 247, 0.95);
}

.mb-dock-item--cart .mb-dock-item__svg {
  color: #fff;
}

.mb-dock-item--cart.is-active .mb-dock-item__svg {
  color: #fff;
}

.mb-dock-item--cart.is-active .mb-dock-item__label {
  color: var(--mb-nav-cart);
}

/* Live order: Cart tab becomes Track (Swiggy-style) */
.mb-dock-item--cart.is-track-mode .mb-dock-item__icon-wrap {
  background: linear-gradient(145deg, #34d399 0%, #059669 55%, #047857 100%);
  box-shadow:
    0 10px 24px rgba(5, 150, 105, 0.4),
    0 0 0 3px rgba(255, 252, 247, 0.95);
}

.mb-dock-item--cart.is-track-mode .mb-dock-item__label {
  color: #047857;
  font-weight: 700;
}

.mb-dock-item--cart.is-track-mode.is-active .mb-dock-item__label {
  color: #047857;
}

.mb-dock-item--cart.is-track-mode .mb-dock-item__badge {
  display: none !important;
}

.mb-dock-item__live-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fef3c7;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 0 rgba(254, 243, 199, 0.7);
  animation: mb-dock-live-pulse 1.6s ease-out infinite;
}

.mb-dock-item__live-dot[hidden] {
  display: none !important;
}

@keyframes mb-dock-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(254, 243, 199, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(254, 243, 199, 0); }
  100% { box-shadow: 0 0 0 0 rgba(254, 243, 199, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .mb-dock-item__live-dot {
    animation: none;
  }
}

.mb-dock-item--planner.is-active .mb-dock-item__svg {
  color: #7c3aed;
}

.mb-dock-item--planner.is-active .mb-dock-item__label {
  color: #6d28d9;
}

.mb-dock-item__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.45);
  transform: scale(0);
  opacity: 0;
}

.mb-dock-item__badge.is-visible {
  transform: scale(1);
  opacity: 1;
}

/* Live order strip */
#bottom-tracking-bar.mb-track-v2 {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--mb-nav-total) - 4px);
  max-width: 416px;
  margin: 0 auto;
  z-index: 1002;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(125deg, #14532d 0%, #15803d 42%, #0f172a 100%);
  color: #fafaf9;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

#bottom-tracking-bar.mb-track-v2.is-visible {
  display: flex;
}

#bottom-tracking-bar.mb-track-v2 .tracking-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #bbf7d0;
  font-weight: 700;
}

#bottom-tracking-bar.mb-track-v2 .tracking-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#bottom-tracking-bar.mb-track-v2 .tracking-sub {
  font-size: 11px;
  color: #d6d3d1;
}

#bottom-tracking-bar.mb-track-v2 .tracking-cta {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 800;
  background: #facc15;
  color: #1c1917;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .mb-bottom-dock__indicator,
  .mb-dock-item__label,
  .mb-dock-item__badge {
    transition: none !important;
  }
}
