/* Subtle 3D depth and motion on top of the Uber-style theme.
   Keep paints cheap: CSS transforms/opacity only, no filters on lists. */

:root {
  --lift-1:
    0 1px 1px rgba(0, 0, 0, .04),
    0 6px 12px rgba(0, 0, 0, .06),
    0 16px 28px rgba(0, 0, 0, .08);
  --lift-2:
    0 2px 2px rgba(0, 0, 0, .05),
    0 10px 18px rgba(0, 0, 0, .08),
    0 28px 44px rgba(0, 0, 0, .12);
  --lift-press:
    0 1px 1px rgba(0, 0, 0, .06),
    0 4px 10px rgba(0, 0, 0, .1);
}

.resto-grid,
.feature-grid,
.mini-grid,
.join-row,
.menu-item,
.courier-map {
  perspective: 960px;
}

.hero-photo {
  padding: 12px 0 8px;
}
.hero-media {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 16 / 9;
  background: #e8e8e8;
  box-shadow: var(--lift-1);
  transform: rotateX(2deg) translateZ(0);
  transform-origin: 50% 100%;
  margin-bottom: 14px;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 30%, rgba(0,0,0,.62) 100%);
  pointer-events: none;
}
.hero-media .hero-copy {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 1;
  color: #fff;
}
.hero-media .hero-copy h1 {
  color: #fff;
  font-size: clamp(1.45rem, 5vw, 2rem);
  margin: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.hero-media .hero-copy .tagline {
  color: rgba(255,255,255,.9);
  margin: 6px 0 0;
  font-weight: 600;
}
.hero-photo > .lede { margin-top: 0; }

/* Cards: layered shadow + hover/tap lift */
.resto-card,
.feature-card,
.mini-card,
.menu-item,
.deal-card,
.building-card,
.order-card,
.card.incoming,
.app-shell .card {
  box-shadow: var(--lift-1);
  transform: translateZ(0);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), box-shadow .28s ease;
}
.resto-card { border-radius: 20px; overflow: hidden; }
.cover {
  height: 150px;
  background: #ececec;
}
.cover-photo,
.dish-photo,
.hero-photo-img,
.cat-ico img {
  opacity: 0;
  transition: opacity .35s ease;
}
.cover.is-ready .cover-photo,
.dish-photo-wrap.is-ready .dish-photo,
.hero-media.is-ready .hero-photo-img,
.cat-ico.is-ready img,
.cover-photo.is-ready,
.dish-photo.is-ready,
.hero-photo-img.is-ready,
.cat-ico img.is-ready {
  opacity: 1;
}
.dish-photo-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #ececec;
  box-shadow:
    0 1px 0 rgba(255,255,255,.6) inset,
    0 6px 12px rgba(0,0,0,.12);
  transform: rotateX(6deg) rotateY(-8deg) translateZ(0);
}
.dish-photo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  .resto-card:hover,
  .feature-card:hover,
  .mini-card:hover,
  .deal-card:hover,
  .building-card:hover,
  .menu-item:hover,
  .card.incoming:hover {
    transform: translateY(-7px) rotateX(4deg) scale(1.015);
    box-shadow: var(--lift-2);
  }
  .resto-card:hover .cover-photo,
  .resto-hero:hover .cover-photo {
    transform: scale(1.04);
  }
  .menu-item:hover .dish-photo-wrap {
    transform: rotateX(2deg) rotateY(-4deg) translateY(-2px) scale(1.04);
  }
}
.cover-photo {
  transition: opacity .35s ease, transform .5s ease;
  transform: scale(1);
}
.resto-card:active,
.feature-card:active,
.mini-card:active,
.menu-item:active,
.deal-card:active,
.building-card:active {
  transform: translateY(-2px) rotateX(1.5deg) scale(.99);
  box-shadow: var(--lift-press);
}

/* 3D category icons */
.chip.chip-3d {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px 0 6px;
}
.cat-ico {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #ffffff, #e6e6e6);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    inset 0 -2px 3px rgba(0,0,0,.08),
    0 3px 6px rgba(0,0,0,.14),
    0 1px 1px rgba(0,0,0,.06);
  transform: rotateX(14deg) rotateY(-10deg);
  flex-shrink: 0;
}
.cat-ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cat-ico-all {
  font-size: 14px;
  font-weight: 800;
  color: #111;
}
.chip.chip-3d.is-on .cat-ico {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.5),
    0 3px 8px rgba(0,0,0,.25);
}

