:root{
  --bg:#0b0f17;
  --card:#111827;
  --card2:#0f172a;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --line:rgba(255,255,255,.08);
  --accent:#22c55e;
  --accent2:#60a5fa;
  --danger:#ef4444;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1000px 600px at 20% -10%, rgba(96,165,250,.20), transparent),
              radial-gradient(900px 600px at 90% 0%, rgba(34,197,94,.18), transparent),
              var(--bg);
  color:var(--text);
}

.app{min-height:100%; padding: 14px 14px 22px; max-width: 980px; margin:0 auto;}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 8px 4px 12px;
  position: sticky; top: 0; backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(11,15,23,.92), rgba(11,15,23,.55));
  z-index: 10;
}

.brand{display:flex; align-items:center; gap:10px}
.logo{
  width:38px; height:38px; border-radius: 12px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(96,165,250,.9), rgba(34,197,94,.85));
  box-shadow: var(--shadow);
  font-weight:800;
}
.brand-text .name{font-weight:800; letter-spacing:.2px}
.brand-text .sub{font-size:12px; color:var(--muted)}

.icon-btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  cursor:pointer;
  position:relative;
  box-shadow: 0 8px 18px rgba(0,0,0,.15);
}
.icon-btn:active{transform:scale(.98)}
.badge{
  position:absolute; top:-7px; right:-7px;
  background: var(--accent);
  color:#06110a;
  font-weight:800;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 12px;
  border: 2px solid rgba(11,15,23,.9);
}

.content{padding-bottom: 20px;}
.hero{margin: 10px 0 14px;}
.hero-card{
  background: linear-gradient(135deg, rgba(17,24,39,.75), rgba(15,23,42,.7));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px;
  box-shadow: var(--shadow);
}
.hero-title{font-weight:800; font-size: 16px}
.hero-sub{color:var(--muted); font-size:13px; margin-top:6px}

.toolbar{display:flex; flex-direction:column; gap:10px; margin: 12px 0 12px;}
.search input{
  width:100%;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 16px;
  padding: 12px 14px;
  outline:none;
}
.search input::placeholder{color: rgba(156,163,175,.75)}

.chips{display:flex; flex-wrap:wrap; gap:8px}
.chip{
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
  cursor:pointer;
}
.chip.active{
  border-color: rgba(34,197,94,.55);
  background: rgba(34,197,94,.12);
}

.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
@media (min-width: 720px){
  .grid{grid-template-columns: repeat(4, minmax(0, 1fr));}
}

.card{
  background: linear-gradient(180deg, rgba(17,24,39,.75), rgba(15,23,42,.75));
  border:1px solid var(--line);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
  display:flex; flex-direction:column;
}
.card .img{
  aspect-ratio: 1/1;
  background: rgba(255,255,255,.05);
  display:block;
  width:100%;
  object-fit: cover;
}
.card .body{padding: 10px 10px 12px; display:flex; flex-direction:column; gap:8px}
.title{
  font-weight:800;
  font-size: 13.5px;
  line-height: 1.2;
  min-height: 34px;
}
.meta{display:flex; align-items:center; justify-content:space-between; gap:10px}
.price{
  display:flex; flex-direction:column;
}
.price .uzs{font-weight:900}
.price .usd{font-size: 12px; color: var(--muted)}
.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  cursor:pointer;
}
.btn.primary{
  border-color: rgba(34,197,94,.55);
  background: linear-gradient(135deg, rgba(34,197,94,.22), rgba(96,165,250,.14));
}
.btn.danger{
  border-color: rgba(239,68,68,.55);
  background: rgba(239,68,68,.12);
}
.btn:active{transform:scale(.99)}
.btn.full{width:100%}

/* Drawer */
.drawer-backdrop, .modal-backdrop{
  position:fixed; inset:0; background: rgba(0,0,0,.55);
  opacity:0; pointer-events:none; transition: .18s ease;
  z-index: 30;
}
.drawer{
  position:fixed; right: 10px; left:10px; bottom: -20px;
  max-width: 980px; margin: 0 auto;
  background: rgba(17,24,39,.96);
  border:1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  transform: translateY(110%);
  transition: .22s ease;
  z-index: 40;
  overflow:hidden;
}
.drawer.open{transform: translateY(0)}
.drawer-backdrop.open{opacity:1; pointer-events:auto}

.drawer-head, .drawer-foot{
  padding: 12px 12px;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background: rgba(15,23,42,.9);
  border-bottom:1px solid var(--line);
}
.drawer-foot{border-top:1px solid var(--line); border-bottom:none}
.drawer-title{font-weight:900}
.drawer-sub{font-size: 12px; color: var(--muted)}
.drawer-body{padding: 10px 12px; max-height: 52vh; overflow:auto; display:flex; flex-direction:column; gap:10px}

.cart-item{
  display:flex; gap:10px; align-items:center;
  padding: 10px;
  border:1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
}
.cart-item img{width:56px; height:56px; border-radius: 14px; object-fit:cover; background: rgba(255,255,255,.05)}
.cart-item .info{flex:1}
.cart-item .info .t{font-weight:800; font-size: 13px; line-height:1.2}
.cart-item .info .p{color:var(--muted); font-size: 12px; margin-top:4px}
.cart-item .qty{
  display:flex; align-items:center; gap:6px;
}
.qty button{
  width:34px; height:34px; border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
}
.qty .n{min-width: 20px; text-align:center; font-weight:900}
.total{display:flex; align-items:center; justify-content:space-between; width:100%}
.total span{color:var(--muted)}

/* Modal */
.modal{
  position:fixed; left: 10px; right:10px; top: 10vh;
  max-width: 720px; margin: 0 auto;
  background: rgba(17,24,39,.98);
  border:1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  transform: translateY(20px) scale(.98);
  opacity:0; pointer-events:none;
  transition: .18s ease;
  z-index: 50;
  overflow:hidden;
}
.modal.open{opacity:1; pointer-events:auto; transform: translateY(0) scale(1)}
.modal-backdrop.open{opacity:1; pointer-events:auto}

.modal-head, .modal-foot{
  padding: 12px 12px;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background: rgba(15,23,42,.92);
}
.modal-title{font-weight:900}
.modal-sub{font-size: 12px; color: var(--muted)}
.modal-body{padding: 12px 12px 6px}

.form{display:flex; flex-direction:column; gap:12px}
label{display:flex; flex-direction:column; gap:6px; font-size: 13px; color: var(--muted)}
input, textarea{
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 12px;
  outline:none;
}
textarea{resize:none}
.note, .payhint{
  border:1px dashed rgba(255,255,255,.16);
  background: rgba(255,255,255,.02);
  border-radius: 16px;
  padding: 10px;
}
.note-title, .payhint-title{font-weight:900; color: var(--text); margin-bottom:6px}
.note-text, .payhint-text{color: var(--muted); font-size: 12.5px; line-height:1.4}

.skeleton{
  height: 220px;
  border-radius: var(--radius);
  border:1px solid var(--line);
  background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.07), rgba(255,255,255,.03));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer{0%{background-position: 0 0}100%{background-position: 200% 0}}