/* QRMenyu — Premium Editorial (light 3/10 refresh)
   navy #171e19 · sage #b7c6c2 · cyan #d5f4f9 · taupe #9f8d8b
   Anton (display) · Plus Jakarta Sans (body)
   Dumaloq burchaklar, yumshoq soyalar, silliq harakat. */
:root {
  --bg:    #EFF1EE;
  --paper: #EFF1EE;   /* compat alias */
  --ink:   #171e19;   /* navy */
  --navy:  #171e19;
  --sage:  #b7c6c2;
  --cyan:  #d5f4f9;
  --softblue: #bbe2f5;
  --taupe: #9f8d8b;
  --beige: #d7c5b2;
  --charcoal: #302b2f;
  --cream: #E7E9E4;
  /* aksent aliaslar — eski qoidalar ishlashda davom etadi */
  --acid:  #d5f4f9;   /* cyan pop */
  --red:   #d5f4f9;
  --gold:  #b7c6c2;
  --disp:  'Anton', Impact, 'Arial Narrow', sans-serif;
  --body:  'Plus Jakarta Sans', 'Helvetica Neue', system-ui, sans-serif;
  --mono:  'Plus Jakarta Sans', system-ui, sans-serif;
  /* shakl */
  --r-card: 22px;
  --r-tile: 20px;
  --r-med:  22px;
  --r-btn:  14px;
  --r-pill: 999px;
  --r-modal: 26px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --shadow:    0 14px 34px -16px rgba(23,30,25,.42);
  --shadow-sm: 0 8px 20px -12px rgba(23,30,25,.40);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: var(--body);
  background: var(--bg); color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation; position: relative;
}

/* Yumshoq ambiyent yorug'lik — juda nozik (3/10) */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 40% at 80% -5%, rgba(213,244,249,.5), transparent 70%),
    radial-gradient(55% 38% at 5% 8%, rgba(183,198,194,.4), transparent 70%);
}

#app, #state { position: relative; z-index: 2; }
img { display: block; }
button { font-family: var(--body); }

/* ── KEYFRAMES ── */
@keyframes viewIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes popIn  { from { opacity:0; transform:translateY(10px) scale(.98); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes shimmer { 0%{background-position:-400px 0;} 100%{background-position:400px 0;} }
@keyframes floaty { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-5px); } }

.vin { animation: viewIn .35s var(--ease) both; }

/* ── LANG TOGGLE ── */
.lang-toggle {
  display: flex; border: 1px solid rgba(23,30,25,.18);
  border-radius: var(--r-pill); overflow: hidden; background: rgba(255,255,255,.5);
  backdrop-filter: blur(6px);
}
.lang-toggle button {
  font: 600 11px/1 var(--body); letter-spacing: 2px; text-transform: uppercase;
  color: rgba(23,30,25,.5); background: transparent; border: none;
  padding: 9px 15px; min-height: 38px; cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.lang-toggle button.on { background: var(--ink); color: var(--cyan); border-radius: var(--r-pill); }

.table-chip {
  font: 600 9px/1 var(--body); letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--ink); border: 1px solid rgba(23,30,25,.22);
  border-radius: var(--r-pill); padding: 10px 15px; background: rgba(255,255,255,.5);
}

/* ─────────────────────────────
   HUB — Home screen
   ───────────────────────────── */
#hub { max-width: 480px; margin: 0 auto; padding: 22px 20px 30px; }

.hub-head .top-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hub-head .brand {
  margin-top: 30px; font: 600 10px/1 var(--body);
  letter-spacing: 5px; text-transform: uppercase;
  color: var(--taupe); text-align: center;
}
.hub-head .big-title {
  font: 400 clamp(64px, 22vw, 104px)/.85 var(--disp); text-align: center; margin: 10px 0 4px;
  color: var(--ink); letter-spacing: -1px; text-transform: uppercase;
}

/* Medallions — to'liq enli, past bo'yli gorizontal qatorlar */
.medallions { display: grid; grid-template-columns: 1fr; gap: 8px; padding-top: 26px; }