/* Entrance stagger */
@keyframes card-enter {
  from { opacity: 0; transform: translateY(16px) rotateX(6deg) scale(.97); }
  to { opacity: 1; transform: translateY(0) rotateX(0) scale(1); }
}
.pop-in,
.resto-grid .resto-card,
.menu-item.pop-in {
  animation: card-enter .55s cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}
.resto-grid .resto-card:nth-child(1), .feature-grid .pop-in:nth-child(1) { --i: 0; }
.resto-grid .resto-card:nth-child(2), .feature-grid .pop-in:nth-child(2) { --i: 1; }
.resto-grid .resto-card:nth-child(3), .mini-grid .pop-in:nth-child(1) { --i: 2; }
.resto-grid .resto-card:nth-child(4), .mini-grid .pop-in:nth-child(2) { --i: 3; }
.resto-grid .resto-card:nth-child(5), .mini-grid .pop-in:nth-child(3) { --i: 4; }
.resto-grid .resto-card:nth-child(6) { --i: 5; }
.resto-grid .resto-card:nth-child(7) { --i: 6; }
.resto-grid .resto-card:nth-child(8) { --i: 7; }
.resto-grid .resto-card:nth-child(n+9) { --i: 8; }

/* Add-to-cart bounce */
@keyframes add-bounce {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.16); }
  55% { transform: scale(.92); }
  75% { transform: scale(1.06); }
}
.add-btn.is-bounce,
.qty button.is-bounce {
  animation: add-bounce .45s cubic-bezier(.22, 1, .36, 1);
}
.fly-bite {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--lift-2);
}
.fly-bite img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Skeleton shimmer */
@keyframes shimmer {
  100% { transform: translateX(100%); }
}
.skel,
.cover:not(.is-ready)::before,
.dish-photo-wrap:not(.is-ready)::before,
.hero-media:not(.is-ready)::before,
.skel-home .skel {
  position: relative;
  overflow: hidden;
  background: #ececec;
}
.cover:not(.is-ready)::before,
.dish-photo-wrap:not(.is-ready)::before,
.hero-media:not(.is-ready)::before,
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: shimmer 1.15s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
.skel-home { padding: 16px 0 32px; }
.skel-hero {
  height: 0;
  padding-bottom: 56.25%;
  border-radius: 20px;
  margin-bottom: 16px;
  box-shadow: var(--lift-1);
}
.skel-line {
  height: 14px;
  border-radius: 8px;
  margin: 8px 0;
  width: 70%;
}
.skel-line.short { width: 44%; }
.skel-card {
  height: 210px;
  border-radius: 20px;
  margin: 14px 0;
  box-shadow: var(--lift-1);
}

