:root{
  --bg:#0b1220;
  --card:#0f1a2e;
  --muted:#9fb2d2;
  --text:#eaf1ff;
  --line:rgba(255,255,255,.08);
  --accent:#3bf2b6;
  --accent2:#60a5fa;
  --danger:#fb7185;
  --shadow: 0 18px 50px rgba(0,0,0,.35);
  --radius:18px;
  --radius2:24px;
  --pad:14px;
  --max:1100px;
  --tap:48px;
  font-synthesis-weight:none;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1200px 800px at 10% 0%, rgba(96,165,250,.18), transparent 60%),
              radial-gradient(1000px 700px at 90% 20%, rgba(59,242,182,.12), transparent 55%),
              var(--bg);
  color:var(--text);
}

a{color:inherit; text-decoration:none}
.muted{color:var(--muted)}
.small{font-size:.92rem}
.container{max-width:var(--max); margin:0 auto; padding: 16px var(--pad) 40px}

.topbar{
  position:sticky; top:0; z-index:20;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,.72);
  border-bottom:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px var(--pad);
}
.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:42px; height:42px; border-radius:16px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(59,242,182,.22), rgba(96,165,250,.22));
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  font-weight:800;
}
.brand-title{font-weight:800; letter-spacing:.2px}
.brand-sub{font-size:.9rem; color:var(--muted)}

.icon-btn{
  width:44px; height:44px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.05);
  display:grid; place-items:center;
  cursor:pointer;
}
.icon{font-size:20px; opacity:.9}

.hero{
  display:flex; gap:14px; align-items:flex-end; justify-content:space-between;
  padding:18px;
  border:1px solid var(--line);
  border-radius: var(--radius2);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
  margin: 14px 0;
}
.hero-compact{align-items:center}
.hero h1{margin:0; font-size:1.35rem; line-height:1.2}
.pill{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 10px 14px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
}

.toolbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
  margin: 14px 0;
}
.kpi{
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  border-radius: 16px;
  padding: 10px 12px;
  min-width: 140px;
}
.kpi-label{font-size:.85rem; color:var(--muted)}
.kpi-value{font-size:1.2rem; font-weight:800}

.btn{
  height: var(--tap);
  padding: 0 14px;
  border-radius: 16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color:var(--text);
  font-weight:700;
  cursor:pointer;
}
.btn:active{transform: translateY(1px)}
.btn-primary{
  border-color: rgba(59,242,182,.28);
  background: linear-gradient(135deg, rgba(59,242,182,.22), rgba(96,165,250,.16));
}

.searchbox{margin: 14px 0}
.searchform{
  display:flex; gap:10px; align-items:center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.04);
}
.input{
  flex:1;
  height: var(--tap);
  border-radius: 16px;
  border:1px solid var(--line);
  background: rgba(11,18,32,.55);
  color: var(--text);
  padding: 0 12px;
  font-size: 1rem;
  outline:none;
}
.input::placeholder{color: rgba(159,178,210,.75)}

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

.card{
  border:1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.04);
  overflow:hidden;
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
  cursor:pointer;
}
.card-img{
  width:100%;
  aspect-ratio: 1.15/1;
  object-fit: cover;
  background: rgba(255,255,255,.03);
  border-bottom:1px solid var(--line);
}
.card-body{padding: 12px}
.card-title{font-weight:800; font-size: .98rem; line-height:1.15}
.price{margin-top:6px; font-weight:900; font-size:1.02rem}
.badge{
  display:inline-flex;
  margin-top:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid var(--line);
  color: var(--muted);
  font-size:.84rem;
}

.empty{
  padding: 24px;
  border:1px dashed rgba(255,255,255,.16);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.03);
  text-align:center;
  margin-top: 14px;
}
.empty-title{font-weight:900; font-size:1.05rem; margin-bottom: 6px}

.toast{
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
}
.toast-error{
  border-color: rgba(251,113,133,.35);
  background: rgba(251,113,133,.08);
}

.footer{
  border-top:1px solid var(--line);
  padding: 18px var(--pad);
  background: rgba(11,18,32,.6);
}
.footer-inner{max-width:var(--max); margin:0 auto; display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap}

