:root{
  --bg:#ffffff;
  --card:#ffffff;
  --line:#e8eef6;
  --text:#0b1220;
  --muted:#5b6b86;
  --green:#16a34a;
  --green2:#0f7a36;
  --danger:#e11d48;
  --shadow:0 10px 24px rgba(15,23,42,.08);
  --r:16px;
}

*{box-sizing:border-box}

html,body{
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial;
}

a{text-decoration:none;color:inherit}

.container{
  max-width:520px;
  margin:0 auto;
  min-height:100vh;
  background:var(--bg);
}

/* ================= HEADER ================= */
.header{
  position:sticky;
  top:0;
  z-index:50;
  background:#fff;
  border-bottom:1px solid var(--line);
}

.topbar{
  display:flex;
  gap:10px;
  align-items:center;
  padding:12px 14px;
}

/* ================= SEARCH ================= */
.search{
  flex:1;
  display:flex;
  gap:8px;
  align-items:center;
}

.search input{
  flex:1;
  border:1px solid var(--line);
  background:#f3f6fb;
  padding:10px 12px;
  font-size:14px;
  border-radius:999px;
  outline:none;
}

.search button{
  border:0;
  padding:10px 16px;
  border-radius:999px;
  background:var(--green);
  color:#fff;
  font-weight:800;
}

/* ================= BADGE ================= */
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  background:var(--danger);
  color:#fff;
  font-size:12px;
  font-weight:700;
}

/* ================= MAIN ================= */
.main{
  padding:14px 14px 90px;
}

/* ================= BANNER ================= */
.banner{
  background:linear-gradient(135deg,var(--green),var(--green2));
  border-radius:var(--r);
  color:#fff;
  padding:18px;
  box-shadow:var(--shadow);
  margin-bottom:14px;
}

.banner h1{
  margin:0;
  font-size:17px;
}

/* ================= GRID ================= */
.grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.card{
  border:1px solid var(--line);
  border-radius:var(--r);
  overflow:hidden;
  background:#fff;
  box-shadow:0 6px 16px rgba(15,23,42,.05);
  transition:.2s ease;
}

.card:hover{transform:translateY(-2px)}

.card .img{
  height:140px;
  background:#f3f6fb;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.card .img img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.card .body{padding:10px}

.card .name{
  font-weight:700;
  font-size:13px;
  line-height:1.3;
  min-height:34px;
}

.card .meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:8px;
}

.price{
  font-weight:900;
  color:var(--green);
}

.muted{
  color:var(--muted);
  font-size:12px;
}

/* ================= PROMO BADGE ================= */
.promoBadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:3px 8px;
  border-radius:999px;
  background:var(--green);
  color:#fff;
  font-size:11px;
  font-weight:900;
}

/* ================= PRODUCT DETAIL ================= */
.prod{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.img.big{
  height:260px;
  border-radius:16px;
  overflow:hidden;
  background:#f3f6fb;
  display:flex;
  align-items:center;
  justify-content:center;
}

.img.big img{
  width:100%;
  height:100%;
  object-fit:contain;
}

@media(min-width:900px){
  .prod{flex-direction:row}
  .img.big{
    width:360px;
    height:360px;
  }
  .pbody{flex:1}
}

/* ================= BUTTONS ================= */
.btn{
  border:0;
  border-radius:14px;
  padding:12px 14px;
  font-weight:800;
  cursor:pointer;
}

.btn.green{
  background:var(--green);
  color:#fff;
}

.btn.gray{
  background:#f3f6fb;
  border:1px solid var(--line);
}

.btn.red{
  background:var(--danger);
  color:#fff;
}

.btn.danger{
  background:var(--danger);
  color:#fff;
}

.row{
  display:flex;
  gap:10px;
}

.row > *{flex:1}

/* ================= FORM ================= */
.sheet{
  border:1px solid var(--line);
  border-radius:var(--r);
  background:#fff;
  padding:14px;
  box-shadow:0 6px 16px rgba(15,23,42,.05);
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom:12px;
}

.field input,
.field select,
.field textarea{
  border:1px solid var(--line);
  border-radius:12px;
  padding:11px 12px;
  font-size:14px;
  background:#fff;
  outline:none;
}

.field textarea{
  min-height:90px;
  resize:vertical;
}

.hr{
  height:1px;
  background:var(--line);
  margin:14px 0;
}

/* ================= CART ================= */
.item{
  display:flex;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid var(--line);
}

.thumb{
  width:64px;
  height:64px;
  border-radius:14px;
  background:#f3f6fb;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.qty{
  display:flex;
  gap:8px;
  align-items:center;
}

.qty button{
  width:34px;
  height:34px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  font-weight:900;
}

.qty span{
  min-width:24px;
  text-align:center;
  font-weight:800;
}

/* ================= BOTTOM NAV ================= */
.bottomnav{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:60;
  background:#fff;
  border-top:1px solid var(--line);
}

.bottomnav .wrap{
  max-width:520px;
  margin:0 auto;
  display:flex;
}

.bottomnav a{
  flex:1;
  padding:10px 8px;
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  font-size:11px;
}

.bottomnav a.active{
  color:var(--green);
  font-weight:800;
}

.navicon{
  width:22px;
  height:22px;
  border-radius:8px;
  background:#f3f6fb;
  display:flex;
  align-items:center;
  justify-content:center;
}
