:root{
  --bg: #0b0f14;
  --panel: rgba(255,255,255,0.06);
  --card: rgba(255,255,255,0.07);
  --stroke: rgba(255,255,255,0.10);
  --text: #e8eef6;
  --muted: rgba(232,238,246,0.70);
  --accent: #3b82f6;
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --r: 16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
}

.app{
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 14px 24px;
}

.header{
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 10px 2px 12px;
  backdrop-filter: blur(16px);
  background: linear-gradient(to bottom, rgba(11,15,20,0.95), rgba(11,15,20,0.65));
}

.header__title{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.header__sub{
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.controls{
  display:flex;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

.search{
  flex: 1;
  display:flex;
  gap: 8px;
  align-items:center;
  padding: 12px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--stroke);
}

.search .icon{
  color: var(--muted);
  font-size: 14px;
}

.search input{
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.pill{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 12px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
  cursor:pointer;
  user-select:none;
}

.pill:active{ transform: scale(0.99); }
.caret{ opacity: 0.7; }

.chips{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chip{
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.10);
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  cursor:pointer;
  user-select:none;
}

.chip.active{
  border-color: rgba(59,130,246,0.8);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.16);
}

.content{
  padding-top: 6px;
}

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 560px){
  .grid{
    grid-template-columns: 1fr 1fr;
  }
}

.card{
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 12px;
  overflow:hidden;
}

.card__top{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.card__title{
  font-weight: 900;
  font-size: 15px;
  line-height: 1.1;
}

.card__desc{
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  min-height: 32px;
}

.card__bottom{
  display:flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 10px;
}


.price{
  font-weight: 950;
  font-size: 16px;
}

.meta{
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.fav{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.12);
  color: var(--text);
  cursor:pointer;
  display:grid;
  place-items:center;
  user-select:none;
}

.fav.on{
  border-color: rgba(239,68,68,0.7);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.14);
}

.fav:active{ transform: scale(0.98); }

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  max-width: calc(100% - 24px);
}
.toast.show{ opacity: 1; }

.empty{
  border-radius: var(--r);
  border: 1px dashed rgba(255,255,255,0.16);
  padding: 18px;
  color: var(--muted);
  text-align:center;
}

.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display:none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal.show{ display:flex; }

.sheet{
  width: 100%;
  max-width: 760px;
  border-radius: 18px;
  background: rgba(15,20,28,0.96);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  padding: 14px;
}

.sheet__title{ font-size: 18px; font-weight: 950; }
.sheet__desc{ margin-top: 8px; color: var(--muted); line-height: 1.35; }

.sheet__row{
  display:flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 10px;
}

.btnPrimary{
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: none;
  background: rgba(59,130,246,0.95);
  color: white;
  font-weight: 950;
  cursor:pointer;
}
.btnPrimary:active{ transform: scale(0.99); }

.btnGhost{
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-weight: 900;
  cursor:pointer;
}


.headerRow{
  display:flex;
  align-items:center;
  gap:10px;
}

.back{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--text);
  font-weight: 950;
  cursor:pointer;
  display:grid;
  place-items:center;
}
.back:active{ transform: scale(0.98); }

.addBtn{
  height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(59,130,246,0.35);
  background: rgba(59,130,246,0.18);
  color: var(--text);
  font-weight: 950;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}

.addBtn:active{
  transform: scale(0.98);
}

.addBtn:hover{
  background: rgba(59,130,246,0.22);
  border-color: rgba(59,130,246,0.5);
}

.addBtn:disabled{
  cursor: not-allowed;
  opacity: 0.55;
  border-color: rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
}

.qtyCtl{
  display:flex;
  align-items:center;
  gap: 10px;
  height: 40px;
  padding: 0 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
}

.qtyBtn{
  width: 36px;
  height: 32px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.12);
  color: var(--text);
  font-weight: 950;
  cursor:pointer;
  display:grid;
  place-items:center;
  user-select:none;
}

.qtyBtn:active{ transform: scale(0.98); }

.qtyBtn:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}

.qtyNum{
  min-width: 18px;
  text-align:center;
  font-weight: 950;
}