/* Courier map pin */
.courier-map {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 80%, #e7f0ea 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, #ececec 0%, transparent 46%),
    #f4f4f4;
  box-shadow: var(--lift-1);
  margin: 8px 0 16px;
  height: 148px;
}
.courier-map-svg { width: 100%; height: 148px; display: block; }
.courier-map .street {
  fill: none;
  stroke: #d5d5d5;
  stroke-width: 7;
  stroke-linecap: round;
}
.courier-map .street.thin { stroke-width: 3; stroke: #e2e2e2; }
.courier-map .map-route {
  fill: none;
  stroke: #111;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 6 8;
  animation: route-dash 1.2s linear infinite;
}
.courier-map .map-spot { fill: #111; }
.courier-map .map-spot-b { fill: #0BAF5E; }
.map-pin {
  offset-path: path("M28 112 C 80 112, 92 46, 160 52 S 248 108, 292 32");
  offset-distance: 0%;
  offset-rotate: 0deg;
  transition: offset-distance .8s ease;
}
.courier-map[data-phase="received"] .map-pin,
.courier-map[data-phase="preparing"] .map-pin,
.courier-map[data-phase="incoming"] .map-pin,
.courier-map[data-phase="toPickup"] .map-pin { offset-distance: 8%; }
.courier-map[data-phase="courier"] .map-pin,
.courier-map[data-phase="pickedUp"] .map-pin,
.courier-map[data-phase="toCustomer"] .map-pin {
  animation: pin-run 7s ease-in-out infinite alternate;
}
.courier-map[data-phase="delivered"] .map-pin,
.courier-map[data-phase="done"] .map-pin { offset-distance: 100%; }
@keyframes pin-run {
  from { offset-distance: 12%; }
  to { offset-distance: 92%; }
}
@keyframes route-dash { to { stroke-dashoffset: -28; } }
@keyframes pin-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.map-pin .pin-body { animation: pin-bob 1.15s ease-in-out infinite; transform-origin: 50% 100%; }
.map-pin .pin-shadow {
  fill: rgba(0,0,0,.22);
  transform-origin: 50% 50%;
  animation: pin-shadow 1.15s ease-in-out infinite;
}
@keyframes pin-shadow {
  0%, 100% { transform: scale(1); opacity: .22; }
  50% { transform: scale(.7); opacity: .12; }
}

/* Order status progress */
.order-progress {
  height: 8px;
  border-radius: 99px;
  background: #ececec;
  overflow: hidden;
  margin: 4px 0 14px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.08);
}
.order-progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: #111;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset;
  transition: width .7s cubic-bezier(.22, 1, .36, 1);
  position: relative;
  overflow: hidden;
}
.order-progress > span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s ease-in-out infinite;
}
.tracker li.is-now .dot {
  animation: pulse-dot 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(17,17,17,.35);
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(17,17,17,.35); }
  70% { box-shadow: 0 0 0 8px rgba(17,17,17,0); }
  100% { box-shadow: 0 0 0 0 rgba(17,17,17,0); }
}
.tracker li.is-done::before {
  background: #111;
  transition: background .4s ease;
}
.stepper .step.is-now .bar {
  background: #111;
  position: relative;
  overflow: hidden;
}
.stepper .step.is-now .bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.2s ease-in-out infinite;
}

[data-theme="dark"] .hero-media,
[data-theme="dark"] .courier-map,
[data-theme="dark"] .skel,
[data-theme="dark"] .cover,
[data-theme="dark"] .dish-photo-wrap,
[data-theme="dark"] .order-progress {
  background: #1c1c1c;
}
[data-theme="dark"] .order-progress > span { background: #fff; }
[data-theme="dark"] .courier-map .map-route,
[data-theme="dark"] .courier-map .map-spot { stroke: #fff; fill: #fff; }
[data-theme="dark"] .courier-map .street { stroke: #2a2a2a; }
[data-theme="dark"] .tracker li.is-now .dot { box-shadow: 0 0 0 0 rgba(255,255,255,.35); }

@media (prefers-reduced-motion: reduce) {
  .pop-in,
  .resto-grid .resto-card,
  .menu-item.pop-in,
  .add-btn.is-bounce,
  .qty button.is-bounce,
  .cart-pop,
  .fly-bite,
  .cover-art, .bob, .steam i,
  .map-pin, .map-pin .pin-body, .map-pin .pin-shadow,
  .courier-map .map-route,
  .order-progress > span::after,
  .tracker li.is-now .dot,
  .stepper .step.is-now .bar::after,
  .skel::after,
  .cover:not(.is-ready)::before,
  .dish-photo-wrap:not(.is-ready)::before,
  .hero-media:not(.is-ready)::before {
    animation: none !important;
    transition: none !important;
  }
  .hero-media,
  .dish-photo-wrap,
  .cat-ico,
  .resto-card, .feature-card, .mini-card, .menu-item,
  .deal-card, .building-card, .card.incoming {
    transform: none !important;
  }
  .cover-photo, .dish-photo, .hero-photo-img, .cat-ico img { opacity: 1; }
  .map-pin { offset-distance: 50%; }
  .courier-map[data-phase="delivered"] .map-pin,
  .courier-map[data-phase="done"] .map-pin { offset-distance: 100%; }
  .courier-map[data-phase="received"] .map-pin,
  .courier-map[data-phase="preparing"] .map-pin,
  .courier-map[data-phase="incoming"] .map-pin,
  .courier-map[data-phase="toPickup"] .map-pin { offset-distance: 8%; }
}