.med {
  position: relative; min-height: 120px;
  border: none; background: var(--ink); color: var(--bg);
  border-radius: var(--r-med);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; cursor: pointer; overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.med:active { transform: scale(.97); }
@media (hover: hover) {
  .med:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -18px rgba(23,30,25,.5); }
  .med:hover .bg { transform: scale(1.06); }
}

.med .bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 1; transition: transform .6s var(--ease); }
.med .bg::after { display: none; }
.med .lace { display: none; }
.med .ico { position: relative; display: flex; color: var(--cyan); }
.med .ico svg { width: 26px; height: 26px; }
.med.has-bg .ico { display: none; }
.med .lbl { position: relative; font: 400 19px/1.05 var(--disp); letter-spacing: .5px; text-transform: uppercase; text-align: center; padding: 0 14px; text-shadow: 0 1px 4px rgba(9,9,11,.9), 0 0 16px rgba(9,9,11,.7); }
.med .sub { position: relative; font: 500 9px/1 var(--body); letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.85); text-shadow: 0 1px 4px rgba(9,9,11,.9); }

/* Corner annotation */
.med::before {
  display: block !important; content: attr(data-n);
  position: absolute; top: 11px; right: 13px;
  font: 600 9px/1 var(--body); letter-spacing: 1px; color: var(--cyan); opacity: .7; z-index: 1;
}

