/* =========================================================
   Lazzat — mijoz sayti. Dark / Light, desktop + mobil + Telegram WebApp
   ========================================================= */
:root {
  --accent: #ff6a13;
  --accent-2: #ff8a2a;
  --accent-grad: linear-gradient(135deg, #ff8a2a 0%, #f04a0c 100%);
  --accent-soft: rgba(255, 106, 19, 0.12);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --star: #ffc542;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --container: 1280px;
  --header-h: 72px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);       /* yumshoq "ease-out" */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);  /* yengil sakrash */
  --blur: blur(22px) saturate(170%);
  --blur-sm: blur(12px) saturate(150%);
}
/* Shisha (glassmorphism) palitrasi: sirtlar shaffof, orqada iliq nur porlaydi */
[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b0b0e;
  --bg-elev: rgba(22, 22, 27, 0.72);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.07);
  --surface-3: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.085);
  --border-hi: rgba(255, 255, 255, 0.16);
  --text: #f6f6f8;
  --text-2: #cfcfd8;
  --muted: #9393a0;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.3);
  --hi: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --glass-card: linear-gradient(160deg, rgba(255, 255, 255, 0.085) 0%, rgba(255, 255, 255, 0.025) 55%, rgba(255, 255, 255, 0.035) 100%);
  --img-bg: rgba(255, 255, 255, 0.05);
  --glass: rgba(14, 14, 18, 0.58);
  --ambient-1: rgba(255, 106, 19, 0.24);
  --ambient-2: rgba(240, 74, 12, 0.14);
  --ambient-3: rgba(255, 160, 60, 0.1);
  --solid: #15151a;
}
[data-theme='light'] {
  color-scheme: light;
  --bg: #f7f3ee;
  --bg-elev: rgba(255, 255, 255, 0.78);
  --surface: rgba(255, 255, 255, 0.6);
  --surface-2: rgba(30, 20, 10, 0.045);
  --surface-3: rgba(30, 20, 10, 0.085);
  --border: rgba(30, 20, 10, 0.08);
  --border-hi: rgba(255, 255, 255, 0.9);
  --text: #17141a;
  --text-2: #3d3840;
  --muted: #736c76;
  --shadow: 0 18px 40px rgba(80, 40, 10, 0.12);
  --shadow-sm: 0 6px 16px rgba(80, 40, 10, 0.07);
  --hi: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --glass-card: linear-gradient(160deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.62) 100%);
  --img-bg: rgba(30, 20, 10, 0.05);
  --glass: rgba(255, 255, 255, 0.62);
  --ambient-1: rgba(255, 138, 42, 0.26);
  --ambient-2: rgba(255, 106, 19, 0.12);
  --ambient-3: rgba(255, 200, 120, 0.22);
  --solid: #ffffff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