.modal{position:fixed; inset:0; display:none; z-index:60}
.modal[aria-hidden="false"]{display:block}
.modal-backdrop{position:absolute; inset:0; background: rgba(0,0,0,.55)}
.modal-card{
  position:absolute; left:50%; top:50%;
  transform: translate(-50%,-50%);
  width: min(560px, calc(100% - 24px));
  border-radius: 26px;
  border:1px solid var(--line);
  background: rgba(15,26,46,.96);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-head{display:flex; justify-content:space-between; align-items:center; padding: 14px 14px; border-bottom:1px solid var(--line)}
.modal-title{font-weight:900}
.modal-body{padding: 14px; display:flex; gap:12px; flex-direction:column}
.modal-img{
  width:100%;
  aspect-ratio: 1.6/1;
  object-fit:cover;
  border-radius: 18px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.modal-meta{display:flex; flex-direction:column; gap:6px}
.modal-foot{padding: 14px; border-top:1px solid var(--line); display:flex; justify-content:flex-end}

/* ===== Cart + Pager (Mobile-fit) ===== */
.top-actions{display:flex; gap:10px; align-items:center}
.cart-btn{position:relative}
.badge-dot{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  font-size:.78rem;
  font-weight:900;
  background: rgba(59,242,182,.92);
  color:#06131a;
  border:1px solid rgba(0,0,0,.2);
}
.pager{
  margin-top:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.pager #pageInfo{flex:1; text-align:center}
.modal-foot-split{gap:10px}
.modal-foot-split .btn{flex:1}

.cartlist{display:flex; flex-direction:column; gap:12px; margin-top: 12px}
.cartitem{
  display:grid;
  grid-template-columns: 64px 1fr;
  gap:12px;
  padding: 12px;
  border:1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.04);
}
.cartimg{
  width:64px; height:64px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  object-fit:cover;
}
.cartmeta{display:flex; flex-direction:column; gap:4px}
.cartname{font-weight:900; line-height:1.15}
.cartprice{font-weight:900}
.cartqty{
  grid-column: 1 / -1;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
}
.qtybtn{
  width:48px; height:48px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color:var(--text);
  font-weight:900;
  font-size: 20px;
}
.qtyinput{
  flex:1;
  height:48px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(11,18,32,.55);
  color:var(--text);
  padding: 0 12px;
  font-size:1rem;
  text-align:center;
}
.summary{
  margin-top: 14px;
  padding: 14px;
  border:1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.04);
}
.sumrow{display:flex; justify-content:space-between; align-items:center; padding: 10px 0; border-bottom:1px solid rgba(255,255,255,.06)}
.sumrow:last-child{border-bottom:0}
.sumrow-strong{font-weight:900}
.sumval{font-weight:900}
.sumactions{display:flex; gap:10px; margin-top: 12px}
.sumactions .btn{flex:1}

.checkout-card{
  margin-top: 12px;
  padding: 14px;
  border:1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.04);
}
.form{display:flex; flex-direction:column; gap:10px}
.label{font-size:.9rem; color:var(--muted); font-weight:700}
.btn-full{width:100%}

/* ===== Orders (Account) ===== */
.ordercard{
  margin-top: 12px;
  padding: 14px;
  border:1px solid rgba(255,255,255,.10);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.04);
}
.orderhead{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.orderref{font-weight: 900;}
.orderstatus{
  font-weight: 900;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
}
.orderstatus.paid{
  border-color: rgba(59,242,182,.55);
  box-shadow: 0 0 0 3px rgba(59,242,182,.10);
}
.orderitems{margin-top: 10px; display:flex; flex-direction:column; gap:8px}
.orderitem{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding-top:8px;
  border-top:1px solid rgba(255,255,255,.06);
}
.orderitem:first-child{border-top:0; padding-top:0;}
.orderitem .nm{font-weight:800; max-width:70%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.orderitem .qt{opacity:.9; font-weight:800}

.toastpop{
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  min-width: 220px;
  max-width: calc(100vw - 28px);
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(11,18,32,.92);
  border: 1px solid rgba(255,255,255,.10);
  color: var(--text);
  font-weight: 800;
  box-shadow: 0 12px 34px rgba(0,0,0,.35);
  display: none;
  z-index: 99999;
}

/* ===== FORCE Bottom Nav Icons Visible ===== */
.bn-ic { fill: #ffffff !important; opacity: 1 !important; }
.bn-item { color: #ffffff !important; }
.bn-item.active .bn-ic { fill: #3bf2b6 !important; }
.bn-item.active { color: #3bf2b6 !important; }