.med--waiter { background: linear-gradient(165deg, #1f2a23, #302b2f); }
.med--waiter.done { background: #2f6f4f; }
.med--waiter.cooldown { filter: grayscale(.7) brightness(.75); pointer-events: none; }

.hub-foot { margin-top: 34px; text-align: center; font: 600 8px/1 var(--body); letter-spacing: 4px; text-transform: uppercase; color: var(--taupe); opacity: .7; }

/* ── WAITER BAR ── */
.waiter-bar {
  display: flex; align-items: center; gap: 14px;
  width: 100%; margin-top: 24px;
  font: 700 11px/1.3 var(--body); letter-spacing: 2px; text-transform: uppercase;
  text-align: left; color: var(--cyan);
  background: var(--ink); border: none; border-radius: var(--r-btn);
  padding: 18px 20px; min-height: 66px; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.waiter-bar:active { transform: scale(.98); }
@media (hover: hover) { .waiter-bar:hover { transform: translateY(-3px); box-shadow: 0 22px 40px -18px rgba(23,30,25,.5); } }
.waiter-bar.cooldown { filter: grayscale(.7) brightness(.8); pointer-events: none; }
.waiter-bar.done { background: #2f6f4f; color: #fff; pointer-events: none; }
.waiter-bar .wico { display: flex; flex: 0 0 auto; color: var(--sage); }
.waiter-bar .wico svg { width: 36px; height: 36px; }
.waiter-bar .wtxt { flex: 1; }
.waiter-bar .warrow { display: flex; flex: 0 0 auto; opacity: .65; }
.waiter-bar .warrow svg { width: 18px; height: 18px; }

/* ── WAITER FAB ── */
.waiter-fab {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 100;
  display: flex; align-items: center; gap: 10px;
  font: 700 11px/1.25 var(--body); letter-spacing: 2px; text-transform: uppercase;
  color: var(--cyan); background: var(--ink);
  border: none; border-radius: var(--r-pill); padding: 16px 28px; min-height: 52px; cursor: pointer;
  box-shadow: 0 16px 30px -12px rgba(23,30,25,.55);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.waiter-fab:active { transform: translateX(-50%) scale(.96); }
.waiter-fab.cooldown { filter: grayscale(.8) brightness(.8); pointer-events: none; }
.waiter-fab.done { background: #2f6f4f; color: #fff; pointer-events: none; }
.waiter-fab .bell { display: flex; color: var(--sage); }
.waiter-fab .bell svg { width: 16px; height: 16px; }

/* ─────────────────────────────
   CATVIEW
   ───────────────────────────── */
#catview { max-width: 560px; margin: 0 auto; }

.cat-top {
  position: sticky; top: 0; z-index: 60;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; background: rgba(239,241,238,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(23,30,25,.1);
}

.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 700 9px/1 var(--body); letter-spacing: 2px; text-transform: uppercase;
  color: var(--ink); background: rgba(255,255,255,.6);
  border: 1px solid rgba(23,30,25,.2); border-radius: var(--r-pill);
  padding: 11px 18px 11px 14px; min-height: 40px; cursor: pointer;
  transition: transform .35s var(--ease), background .35s var(--ease);
}
.back-btn:active { transform: scale(.96); }
@media (hover: hover) { .back-btn:hover { background: var(--ink); color: var(--cyan); } }
.back-btn svg { width: 14px; height: 14px; }

.cat-hero { padding: 24px 18px 16px; }
.cat-hero h1 { font: 400 clamp(34px, 9vw, 46px)/.9 var(--disp); color: var(--ink); letter-spacing: -.5px; text-transform: uppercase; }

/* ── SUBCAT TILES ── */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 18px; }
.tile {
  position: relative; min-height: 112px;
  border: none; border-radius: var(--r-tile); padding: 16px 15px;
  text-align: left; overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.tile:active { transform: scale(.97); }
@media (hover: hover) {
  .tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
  .tile:hover .thumb { transform: rotate(14deg) scale(1.08); }
}
.tile .tt { display: block; font: 400 17px/1.05 var(--disp); letter-spacing: .5px; text-transform: uppercase; max-width: 85%; overflow-wrap: anywhere; position: relative; z-index: 1; }
.tile .tn { display: block; margin-top: 6px; font: 600 9px/1 var(--body); letter-spacing: 2px; opacity: .6; position: relative; z-index: 1; }
.tile .thumb { position: absolute; right: -12px; bottom: -10px; width: 66px; height: 66px; border-radius: 18px; transform: rotate(18deg); background-size: cover; background-position: center; background-color: rgba(23,30,25,.18); transition: transform .5s var(--ease); }
.tile.t1 { background: var(--ink);      color: #fff; }
.tile.t2 { background: var(--sage);     color: var(--ink); }
.tile.t3 { background: var(--beige);    color: var(--ink); }
.tile.t4 { background: var(--charcoal); color: var(--cyan); }
.tile.t5 { background: var(--cyan);     color: var(--ink); }

/* ── ITEM CARDS ── */
.content { padding: 14px 14px 130px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.card {
  position: relative; aspect-ratio: 3 / 4.2;
  background: var(--ink); border: none; border-radius: var(--r-card);
  box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.card:active { transform: scale(.98); }
@media (hover: hover) {
  .card:hover { transform: translateY(-5px); box-shadow: 0 26px 46px -20px rgba(23,30,25,.55); }
  .card:hover .pimg { transform: scale(1.06); }
}

.card .panel {
  position: relative; width: 100%; flex: 0 0 70%;
  background: #11150f; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.card .pimg {
  position: relative; width: 68%; aspect-ratio: 1;
  background: center/contain no-repeat;
  display: flex; align-items: center; justify-content: center;
  margin-top: -8px; z-index: 2; transition: transform .6s var(--ease);
}
.card .pimg svg { width: 42%; height: 42%; color: rgba(255,255,255,.4); }
.card .panel .cup { width: 40px; height: 52px; }

/* RASMLI card */
.card.has-photo .panel { background: var(--ink); }
.card.has-photo .pimg {
  width: 100%; height: 100%; aspect-ratio: auto;
  margin: 0; background-size: cover; background-position: center;
}

/* Info zone */
.card .info {
  flex: 1; display: flex; align-items: center; justify-content: space-between;
  padding: 11px 13px 13px; gap: 6px;
  background: var(--ink); border-top: 1px solid rgba(213,244,249,.22); min-height: 0;
}
.card .nm {
  font: 400 13px/1.2 var(--disp); letter-spacing: .4px; text-transform: uppercase;
  color: #fff; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card .price-block { flex: 0 0 auto; text-align: right; }
.card .price-num { display: block; font: 700 14px/1 var(--body); color: var(--cyan); font-variant-numeric: tabular-nums; white-space: nowrap; }
.card .price-unit { display: block; font: 500 8px/1.4 var(--body); color: rgba(255,255,255,.4); }

/* Sold out */
.card.out { opacity: .55; }
.card.out .pimg { filter: grayscale(1) contrast(.75); }
.out-badge {
  position: absolute; top: 11px; right: 11px; z-index: 4;
  font: 700 8px/1 var(--body); letter-spacing: 2px; text-transform: uppercase;
  color: var(--ink); background: var(--cyan); border: none; border-radius: var(--r-pill); padding: 6px 10px;
}

/* CSS cups */
.cup { width: 34px; height: 44px; border-radius: 4px 4px 12px 12px; border: 2px solid rgba(255,255,255,.6); position: relative; overflow: hidden; }
.cup::before { content: ''; position: absolute; top: -7px; right: 5px; width: 4px; height: 14px; background: var(--cyan); border-radius: 2px; transform: rotate(12deg); }
.cup::after  { content: ''; position: absolute; top: 4px; left: 4px; width: 3px; height: 26px; border-radius: 2px; background: rgba(255,255,255,.2); }
.cup--latte  { background: linear-gradient(180deg, #EAD9BF 0 30%, #C99B66 55%, #8A5B33 100%); }
.cup--matcha { background: linear-gradient(180deg, #E3EAD0 0 28%, #A9BE78 55%, #71904C 100%); }
.cup--mocha  { background: linear-gradient(180deg, #DCC8B2 0 26%, #8A5A3B 55%, #4A3528 100%); }
.cup--lemon  { background: linear-gradient(180deg, #F6E7B8 0 33%, #E0AC4D 60%, #B97E2E 100%); }

/* ── STATE SCREENS ── */
.state-screen { min-height: 82dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; gap: 14px; }
.state-screen .big { font-size: 46px; }
.state-screen h2 { font: 400 30px/1.1 var(--disp); color: var(--ink); letter-spacing: -.5px; text-transform: uppercase; }
.state-screen p  { font: 400 14px/1.65 var(--body); color: var(--taupe); max-width: 300px; }
.state-btn {
  display: inline-flex; align-items: center; margin-top: 6px;
  font: 700 11px/1 var(--body); letter-spacing: 2px; text-transform: uppercase;
  color: var(--cyan); background: var(--ink);
  border: none; border-radius: var(--r-pill); padding: 16px 28px; min-height: 48px;
  box-shadow: var(--shadow); transition: transform .35s var(--ease); text-decoration: none;
}
.state-btn:hover  { transform: translateY(-3px); }
.state-btn:active { transform: scale(.97); }

/* ── SKELETON ── */
.sk { background: linear-gradient(90deg, #E3E5DF 25%, #ECEEE8 37%, #E3E5DF 63%); background-size: 800px 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--r-card); }
.sk-hero { height: 120px; margin: 26px 20px; }
.sk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 0 20px; max-width: 480px; margin: 0 auto; }
.sk-med { aspect-ratio: 1; }

/* ── ITEM MODAL ── */
.imodal { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.imodal-bd { position: absolute; inset: 0; background: rgba(23,30,25,.78); backdrop-filter: blur(3px); cursor: pointer; }
.imodal-panel {
  position: relative; z-index: 1; background: var(--bg);
  border: none; border-radius: var(--r-modal); box-shadow: 0 40px 80px -30px rgba(23,30,25,.7);
  width: 100%; max-width: 760px; max-height: 90dvh; overflow: hidden;
  display: flex; flex-direction: column; animation: popIn .3s var(--ease) both;
}
.imodal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  font: 700 9px/1 var(--body); letter-spacing: 2px; text-transform: uppercase;
  background: var(--ink); color: var(--cyan);
  border: none; border-radius: var(--r-pill); padding: 10px 15px; cursor: pointer;
  transition: transform .35s var(--ease), background .35s var(--ease);
}
.imodal-close:hover  { background: var(--cyan); color: var(--ink); }
.imodal-close:active { transform: scale(.95); }

.imodal-grid { display: grid; grid-template-columns: 1fr 1fr; flex: 1; overflow: hidden; min-height: 0; }

/* Left: image */
.imodal-img-wrap { position: relative; background: var(--ink); min-height: 260px; overflow: hidden; }
.imodal-img { position: absolute; inset: 0; background: center/contain no-repeat var(--ink); display: flex; align-items: center; justify-content: center; }
.imodal-img svg { width: 50%; height: 50%; color: rgba(255,255,255,.32); }
.imodal-img .cup { width: 70px; height: 90px; }
.imodal-halftone { display: none; }

/* Right: info */
.imodal-info { padding: 52px 26px 26px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.imodal-cat {
  font: 700 9px/1 var(--body); letter-spacing: 3px; text-transform: uppercase;
  color: var(--ink); background: var(--cyan);
  border: none; border-radius: var(--r-pill); padding: 7px 14px; display: inline-block; align-self: flex-start;
}
.imodal-name { font: 400 32px/.92 var(--disp); letter-spacing: -.5px; text-transform: uppercase; color: var(--ink); }
.imodal-sep { width: 44px; height: 3px; border-radius: 2px; background: var(--sage); flex: 0 0 3px; }
.imodal-desc { font: 400 13px/1.65 var(--body); color: var(--taupe); flex: 1; }
.imodal-price-row { display: flex; align-items: baseline; gap: 8px; border-top: 1px solid rgba(23,30,25,.14); padding-top: 14px; margin-top: auto; }
.imodal-price-num { font: 700 30px/1 var(--body); color: var(--ink); font-variant-numeric: tabular-nums; }
.imodal-price-unit { font: 500 12px/1 var(--body); color: var(--taupe); }
.imodal-avail { font: 700 9px/1 var(--body); letter-spacing: 2px; text-transform: uppercase; padding: 7px 15px; border: none; border-radius: var(--r-pill); align-self: flex-start; background: var(--ink); color: var(--cyan); }
.imodal-avail.out { background: var(--cyan); color: var(--ink); }

/* Mobile modal */
@media (max-width: 560px) {
  .imodal-grid { grid-template-columns: 1fr; grid-template-rows: 220px 1fr; }
  .imodal-img-wrap { min-height: 0; }
  .imodal-info { padding: 40px 18px 18px; max-height: 55dvh; }
}

/* ── ENTRY ANIMATIONS ── */
.med { animation: popIn .5s var(--ease) both; }
.med:nth-child(2) { animation-delay: .06s; }
.med:nth-child(3) { animation-delay: .12s; }
.med:nth-child(4) { animation-delay: .18s; }
.med:nth-child(5) { animation-delay: .24s; }
.med:nth-child(6) { animation-delay: .30s; }
.cards .card { animation: popIn .45s var(--ease) both; }
.cards .card:nth-child(2) { animation-delay: .04s; }
.cards .card:nth-child(3) { animation-delay: .08s; }
.cards .card:nth-child(4) { animation-delay: .12s; }
.cards .card:nth-child(5) { animation-delay: .16s; }
.cards .card:nth-child(6) { animation-delay: .20s; }
.cards .card:nth-child(n+7) { animation-delay: .24s; }
.tiles .tile { animation: popIn .45s var(--ease) both; }
.tiles .tile:nth-child(2) { animation-delay: .05s; }
.tiles .tile:nth-child(3) { animation-delay: .10s; }
.tiles .tile:nth-child(4) { animation-delay: .15s; }
.tiles .tile:nth-child(n+5) { animation-delay: .20s; }
.waiter-bar { animation: popIn .5s var(--ease) .3s both; }

@media (prefers-reduced-motion: reduce) {
  .vin, .med, .cards .card, .tiles .tile, .waiter-bar { animation: none; opacity: 1; transform: none; }
}

@media (max-width: 350px) { .cards, .tiles { grid-template-columns: 1fr; } }
@media (min-width: 560px) { .cards { grid-template-columns: repeat(3,1fr); } .tiles { grid-template-columns: repeat(3,1fr); } }