/* Orqa fondagi iliq, sekin harakatlanuvchi nur — shisha sirtlar shuni "xiralashtiradi" */
body::before {
  content: '';
  position: fixed;
  inset: -15%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 32% at 12% 8%, var(--ambient-1), transparent 70%),
    radial-gradient(34% 30% at 92% 22%, var(--ambient-2), transparent 70%),
    radial-gradient(46% 38% at 55% 105%, var(--ambient-3), transparent 70%);
  filter: blur(30px);
  animation: ambient 26s ease-in-out infinite alternate;
}
@keyframes ambient {
  50% { transform: translate3d(2.5%, 1.5%, 0) scale(1.04); }
  100% { transform: translate3d(-2%, -2.5%, 0) scale(1.02); }
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
[hidden] { display: none !important; }
svg { flex: none; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Tugmalar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 14px; font-weight: 600; white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.2s, opacity 0.2s, box-shadow 0.2s;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 18px rgba(240, 74, 12, 0.28); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(240, 74, 12, 0.4); }
.btn-soft { background: var(--surface-2); color: var(--text); }
.btn-soft:hover { background: var(--surface-3); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-success { background: var(--success); color: #fff; }
.btn-lg { height: 54px; font-size: 16px; border-radius: 16px; padding: 0 24px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; display: inline-grid; place-items: center;
  background: var(--surface-2); color: var(--text); transition: background 0.2s;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn svg { width: 22px; height: 22px; }
[data-theme='dark'] .theme-toggle .i-moon, [data-theme='light'] .theme-toggle .i-sun { display: none; }

/* ---------- Topbar ---------- */
.topbar { background: var(--bg-elev); border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.topbar-in { display: flex; align-items: center; gap: 22px; height: 36px; }
.topbar-item { display: inline-flex; align-items: center; gap: 6px; }
.topbar-item svg { width: 15px; height: 15px; color: var(--accent); }
.pill-open, .pill-closed { padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill-open { background: var(--success-soft); color: var(--success); }
.pill-closed { background: var(--danger-soft); color: var(--danger); }
.lang-switch { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.lang-switch button { padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.lang-switch button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 40;
  background: var(--glass); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-in { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: 10px; flex: none; }
.logo img { width: 42px; height: 42px; border-radius: 13px; box-shadow: 0 6px 16px rgba(240, 74, 12, 0.35); }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text b { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.logo-text small { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.catalog-btn { height: 46px; }
.search {
  flex: 1; display: flex; align-items: center; position: relative; min-width: 0;
  background: var(--surface-2); border: 1.5px solid transparent; border-radius: 14px; height: 46px;
  transition: border-color 0.2s, background 0.2s;
}
.search:focus-within { border-color: var(--accent); background: var(--surface); }
.search-ico { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0 12px 0 44px;
}
.search input::-webkit-search-cancel-button { display: none; }
.search-btn { height: 36px; margin-right: 5px; border-radius: 10px; padding: 0 16px; }
.header-actions { display: flex; align-items: center; gap: 4px; }
.hact {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px; border-radius: 12px; font-size: 12px; color: var(--text-2); transition: background 0.2s, color 0.2s;
}
.hact svg { width: 24px; height: 24px; }
.hact:hover, .hact.active { background: var(--surface-2); color: var(--text); }
.hact .badge { position: absolute; top: 2px; right: 10px; }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; font-style: normal; display: inline-grid; place-items: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--bg-elev);
}
.dot { position: absolute; top: 6px; right: calc(50% - 16px); width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2px var(--bg-elev); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.2); } }
.m-actions { display: none; gap: 8px; margin-left: auto; }
#m-lang-label { font-size: 13px; font-weight: 700; }

.catnav { border-top: 1px solid var(--border); }
.catnav-in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; height: 46px; align-items: center; }
.catnav-in::-webkit-scrollbar { display: none; }
.catnav a {
  flex: none; padding: 7px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: background 0.2s, color 0.2s;
}
.catnav a:hover { background: var(--surface-2); color: var(--text); }
.catnav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.catalog-menu {
  position: absolute; left: 0; right: 0; top: 100%; background: var(--bg-elev); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 20px 0 26px; animation: drop 0.2s var(--ease);
}
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
.catalog-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.catalog-tile {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--surface-2);
  transition: background 0.2s, transform 0.2s;
}
.catalog-tile:hover { background: var(--surface-3); transform: translateY(-2px); }
.catalog-tile img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.catalog-tile b { display: block; font-size: 15px; }
.catalog-tile small { color: var(--muted); }

.notice { background: var(--danger-soft); color: var(--danger); text-align: center; padding: 10px 16px; font-weight: 600; font-size: 14px; }
.notice.info { background: var(--accent-soft); color: var(--accent); }

/* ---------- Asosiy ---------- */
.main { padding-top: 22px; padding-bottom: 60px; min-height: 60vh; outline: none; }
.section { margin-top: 34px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.section-head a { color: var(--accent); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.page-title { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 18px; display: flex; align-items: center; gap: 12px; }
.page-title .count { font-size: 15px; font-weight: 600; color: var(--muted); }
.greet { display: none; }

/* Banner karuseli */
.hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; }
.hero-track { display: flex; transition: transform 0.6s var(--ease); }
.slide {
  position: relative; flex: 0 0 100%; min-height: 300px; display: flex; align-items: center; padding: 40px 56px;
  color: #fff; overflow: hidden; cursor: pointer;
}
.slide::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 50%, rgba(255,255,255,0.14), transparent 55%); pointer-events: none; }
.slide-1 { background: linear-gradient(120deg, #3a1a07 0%, #a8400a 55%, #ff7a1a 100%); }
.slide-2 { background: linear-gradient(120deg, #1d0f2e 0%, #5b1f6e 50%, #e0457b 100%); }
.slide-3 { background: linear-gradient(120deg, #072a24 0%, #0f6b4f 55%, #2fbf71 100%); }
.slide-text { position: relative; z-index: 2; max-width: 52%; }
.slide-kicker { display: inline-block; padding: 5px 12px; border-radius: 99px; background: rgba(255,255,255,0.18); font-size: 13px; font-weight: 600; backdrop-filter: blur(6px); }
.slide h3 { font-size: 44px; line-height: 1.05; margin: 14px 0 10px; font-weight: 900; letter-spacing: -0.03em; }
.slide p { margin: 0 0 22px; font-size: 17px; opacity: 0.92; }
.slide .btn { background: #fff; color: #1a1a1a; box-shadow: none; }
.slide-img {
  position: absolute; right: 6%; top: 50%; width: 330px; height: 330px; transform: translateY(-50%);
  border-radius: 50%; object-fit: cover; box-shadow: 0 30px 60px rgba(0,0,0,0.45); border: 6px solid rgba(255,255,255,0.14);
}
.slide-badge {
  position: absolute; right: calc(6% + 270px); top: 26px; z-index: 3; width: 92px; height: 92px; border-radius: 50%;
  background: #e5261e; color: #fff; display: grid; place-items: center; text-align: center; font-weight: 900;
  font-size: 26px; line-height: 0.95; transform: rotate(-12deg); box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.slide-badge small { display: block; font-size: 11px; font-weight: 700; }
.hero-dots { position: absolute; left: 56px; bottom: 20px; display: flex; gap: 6px; z-index: 4; }
.hero-dots button { width: 8px; height: 8px; border-radius: 99px; background: rgba(255,255,255,0.45); transition: width 0.3s, background 0.3s; }
.hero-dots button.active { width: 26px; background: #fff; }
.hero-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.9); color: #111; display: grid; place-items: center; opacity: 0; transition: opacity 0.2s; }
.hero:hover .hero-nav { opacity: 1; }
.hero-prev { left: 14px; } .hero-next { right: 14px; }

/* Kategoriya chiplari (rasmli) */
.chips { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 108px; padding: 12px 8px 10px;
  border-radius: 18px; background: var(--surface); border: 1.5px solid var(--border); font-size: 13px; font-weight: 600;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.chip:hover { transform: translateY(-2px); }
.chip img { width: 58px; height: 58px; border-radius: 16px; object-fit: cover; }
.chip.active { background: var(--accent-grad); border-color: transparent; color: #fff; box-shadow: 0 8px 20px rgba(240, 74, 12, 0.3); }
.chip span { text-align: center; line-height: 1.15; }

/* Mahsulot kartalari */
.grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 18px) / 5); gap: 18px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; }
.card {
  position: relative; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden; transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-img { position: relative; aspect-ratio: 1 / 0.86; background: var(--img-bg); overflow: hidden; cursor: pointer; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.card:hover .card-img img { transform: scale(1.05); }
.card-badges { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { padding: 3px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 700; color: #fff; }
.tag-hit { background: var(--accent); }
.tag-new { background: #7c3aed; }
.tag-sale { background: #e5261e; }
.fav-btn {
  position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.35); backdrop-filter: blur(6px); color: #fff; display: grid; place-items: center; transition: transform 0.2s;
}
.fav-btn svg { width: 20px; height: 20px; }
.fav-btn:active { transform: scale(0.85); }
.fav-btn.on { color: #ff3b5c; background: rgba(255,255,255,0.92); }
.fav-btn.on path { fill: currentColor; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-name { font-weight: 700; font-size: 15px; line-height: 1.25; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: 12.5px; color: var(--muted); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.price { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.price s { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.add-btn {
  width: 40px; height: 40px; border-radius: 12px; background: var(--accent-grad); color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(240, 74, 12, 0.3); transition: transform 0.15s;
}
.add-btn:active { transform: scale(0.88); }
.add-btn svg { width: 20px; height: 20px; }
.stepper { display: inline-flex; align-items: center; background: var(--accent-soft); border-radius: 12px; height: 40px; }
.stepper button { width: 36px; height: 40px; display: grid; place-items: center; color: var(--accent); }
.stepper button svg { width: 18px; height: 18px; }
.stepper b { min-width: 22px; text-align: center; color: var(--accent); font-size: 15px; }
.card.soldout .card-img img { filter: grayscale(1); opacity: 0.5; }
.soldout-label { position: absolute; inset: auto 10px 10px 10px; text-align: center; background: rgba(0,0,0,0.7); color: #fff; border-radius: 10px; padding: 5px; font-size: 12.5px; font-weight: 600; }

/* Faol buyurtma kartasi */
.live-order {
  display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; margin-top: 22px; padding: 18px 22px;
  border-radius: var(--radius); background: linear-gradient(135deg, rgba(34,197,94,0.14), rgba(34,197,94,0.03)); border: 1px solid rgba(34,197,94,0.35);
}
.live-order h3 { margin: 0 0 2px; font-size: 17px; display: flex; gap: 8px; align-items: center; }
.live-order p { margin: 0; color: var(--text-2); font-size: 14px; }
.live-order .btn { background: var(--success); color: #fff; }

/* Bo'sh holatlar */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-ico { width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 28px; background: var(--surface-2); display: grid; place-items: center; font-size: 44px; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 20px; }
.empty p { margin: 0 0 20px; }

/* Skelet */
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Savat ---------- */
.cart-layout, .checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel h3 { margin: 0 0 14px; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.panel h3 .num { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 14px; }
.sticky { position: sticky; top: calc(var(--header-h) + 64px); }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; background: var(--img-bg); }
.cart-item .name { font-weight: 600; line-height: 1.25; }
.cart-item .sub { color: var(--muted); font-size: 13px; }
.cart-item .right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-item .stepper { height: 34px; }
.cart-item .stepper button { height: 34px; width: 32px; }
.cart-item.unavailable { opacity: 0.55; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; color: var(--text-2); }
.sum-row.total { color: var(--text); font-size: 20px; font-weight: 800; border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 14px; }
.sum-row .hint { color: var(--muted); font-size: 13px; text-align: right; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 10px 0 4px; }
.progress i { display: block; height: 100%; background: var(--accent-grad); border-radius: inherit; transition: width 0.4s var(--ease); }
.info-box { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: var(--accent-soft); color: var(--text-2); font-size: 13.5px; margin-top: 14px; }
.info-box b { color: var(--text); }
.info-box .ico { font-size: 20px; line-height: 1; }

/* ---------- Forma ---------- */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg-2 { grid-template-columns: repeat(2, 1fr); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg .opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border-radius: 14px; text-align: center;
  background: var(--surface-2); border: 1.5px solid transparent; font-weight: 600; font-size: 14px; transition: all 0.2s;
}
.seg .opt .e { font-size: 24px; }
.seg .opt small { font-weight: 500; color: var(--muted); font-size: 12px; }
.seg input:checked + .opt { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.seg input:focus-visible + .opt { outline: 2px solid var(--accent); outline-offset: 2px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field > span i { color: var(--danger); font-style: normal; }
.input, .field select, .field textarea {
  width: 100%; height: 48px; border-radius: 13px; border: 1.5px solid var(--border); background: var(--surface-2);
  padding: 0 14px; outline: none; transition: border-color 0.2s, background 0.2s;
}
.field textarea { height: 84px; padding: 12px 14px; resize: vertical; }
.input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); background: var(--surface); }
.field.error .input, .field.error .phone-wrap { border-color: var(--danger); }
.field .err { color: var(--danger); font-size: 12.5px; }
.phone-wrap { display: flex; align-items: center; border: 1.5px solid var(--border); background: var(--surface-2); border-radius: 13px; height: 48px; transition: border-color 0.2s; }
.phone-wrap:focus-within { border-color: var(--accent); background: var(--surface); }
.phone-wrap b { padding: 0 4px 0 14px; color: var(--text-2); font-weight: 600; }
.phone-wrap input { flex: 1; min-width: 0; border: 0; background: transparent; height: 100%; outline: 0; padding-right: 14px; letter-spacing: 0.02em; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--text-2); }
.chip-btn.ok { background: var(--success-soft); color: var(--success); }
.time-slots { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.time-slots::-webkit-scrollbar { display: none; }
.time-slots button { flex: none; padding: 8px 14px; border-radius: 10px; background: var(--surface-2); font-weight: 600; font-size: 14px; border: 1.5px solid transparent; }
.time-slots button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- Buyurtma sahifasi ---------- */
.order-hero { text-align: center; padding: 30px 20px 26px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden; }
.order-hero.st-cancelled { background: linear-gradient(180deg, var(--danger-soft), var(--surface)); }
.order-hero.st-done { background: linear-gradient(180deg, var(--success-soft), var(--surface)); }
.order-hero .big-ico { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 26px; background: var(--accent-grad); display: grid; place-items: center; font-size: 40px; box-shadow: 0 14px 30px rgba(240,74,12,0.35); }
.order-hero.st-done .big-ico { background: var(--success); box-shadow: 0 14px 30px rgba(34,197,94,0.35); }
.order-hero.st-cancelled .big-ico { background: var(--danger); box-shadow: none; }
.order-hero h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.02em; }
.order-hero p { margin: 0 auto; max-width: 520px; color: var(--text-2); }
.order-num { display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 99px; background: var(--surface-2); font-weight: 700; font-size: 13px; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); margin: 26px 0 4px; position: relative; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); text-align: center; }
.step::before { content: ''; position: absolute; top: 17px; left: -50%; right: 50%; height: 3px; background: var(--surface-3); z-index: 0; }
.step:first-child::before { display: none; }
.step .c { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 16px; transition: all 0.3s; }
.step.done { color: var(--text-2); }
.step.done::before, .step.current::before { background: var(--success); }
.step.done .c { background: var(--success); color: #fff; }
.step.current { color: var(--text); font-weight: 700; }
.step.current .c { background: var(--success); color: #fff; box-shadow: 0 0 0 6px var(--success-soft); animation: pulse 1.6s infinite; }
.step small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; margin-top: 20px; align-items: start; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.order-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.order-actions .btn { flex: 1; }

.order-list { display: grid; gap: 14px; }
.order-row {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); transition: transform 0.2s, box-shadow 0.2s;
}
.order-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.order-row .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.order-row .top b { font-size: 17px; }
.order-row .thumbs { display: flex; gap: 6px; grid-column: 1 / -1; }
.order-row .thumbs img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--img-bg); }
.order-row .thumbs span { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.order-row .total { font-weight: 800; font-size: 17px; text-align: right; }
.status-chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--text-2); }
.status-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-chip.s-new { background: rgba(59,130,246,0.14); color: #3b82f6; }
.status-chip.s-confirmed { background: rgba(168,85,247,0.14); color: #a855f7; }
.status-chip.s-cooking { background: var(--accent-soft); color: var(--accent); }
.status-chip.s-ready { background: rgba(234,179,8,0.16); color: #d4a106; }
.status-chip.s-done { background: var(--success-soft); color: var(--success); }
.status-chip.s-cancelled { background: var(--danger-soft); color: var(--danger); }

/* ---------- Drawer (desktop savat) ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 60; animation: fade 0.2s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100%; z-index: 61; background: var(--bg-elev);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s var(--ease); box-shadow: var(--shadow);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { margin: 0; font-size: 20px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 20px; }
.drawer-foot { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
@keyframes fade { from { opacity: 0; } }

/* ---------- Modal (mahsulot) ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); animation: fade 0.2s; }
.modal-card {
  position: relative; width: min(860px, 100%); max-height: calc(100dvh - 40px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: var(--bg-elev);
  border-radius: var(--radius-lg); display: grid; grid-template-columns: 1fr 1fr; animation: pop 0.25s var(--ease); box-shadow: var(--shadow);
}
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(10px); } }
.pm-img { position: relative; background: var(--img-bg); min-height: 380px; }
.pm-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pm-body { padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.pm-body h2 { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; }
.pm-body p { margin: 0; color: var(--text-2); }
.pm-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.pm-meta span { padding: 5px 10px; border-radius: 9px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--text-2); }
.pm-foot { margin-top: auto; display: flex; gap: 12px; align-items: center; padding-top: 16px; }
.pm-foot .stepper { height: 54px; border-radius: 16px; }
.pm-foot .stepper button { height: 54px; width: 44px; }
.pm-foot .btn { flex: 1; }
.modal-close { position: absolute; right: 14px; top: 14px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,0.45); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); }
.modal-close svg { width: 20px; height: 20px; }
.sheet-handle { display: none; }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast { pointer-events: auto; padding: 12px 18px; border-radius: 14px; background: #1f1f25; color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); animation: toast 0.3s var(--ease); display: flex; gap: 10px; align-items: center; }
[data-theme='light'] .toast { background: #18181c; }
.toast.err { background: #b91c1c; }
.toast.ok { background: #15803d; }
@keyframes toast { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-elev); padding: 34px 0; margin-top: 30px; color: var(--text-2); font-size: 14px; }
.footer-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.footer h4 { margin: 0 0 10px; color: var(--text); font-size: 15px; }
.footer p { margin: 4px 0; }
.footer a:hover { color: var(--accent); }
.footer .copy { grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding-top: 18px; border-top: 1px solid var(--border); }

/* ---------- Mobil elementlar ---------- */
.bottom-nav, .cartbar { display: none; }

/* =========================================================
   Moslashuvchanlik
   ========================================================= */
@media (max-width: 1200px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hscroll { grid-auto-columns: calc((100% - 3 * 18px) / 4); }
  .header-actions .hact span { display: none; }
  .hact { padding: 8px 10px; }
  .hact .badge { right: 2px; }
}
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hscroll { grid-auto-columns: calc((100% - 2 * 18px) / 3); }
  .catalog-btn span { display: none; }
  .catalog-btn { width: 46px; padding: 0; }
  .catalog-grid { grid-template-columns: repeat(3, 1fr); }
  .cart-layout, .checkout-layout, .order-grid { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .slide-img { width: 260px; height: 260px; right: 4%; }
  .slide-badge { right: calc(4% + 200px); }
  .slide h3 { font-size: 36px; }
  .footer-in { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  :root { --header-h: 60px; }
  body { font-size: 14.5px; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  body.has-cartbar { padding-bottom: calc(134px + env(safe-area-inset-bottom)); }
  .container { padding: 0 16px; }
  .topbar, .catnav, .header-actions, .catalog-btn, .footer, .search-btn { display: none !important; }
  .header-in { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .logo img { width: 38px; height: 38px; border-radius: 12px; }
  .logo-text b { font-size: 20px; }
  .m-actions { display: flex; }
  .search { order: 5; flex: 1 0 100%; height: 44px; }
  .header.compact .search { display: none; }
  .main { padding-top: 14px; padding-bottom: 24px; }
  .section { margin-top: 26px; }
  .section-head h2 { font-size: 19px; }
  .page-title { font-size: 24px; margin: 0 0 14px; }

  .greet { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
  .greet h1 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
  .greet p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
  .greet .loc { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; font-weight: 600; }

  .hero { border-radius: 20px; }
  .slide { min-height: 178px; padding: 20px; }
  .slide-text { max-width: 58%; }
  .slide h3 { font-size: 24px; margin: 8px 0 4px; }
  .slide p { font-size: 13px; margin-bottom: 12px; }
  .slide-kicker { font-size: 11px; padding: 4px 9px; }
  .slide .btn { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
  .slide-img { width: 150px; height: 150px; right: -14px; border-width: 4px; }
  .slide-badge { width: 58px; height: 58px; font-size: 16px; right: 96px; top: 12px; }
  .slide-badge small { font-size: 8px; }
  .hero-dots { left: 20px; bottom: 12px; }
  .hero-nav { display: none; }

  .chips { gap: 10px; margin: 0 -16px; padding: 2px 16px; }
  .chip { width: 78px; padding: 8px 4px; border-radius: 16px; font-size: 11.5px; gap: 6px; }
  .chip img { width: 46px; height: 46px; border-radius: 13px; }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hscroll { grid-auto-columns: 46%; gap: 12px; margin: 0 -16px; padding: 0 16px 4px; scroll-padding: 0 16px; }
  .card { border-radius: 16px; }
  .card:hover { transform: none; box-shadow: none; }
  .card-body { padding: 10px 11px 11px; }
  .card-name { font-size: 14px; }
  .price { font-size: 15.5px; }
  .stepper b { min-width: 16px; font-size: 14px; }
  .fav-btn { width: 32px; height: 32px; right: 8px; top: 8px; }
  .fav-btn svg { width: 17px; height: 17px; }
  .card-badges { left: 8px; top: 8px; }

  .live-order { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .steps { margin-top: 20px; }
  .step { font-size: 10.5px; }
  .step .c { width: 30px; height: 30px; font-size: 14px; }
  .step::before { top: 14px; }

  .panel { padding: 16px; border-radius: 16px; }
  .fields { grid-template-columns: 1fr; }
  .seg .opt { padding: 12px 4px; font-size: 13px; }
  .order-hero { padding: 24px 16px 20px; }
  .order-hero h1 { font-size: 21px; }

  /* pastki navigatsiya */
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--glass); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 14px; font-size: 11px; font-weight: 600; color: var(--muted); }
  .bottom-nav a svg { width: 24px; height: 24px; }
  .bottom-nav a.active { color: var(--accent); background: var(--accent-soft); }
  .bottom-nav .badge { position: absolute; top: 0; left: calc(50% + 4px); }
  .cartbar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 49;
    align-items: center; justify-content: space-between; gap: 12px; height: 54px; padding: 0 8px 0 18px; border-radius: 16px;
    background: var(--accent-grad); color: #fff; font-weight: 700; box-shadow: 0 10px 26px rgba(240,74,12,0.45); animation: toast 0.3s var(--ease);
  }
  .cartbar .go { background: rgba(255,255,255,0.2); padding: 9px 14px; border-radius: 11px; font-size: 14px; }
  .toasts { bottom: calc(140px + env(safe-area-inset-bottom)); }

  /* mahsulot oynasi pastdan chiquvchi "sheet" */
  .modal { place-items: end center; padding: 0; }
  .modal-card { grid-template-columns: minmax(0, 1fr); width: 100%; border-radius: 24px 24px 0 0; max-height: 90dvh; animation: sheet 0.3s var(--ease); }
  @keyframes sheet { from { transform: translateY(100%); } }
  .pm-img { min-height: 0; aspect-ratio: 4 / 3; }
  .pm-body { padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
  .pm-body h2 { font-size: 22px; }
  .sheet-handle { display: block; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 44px; height: 5px; border-radius: 99px; background: rgba(255,255,255,0.7); z-index: 3; }
  .drawer { width: 100%; }
}

/* Telegram WebApp ichida */
.tg .topbar { display: none; }
.tg .page-cta { display: none !important; }


/* =========================================================
   GLASS — shishasimon sirtlar
   ========================================================= */
.header, .bottom-nav, .drawer, .modal-card, .catalog-menu, .topbar, .toast { backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.header { background: var(--glass); border-bottom-color: var(--border); box-shadow: var(--hi); }
.topbar { background: transparent; border-bottom-color: var(--border); }
.footer { background: transparent; }
.catalog-menu { background: var(--bg-elev); border-bottom: 1px solid var(--border); }

.card, .chip, .panel, .live-order, .order-row, .order-hero, .catalog-tile, .empty-ico {
  background: var(--glass-card);
  border: 1px solid var(--border);
  box-shadow: var(--hi), var(--shadow-sm);
}
.panel, .order-hero, .live-order { backdrop-filter: var(--blur-sm); -webkit-backdrop-filter: var(--blur-sm); }
.card { border-radius: 20px; }
.card-img { margin: 6px 6px 0; border-radius: 15px; }
.card::after { /* yuqori chetdagi nozik yorug'lik chizig'i */
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent 30%);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.card:hover::after { opacity: 1; }
.card:hover { border-color: var(--border-hi); box-shadow: var(--hi), var(--shadow), 0 0 0 1px rgba(255,106,19,0.08); }

.chip { backdrop-filter: var(--blur-sm); -webkit-backdrop-filter: var(--blur-sm); }
.chip.active { box-shadow: 0 10px 26px rgba(240, 74, 12, 0.38), inset 0 1px 0 rgba(255,255,255,0.3); }
.chip img { box-shadow: 0 6px 14px rgba(0,0,0,0.25); }

.fav-btn { background: rgba(20,20,24,0.35); backdrop-filter: var(--blur-sm); -webkit-backdrop-filter: var(--blur-sm); border: 1px solid rgba(255,255,255,0.18); }
.tag { backdrop-filter: blur(6px); box-shadow: 0 4px 10px rgba(0,0,0,0.18); }
.add-btn, .btn-primary { box-shadow: 0 8px 20px rgba(240, 74, 12, 0.35), inset 0 1px 0 rgba(255,255,255,0.28); }
.stepper { background: rgba(255,106,19,0.14); border: 1px solid rgba(255,106,19,0.22); }
.btn-soft, .icon-btn { background: var(--surface-2); border: 1px solid var(--border); }
.search { background: var(--surface-2); border: 1px solid var(--border); }
.lang-switch { border: 1px solid var(--border); }
.lang-switch button.active { background: var(--surface-3); }
.input, .field select, .field textarea, .phone-wrap { border-width: 1px; }
.seg .opt { border: 1px solid var(--border); background: var(--surface-2); }
.seg input:checked + .opt { box-shadow: 0 8px 20px rgba(240,74,12,0.18), inset 0 1px 0 rgba(255,255,255,0.08); }

.hero { box-shadow: 0 24px 60px rgba(240, 74, 12, 0.22), inset 0 1px 0 rgba(255,255,255,0.15); }
.slide-kicker { border: 1px solid rgba(255,255,255,0.22); }
.slide .btn { background: rgba(255,255,255,0.92); }
.slide-img { box-shadow: 0 30px 60px rgba(0,0,0,0.45), 0 0 0 10px rgba(255,255,255,0.06), 0 0 80px rgba(255,138,42,0.45); }

.live-order { background: linear-gradient(135deg, rgba(34,197,94,0.16), rgba(34,197,94,0.04)); border-color: rgba(34,197,94,0.35); box-shadow: var(--hi), 0 14px 34px rgba(34,197,94,0.12); }
.step.current .c { box-shadow: 0 0 0 6px var(--success-soft), 0 0 22px rgba(34,197,94,0.55); }

.drawer { background: var(--bg-elev); border-left: 1px solid var(--border); }
.modal-card { background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--hi), 0 30px 80px rgba(0,0,0,0.45); }
.drawer-backdrop, .modal-backdrop { background: radial-gradient(120% 90% at 50% 40%, rgba(8,6,6,0.55), rgba(5,4,4,0.78)); }
.toast { background: rgba(24,24,30,0.78); border: 1px solid rgba(255,255,255,0.1); }
.toast.ok { background: rgba(21,128,61,0.82); }
.toast.err { background: rgba(185,28,28,0.85); }

/* =========================================================
   MOTION — yumshoq o'tishlar
   ========================================================= */
a, button, .chip, .card, .btn, .icon-btn, .hact, .seg .opt, .chip-btn, .order-row, .catalog-tile {
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease), color 0.25s var(--ease),
    box-shadow 0.45s var(--ease), transform 0.45s var(--ease), opacity 0.35s var(--ease);
}
.btn:hover:not(:disabled), .icon-btn:hover, .chip-btn:hover { transform: translateY(-1px); }
.btn:active:not(:disabled), .icon-btn:active, .add-btn:active, .chip:active { transform: scale(0.95); transition-duration: 0.12s; }
.card:hover { transform: translateY(-4px); }
.card-img img { transition: transform 0.9s var(--ease), opacity 0.6s var(--ease); }
.card:hover .card-img img { transform: scale(1.06); }

/* Sahifa almashinuvi */
.main.enter { animation: viewIn 0.5s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } }

/* Elementlar ko'rinishga kirganda ketma-ket paydo bo'lishi */
.rv { opacity: 0; transform: translateY(18px) scale(0.985); }
.rv.in { opacity: 1; transform: none; transition: opacity 0.6s var(--ease), transform 0.7s var(--ease), box-shadow 0.45s var(--ease), border-color 0.35s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }

/* Rasmlar yumshoq yuklanadi */
.card-img img, .chip img, .cart-item img, .slide-img, .catalog-tile img, .pm-img img { opacity: 0; }
img.ld { opacity: 1 !important; }

/* Savatga qo'shish */
.card-action.just > * { animation: pop 0.42s var(--spring) both; }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } }
.stepper b.bump { animation: bump 0.35s var(--spring); }
@keyframes bump { 40% { transform: scale(1.45); } }
.badge.bump { animation: badge 0.5s var(--spring); }
@keyframes badge { 30% { transform: scale(1.5); } 60% { transform: scale(0.9); } }
.fav-btn.on svg { animation: heart 0.5s var(--spring); }
@keyframes heart { 30% { transform: scale(1.35); } }
.fly { position: fixed; z-index: 95; pointer-events: none; border-radius: 16px; object-fit: cover; box-shadow: 0 10px 30px rgba(0,0,0,0.35); }

/* Savat paneli (mobil) — pastdan sirpanib chiqadi */
.cartbar { transition: transform 0.5s var(--ease), opacity 0.4s var(--ease); }
.cartbar.off { transform: translateY(140%); opacity: 0; pointer-events: none; }

/* Modal va drawer: ochilish/yopilish */
.modal .modal-backdrop { animation: fade 0.35s var(--ease) both; }
.modal .modal-card { animation: modalIn 0.5s var(--ease) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(0.96); } }
.modal.closing .modal-backdrop { animation: fadeOut 0.28s var(--ease) both; }
.modal.closing .modal-card { animation: modalOut 0.28s var(--ease) both; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(18px) scale(0.97); } }
.drawer { transition: transform 0.55s var(--ease); }
.drawer-backdrop { animation: fade 0.35s var(--ease) both; }
.drawer-backdrop.closing { animation: fadeOut 0.3s var(--ease) both; }
.catalog-menu { animation: drop 0.4s var(--ease); }
.toast { animation: toastIn 0.5s var(--spring); transition: opacity 0.35s, transform 0.35s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(0.95); } }
.toast.out { opacity: 0; transform: translateY(8px) scale(0.97); }

/* Banner: sekin siljish, faol slaydda matn va rasm jonlanadi */
.hero-track { transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1); }
.slide-img { transition: transform 1.1s var(--ease), opacity 0.8s var(--ease); transform: translateY(-50%) scale(0.86) rotate(-6deg); }
.slide.active .slide-img { transform: translateY(-50%) scale(1) rotate(0); }
.slide-text > * { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.7s var(--ease); }
.slide.active .slide-text > * { opacity: 1; transform: none; }
.slide.active .slide-text > :nth-child(2) { transition-delay: 0.08s; }
.slide.active .slide-text > :nth-child(3) { transition-delay: 0.16s; }
.slide.active .slide-text > :nth-child(4) { transition-delay: 0.24s; }
.slide-badge { animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: rotate(-8deg) translateY(-6px); } }
.hero-dots button { transition: width 0.5s var(--ease), background 0.4s; }

/* Buyurtma holati */
.step .c, .step::before { transition: background 0.6s var(--ease), box-shadow 0.6s var(--ease); }
.order-hero .big-ico { animation: pop 0.6s var(--spring) both; }

/* Mavzu almashtirish — doira shaklida ochilish (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.theme-fade, .theme-fade * { transition: background-color 0.45s var(--ease), color 0.45s var(--ease), border-color 0.45s var(--ease) !important; }

/* Mobil: suzuvchi shisha pastki menyu */
@media (max-width: 767px) {
  .bottom-nav {
    left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 6px;
    border: 1px solid var(--border); border-radius: 24px; background: var(--glass);
    box-shadow: var(--hi), 0 16px 40px rgba(0,0,0,0.35);
  }
  .bottom-nav a { border-radius: 18px; transition: background 0.4s var(--ease), color 0.3s var(--ease), transform 0.3s var(--spring); }
  .bottom-nav a.active { background: linear-gradient(160deg, rgba(255,106,19,0.26), rgba(255,106,19,0.1)); box-shadow: inset 0 0 0 1px rgba(255,106,19,0.3), 0 6px 18px rgba(240,74,12,0.25); }
  .bottom-nav a.active svg { transform: translateY(-1px); filter: drop-shadow(0 2px 6px rgba(255,106,19,0.5)); }
  .bottom-nav a:active { transform: scale(0.92); }
  body { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  body.has-cartbar { padding-bottom: calc(156px + env(safe-area-inset-bottom)); }
  .cartbar { bottom: calc(88px + env(safe-area-inset-bottom)); border-radius: 18px; box-shadow: 0 14px 34px rgba(240,74,12,0.45), inset 0 1px 0 rgba(255,255,255,0.3); }
  .toasts { bottom: calc(160px + env(safe-area-inset-bottom)); }
  .header { transition: transform 0.4s var(--ease); }
  .search { transition: opacity 0.3s var(--ease), max-height 0.4s var(--ease), margin 0.4s var(--ease); max-height: 44px; }
  .header.compact .search { display: flex !important; opacity: 0; max-height: 0; margin-top: -10px; pointer-events: none; border-width: 0; }
  .modal .modal-card { animation: sheetIn 0.55s var(--ease) both; }
  @keyframes sheetIn { from { transform: translateY(100%); } }
  .modal.closing .modal-card { animation: sheetOut 0.3s var(--ease) both; }
  @keyframes sheetOut { to { transform: translateY(100%); } }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

/* =========================================================
   KARTA — ixcham (referens uslubida)
   ========================================================= */
.card-img { aspect-ratio: 1 / 0.82; }
.card-body { padding: 10px 12px 12px; gap: 3px; }
.card-meta { display: flex; align-items: center; gap: 5px; font-size: 12.5px; }
.card-meta .w { color: var(--muted); }
.card-foot { flex-wrap: wrap; gap: 6px; padding-top: 6px; }
.price { font-size: 17px; line-height: 1.1; }
.price .cur { font-size: 0.68em; font-weight: 600; color: var(--muted); margin-left: 2px; }
.price s { font-size: 11.5px; }
/* Yurak: fonsiz, oq kontur, soya bilan */
.fav-btn {
  top: 12px; right: 12px; width: 30px; height: 30px; background: transparent !important; border: 0 !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important; color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.65));
}
.fav-btn svg { width: 22px; height: 22px; }
.fav-btn:hover { transform: scale(1.12); }
.fav-btn.on { color: #ff3b5c; background: transparent !important; }
/* Kichik dumaloq "+" va ixcham stepper */
.add-btn { width: 34px; height: 34px; border-radius: 50%; }
.add-btn svg { width: 18px; height: 18px; }
.card-action .stepper { height: 34px; border-radius: 99px; }
.card-action .stepper button { width: 30px; height: 34px; }
.card-action .stepper button svg { width: 15px; height: 15px; }
.card-action .stepper b { min-width: 16px; font-size: 14px; }
.card-action { margin-left: auto; }
@media (max-width: 767px) {
  .card-img { margin: 5px 5px 0; border-radius: 14px; }
  .card-body { padding: 9px 10px 10px; }
  .card-name { font-size: 14px; }
  .price { font-size: 15px; }
  .add-btn { width: 30px; height: 30px; }
  .card-action .stepper { height: 30px; }
  .card-action .stepper button { width: 23px; height: 30px; }
  .card-action .stepper b { min-width: 14px; font-size: 13.5px; }
  .card-foot { gap: 4px; }
  .fav-btn { top: 10px; right: 10px; }
}

/* Xavfsizlik: o'lchami berilmagan ikonka hech qachon konteynerdan kattalashmasin */
.btn svg:not([width]) { width: 20px; height: 20px; }
svg { max-width: 100%; }
.btn svg { flex: none; }

/* Desktopda gorizontal lenta o'rniga oddiy panjara (sichqoncha bilan aylantirish shart emas) */
@media (min-width: 768px) {
  .hscroll { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-columns: auto; overflow: visible; }
}
@media (min-width: 768px) and (max-width: 1200px) { .hscroll { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 768px) and (max-width: 1024px) { .hscroll { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Pastki menyu: chap, o'ng va pastki chetga yopishgan (suzuvchi emas) */
@media (max-width: 767px) {
  .bottom-nav {
    left: 0; right: 0; bottom: 0; border-radius: 22px 22px 0 0;
    border-width: 1px 0 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    box-shadow: var(--hi), 0 -10px 30px rgba(0, 0, 0, 0.25);
  }
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  body.has-cartbar { padding-bottom: calc(144px + env(safe-area-inset-bottom)); }
  .cartbar { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(150px + env(safe-area-inset-bottom)); }
}

/* =========================================================
   BUYURTMA KUZATUVI
   ========================================================= */
.order-hero .big-ico { color: #fff; }
.order-hero .big-ico svg { width: 40px; height: 40px; stroke-width: 1.7; }
.order-hero .order-actions { justify-content: center; margin-top: 18px; }
.order-hero .order-actions .btn { flex: 0 1 220px; }
.eta {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 8px 14px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px;
  border: 1px solid rgba(255, 106, 19, 0.25);
}
/* Segmentli progress */
.pbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 18px auto 0; max-width: 460px; }
.pbar i { height: 6px; border-radius: 99px; background: var(--surface-3); position: relative; overflow: hidden; }
.pbar i.done { background: var(--success); }
.pbar i.cur { background: rgba(34, 197, 94, 0.25); }
.pbar i.cur::after {
  content: ''; position: absolute; inset: 0; width: 45%; border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--success), transparent);
  animation: pbarMove 1.6s ease-in-out infinite;
}
@keyframes pbarMove { from { transform: translateX(-100%); } to { transform: translateX(230%); } }

/* Vertikal bosqichlar */
.track { list-style: none; margin: 0; padding: 0; }
.tr { position: relative; display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: start; padding-bottom: 22px; }
.tr:last-child { padding-bottom: 0; }
.tr::before { /* bosqichlarni bog'lovchi chiziq */
  content: ''; position: absolute; left: 19px; top: 42px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--surface-3);
}
.tr:last-child::before { display: none; }
.tr.done::before { background: var(--success); }
.tr.cur::before { background: linear-gradient(var(--success), var(--surface-3)); }
.tr-ico {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; position: relative; z-index: 1;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); transition: all 0.5s var(--ease);
}
.tr.done .tr-ico { background: var(--success); color: #fff; border-color: transparent; }
.tr.cur .tr-ico {
  background: var(--accent-grad); color: #fff; border-color: transparent;
  box-shadow: 0 0 0 5px rgba(255, 106, 19, 0.16), 0 8px 22px rgba(240, 74, 12, 0.4);
  animation: trPulse 2s ease-in-out infinite;
}
@keyframes trPulse { 50% { box-shadow: 0 0 0 9px rgba(255, 106, 19, 0.06), 0 8px 22px rgba(240, 74, 12, 0.4); } }
.tr.cancelled .tr-ico { background: var(--danger); color: #fff; border-color: transparent; }
.tr-body { padding-top: 2px; min-width: 0; }
.tr-body b { display: block; font-size: 15px; line-height: 1.3; }
.tr-body small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); line-height: 1.35; }
.tr.todo .tr-body b { color: var(--muted); font-weight: 600; }
.tr.cur .tr-body b { color: var(--text); font-size: 16px; }
.tr.cur .tr-body small { color: var(--text-2); }
.tr time { padding-top: 4px; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.tr.done time { color: var(--success); }

/* Bosh sahifadagi faol buyurtma kartasi */
.live-order { display: grid; grid-template-columns: 52px 1fr 24px; gap: 14px; align-items: center; color: inherit; }
.live-order:hover { transform: translateY(-2px); }
.lo-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--success); color: #fff; box-shadow: 0 8px 22px rgba(34, 197, 94, 0.35); }
.lo-ico svg { width: 26px; height: 26px; }
.lo-top { display: flex; align-items: baseline; gap: 8px; }
.lo-top b { font-size: 16.5px; }
.lo-body p { margin: 2px 0 0; font-size: 13.5px; color: var(--text-2); }
.lo-body .pbar { margin: 10px 0 0; max-width: none; }
.lo-go { color: var(--muted); }
@media (max-width: 767px) {
  .live-order { grid-template-columns: 46px 1fr 18px; gap: 12px; padding: 14px; }
  .lo-ico { width: 46px; height: 46px; border-radius: 14px; }
  .order-hero .order-actions .btn { flex: 1 1 0; }
  .tr { grid-template-columns: 36px 1fr auto; gap: 12px; }
  .tr-ico { width: 36px; height: 36px; border-radius: 12px; }
  .tr::before { left: 17px; top: 38px; }
}

/* =========================================================
   IKONKALAR (icons.js) — matn bilan bir chiziqda, bir xil uslubda
   ========================================================= */
svg.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; stroke-width: 2; }
.btn svg.i { width: 18px; height: 18px; vertical-align: middle; }
.btn-lg svg.i { width: 20px; height: 20px; }
.h-ico { width: 24px !important; height: 24px !important; vertical-align: -0.15em; }
.h-ico.hot { color: var(--accent); filter: drop-shadow(0 2px 8px rgba(255,106,19,0.45)); }
.h-ico.new { color: #a78bfa; filter: drop-shadow(0 2px 8px rgba(167,139,250,0.45)); }
.seg .opt .e { display: grid; place-items: center; height: 30px; font-size: 0; }
.seg .opt .e svg.i { width: 26px; height: 26px; stroke-width: 1.8; }
.seg .opt { gap: 6px; }
.empty-ico svg.i { width: 42px; height: 42px; stroke-width: 1.6; color: var(--muted); }
.info-box .ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255,106,19,0.16); color: var(--accent); flex: none; }
.info-box .ico svg.i { width: 18px; height: 18px; }
.eta svg.i { width: 17px; height: 17px; }
.kv dd svg.i, .pm-meta svg.i { color: var(--muted); margin-right: 2px; }
.chip-btn svg.i { width: 15px; height: 15px; }

/* Yon panel va modal: o'qish oson bo'lishi uchun deyarli shaffof emas (shisha effekti saqlanadi) */
.drawer { background: color-mix(in srgb, var(--solid) 93%, transparent); }
.modal-card { background: color-mix(in srgb, var(--solid) 95%, transparent); }
