:root{
  --shopee:#ee4d2d;
  --shopee2:#ff7337;
  --bg:#f5f5f5;
  --card:#fff;
  --text:#1f1f1f;
  --muted:#7a7a7a;
  --line:#ececec;
  --gold:#f7b500;
  --danger:#ff424e;
  --green:#00bfa5;
  --shadow: 0 10px 24px rgba(0,0,0,.10);
  --radius: 14px;
  --maxw: 430px;
}

*{box-sizing:border-box}
html,body{height:100%}
html,body{
  overflow-x:hidden;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--text);
}
a{color:inherit;text-decoration:none}

.app{
  max-width:var(--maxw);
  margin:0 auto;
  min-height:100%;
  background:var(--bg);
  padding-bottom:86px;
  position:relative;
}

/* Header */
.topbar{
  position:sticky; top:0; z-index:60;
  background: linear-gradient(0deg, var(--shopee), var(--shopee2));
  padding: 10px 12px 12px;
  box-shadow: 0 6px 18px rgba(238,77,45,.22);
}
.toprow{
  display:flex; align-items:center; gap:10px;
  color:#fff;
}
.iconBtn{
  width:36px;height:36px;border-radius:12px;
  display:grid; place-items:center;
  background: rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.18);
  user-select:none;
  cursor:pointer;
}
.iconBtn i{font-size:16px}
.iconBtn:active{transform:scale(.98)}

.storePill{
  flex:1;
  height:36px;
  border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  gap:8px;
  padding:0 12px;
  background: rgba(255,255,255,.18);
  border:1px solid rgba(255,255,255,.18);
  font-weight:1000;
  letter-spacing:.2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  user-select:none;
}

.badge{position:relative}
.badge::after{
  content: attr(data-badge);
  position:absolute; top:-6px; right:-6px;
  min-width:18px;height:18px;
  padding:0 6px;
  border-radius:999px;
  background:#fff;
  color: var(--shopee);
  font-weight:1000;
  font-size:11px;
  display:none;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(0,0,0,.06);
}
.badge[data-badge]:not([data-badge="0"])::after{display:flex}

/* Card / layout */
.section{padding:10px}
.card{
  background:var(--card);
  border:1px solid #f0f0f0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card + .card{margin-top:10px}
.pad{padding:12px}
.row{display:flex; align-items:center; gap:10px}
.space{justify-content:space-between}
.muted{color:var(--muted)}
.tiny{font-size:12px}
.b{font-weight:1000}

/* Hero */
.heroWrap{
  position:relative;
  width:100%;
  aspect-ratio: 1 / 1;
  background:#00000008;
  overflow:hidden;
  touch-action: pan-y;
}
.heroTrack{
  height:100%;
  display:flex;
  transform: translateX(0);
  transition: transform .22s ease;
  will-change: transform;
}
.heroSlide{
  min-width:100%;
  height:100%;
  position:relative;
  display:grid;
  place-items:center;
  background:
    radial-gradient(60% 60% at 30% 30%, rgba(238,77,45,.22), transparent 60%),
    radial-gradient(60% 60% at 70% 70%, rgba(30,136,229,.16), transparent 60%),
    linear-gradient(135deg, rgba(0,0,0,.03), rgba(0,0,0,0));
  user-select:none;
}
.heroSlide img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  -webkit-user-drag:none;
  user-select:none;
  pointer-events:none;
}
.heroPh{
  width:78%;
  aspect-ratio:1/1;
  border-radius:18px;
  background:
    radial-gradient(40% 40% at 30% 30%, rgba(255,255,255,.75), transparent 60%),
    radial-gradient(50% 50% at 70% 70%, rgba(238,77,45,.22), transparent 60%),
    linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,.20));
  border:1px solid rgba(0,0,0,.06);
  box-shadow: 0 18px 50px rgba(0,0,0,.12);
  display:grid; place-items:center;
  text-align:center;
  padding:14px;
  color:#333;
}
.heroPh .t1{font-weight:1000;font-size:16px}
.heroPh .t2{font-size:12px;color:#555;margin-top:6px;line-height:1.45}

.labels{
  position:absolute; left:10px; top:10px;
  display:flex; gap:6px; flex-wrap:wrap;
  z-index:5;
}
.label{
  font-size:11px;
  padding:5px 8px;
  border-radius:999px;
  color:#fff;
  background: rgba(0,0,0,.42);
  border:1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  user-select:none;
  display:flex; gap:6px; align-items:center;
}
.label.hot{background: rgba(255,66,78,.88)}
.label.free{background: rgba(0,191,165,.88)}
.label.origin{background: rgba(30,136,229,.88)}

.dots{
  position:absolute;
  left:50%; bottom:10px;
  transform:translateX(-50%);
  display:flex; gap:6px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(8px);
  z-index:5;
  user-select:none;
}
.dot{width:7px;height:7px;border-radius:999px;background: rgba(255,255,255,.55);}
.dot.active{background:#fff}

.counter{
  position:absolute; right:10px; bottom:10px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(0,0,0,.28);
  color:#fff;
  font-weight:1000;
  font-size:12px;
  backdrop-filter: blur(8px);
  z-index:5;
  user-select:none;
}

/* Price/meta */
.titleLine{font-weight:1000;font-size:14px;line-height:1.25;}
.priceRow{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-top:10px;}
.price{font-size:30px;font-weight:1100;color: var(--shopee);line-height:1;}
.strike{display:inline-block;margin-top:6px;font-size:12px;color:#999;text-decoration:line-through;}
.rating{text-align:right;font-size:12px;color:#666;line-height:1.3;user-select:none;}
.rating .star{color:var(--gold)}
.tagRow{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;}
.tag{
  font-size:12px;padding:6px 10px;border-radius:10px;
  background:#f7f7f7;border:1px solid #eee;
  user-select:none;display:flex;gap:6px;align-items:center;
}
.tag.orange{
  background: rgba(238,77,45,.09);
  border-color: rgba(238,77,45,.22);
  color: var(--shopee);
  font-weight:1000;
}

/* Vouchers */
.voucherLine{
  display:flex; gap:10px;
  overflow:auto;
  padding-bottom:2px;
  scrollbar-width:none;
  touch-action: pan-x;
}
.voucherLine::-webkit-scrollbar{display:none}
.voucher{
  min-width: 270px;
  display:flex; gap:10px;
  align-items:center;
  padding:10px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(238,77,45,.12), rgba(255,115,55,.08));
  border:1px dashed rgba(238,77,45,.35);
  user-select:none;
}
.voucher .ic{
  width:44px;height:44px;border-radius:14px;
  display:grid; place-items:center;
  background: rgba(238,77,45,.16);
  color: var(--shopee);
  font-size:18px;
  font-weight:1000;
}
.voucher .t{font-weight:1000;font-size:13px}
.voucher .d{font-size:12px;color:#555;margin-top:2px}

/* Info rows */
.infoRow{
  padding:12px;
  display:flex;
  gap:10px;
  align-items:flex-start;
  border-top:1px solid var(--line);
  cursor:pointer;
  user-select:none;
}
.infoRow:first-child{border-top:none}
.infoRow .l{width:28px;display:flex;justify-content:center;color: var(--shopee);margin-top:2px;}
.infoRow .m{flex:1; min-width:0}
.infoRow .t{font-weight:1000}
.infoRow .s{margin-top:4px;font-size:12px;color:#666;line-height:1.35;}
.infoRow .r{width:24px;display:flex;justify-content:flex-end;color:#aaa;margin-top:2px;}

/* Tabs */
.tabs{
  display:flex;
  background:#fff;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
}
.tab{
  flex:1;
  padding:12px;
  font-weight:1000;
  color:#666;
  cursor:pointer;
  user-select:none;
  position:relative;
}
.tab.active{color: var(--shopee)}
.tab.active::after{
  content:"";
  position:absolute; left:12px; right:12px; bottom:0;
  height:2px;
  background: var(--shopee);
  border-radius:999px;
}
.pane{display:none}
.pane.active{display:block}

.descBox{
  background:#fafafa;
  border:1px solid #eee;
  border-radius: 14px;
  padding:12px;
  line-height:1.6;
  font-size:13px;
  color:#333;
}

/* Reviews */
.reviewTop{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;user-select:none;}
.ratingBig{display:flex;align-items:center;gap:8px;font-weight:1000;}
.ratingBig .n{font-size:22px}
.ratingBig .stars{color:var(--gold); font-size:13px}
.seeAll{color:#666;font-weight:900;font-size:13px;cursor:pointer;user-select:none;}

.reviewItem{padding:12px 0;border-top:1px solid #f0f0f0;}
.reviewHead{display:flex; gap:10px; align-items:flex-start;}
.ava{
  width:34px;height:34px;border-radius:999px;
  background:#eee;
  display:grid; place-items:center;
  font-weight:1000;
  color:#555;
  flex:0 0 auto;
  user-select:none;
}
.rMeta{flex:1; min-width:0}
.rName{font-weight:1000;font-size:13px}
.rStar{color:var(--gold); font-size:12px; margin-top:2px}
.rVariant{font-size:12px;color:#666;margin-top:6px}

.rText{
  margin-top:8px;
  font-size:13px;
  line-height:1.5;
  color:#333;
  display:-webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow:hidden;
  word-break:break-word;
}
.rText.expanded{-webkit-line-clamp: unset;display:block;}
.moreLess{
  margin-top:8px;
  color: var(--shopee);
  font-weight:1000;
  font-size:13px;
  cursor:pointer;
  user-select:none;
  display:inline-flex;
  gap:6px;
  align-items:center;
}

.rMedia{
  margin-top:10px;
  display:flex; gap:8px;
  overflow:auto;
  scrollbar-width:none;
  touch-action: pan-x;
}
.rMedia::-webkit-scrollbar{display:none}
.thumb{
  width:98px; height:98px;
  border-radius: 14px;
  background:
    radial-gradient(50% 50% at 30% 30%, rgba(238,77,45,.20), transparent 60%),
    radial-gradient(50% 50% at 70% 70%, rgba(30,136,229,.14), transparent 60%),
    linear-gradient(135deg, #fff, #f2f2f2);
  border:1px solid #eee;
  flex:0 0 auto;
  position:relative;
  cursor:pointer;
  user-select:none;
  overflow:hidden;
  display:grid;
  place-items:center;
  color:#555;
  font-weight:1000;
  font-size:12px;
}
.thumb img{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none;user-select:none;}
.thumb .plus{
  position:absolute; right:8px; bottom:8px;
  background: rgba(0,0,0,.55);
  color:#fff;
  font-size:12px;
  font-weight:1000;
  padding:6px 8px;
  border-radius: 12px;
  display:none;
}

/* Bottom bar */
.bbar{
  position:fixed;
  left:0; right:0; bottom:0;
  background:#fff;
  border-top:1px solid #eee;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  z-index:80;
}
.bbarIn{
  max-width:var(--maxw);
  margin:0 auto;
  display:flex; gap:10px; align-items:center;
}
.miniBtn{
  width:56px;height:56px;border-radius:14px;
  border:1px solid #eee;
  background:#fff;
  display:grid; place-items:center;
  cursor:pointer;
  user-select:none;
  position:relative;
}
.miniBtn i{font-size:18px;color:#333}
.miniBtn .c{
  position:absolute; top:-6px; right:-6px;
  min-width:18px;height:18px;
  padding:0 6px;
  border-radius:999px;
  background: var(--danger);
  color:#fff;
  font-size:11px;
  font-weight:1000;
  display:none;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.35);
}
.miniBtn.has .c{display:flex}

.buyBtn{
  flex:1;
  height:56px;
  border:none;
  border-radius: 14px;
  background: var(--shopee);
  color:#fff;
  font-weight:1100;
  font-size:16px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  box-shadow: 0 12px 22px rgba(238,77,45,.22);
  user-select:none;
}

.btnOutline{
  height:56px;
  padding:0 14px;
  border-radius:14px;
  border:1px solid rgba(238,77,45,.35);
  background: rgba(238,77,45,.08);
  color: var(--shopee);
  font-weight:1100;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
}
.btnOutline.full{width:100%}

/* Sheets */
.backdrop{
  position:fixed; inset:0;
  background: rgba(0,0,0,.55);
  display:none;
  z-index:90;
}
.sheet{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:0;
  width:min(var(--maxw), 100%);
  background:#fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -18px 40px rgba(0,0,0,.22);
  display:none;
  z-index:100;
  max-height: 84vh;
  overflow:auto;
}
.handle{
  width:44px;height:5px;border-radius:999px;
  background:#e6e6e6;
  margin:10px auto 8px;
}
.sheetHead{
  display:flex; align-items:flex-start; gap:12px;
  padding: 0 12px 12px;
  border-bottom:1px solid #f0f0f0;
}
.preview{
  width:74px;height:74px;border-radius:16px;
  background:
    radial-gradient(50% 50% at 30% 30%, rgba(238,77,45,.20), transparent 60%),
    radial-gradient(50% 50% at 70% 70%, rgba(30,136,229,.14), transparent 60%),
    linear-gradient(135deg, #fff, #f2f2f2);
  border:1px solid #eee;
  overflow:hidden;
  display:grid; place-items:center;
  font-weight:1000;
  color:#555;
  user-select:none;
  flex:0 0 auto;
}
.preview img{width:100%;height:100%;object-fit:cover;display:block}
.sheetMeta{flex:1; min-width:0}
.sheetPrice{font-size:22px;font-weight:1100;color: var(--shopee);line-height:1.2;}
.sheetSub{margin-top:6px;font-size:12px;color:#666;}
.closeX{
  width:36px;height:36px;border-radius:12px;
  border:1px solid #eee;
  display:grid; place-items:center;
  cursor:pointer;
  user-select:none;
  flex:0 0 auto;
}
.sheetBody{padding:12px}
.sheetTitle{font-weight:1100;margin-bottom:10px}
.chips{display:flex;flex-wrap:wrap;gap:10px;user-select:none;}
.chip{
  padding:10px 12px;border-radius:12px;
  border:1px solid #eee;background:#f6f6f6;
  font-weight:1000;font-size:13px;cursor:pointer;
}
.chip.active{
  background: rgba(238,77,45,.10);
  border-color: rgba(238,77,45,.35);
  color: var(--shopee);
  box-shadow: 0 10px 18px rgba(238,77,45,.10);
}
.qtyRow{margin-top:14px;display:flex;align-items:center;justify-content:space-between;gap:10px;user-select:none;}
.qtyCtl{display:flex;align-items:center;gap:10px}
.qbtn{
  width:34px;height:34px;border-radius:10px;
  border:1px solid #eee;background:#fff;
  display:grid;place-items:center;cursor:pointer;user-select:none;
}
.qnum{min-width:22px;text-align:center;font-weight:1100}

.sheetBottom{
  padding:12px;
  border-top:1px solid #f0f0f0;
  position:sticky;
  bottom:0;
  background:#fff;
}
.sheetBuy{
  width:100%;
  height:52px;
  border:none;
  border-radius: 14px;
  background: var(--shopee);
  color:#fff;
  font-weight:1100;
  font-size:16px;
  cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  gap:10px;
  user-select:none;
}
.sheetBottomRow{display:flex; gap:10px}
.sheetBottomRow .full{flex:1}

/* Cart UI */
.cartItem{
  display:flex;
  gap:10px;
  padding:10px;
  border:1px solid #f0f0f0;
  border-radius:14px;
  background:#fff;
  margin-bottom:10px;
}
.cartItem .ciImg{
  width:74px;height:74px;border-radius:16px;
  border:1px solid #eee;
  background:
    radial-gradient(50% 50% at 30% 30%, rgba(238,77,45,.20), transparent 60%),
    radial-gradient(50% 50% at 70% 70%, rgba(30,136,229,.14), transparent 60%),
    linear-gradient(135deg, #fff, #f2f2f2);
  display:grid; place-items:center;
  font-weight:1000;color:#555;
  overflow:hidden;
  flex:0 0 auto;
}
.cartItem .ciImg img{width:100%;height:100%;object-fit:cover;display:block}
.cartItem .ciMain{flex:1;min-width:0}
.cartItem .ciTitle{font-weight:1100;font-size:13px;line-height:1.25}
.cartItem .ciMeta{margin-top:4px;font-size:12px;color:#666}
.cartItem .ciBottom{margin-top:10px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.cartItem .ciPrice{font-weight:1100;color:var(--shopee)}
.cartItem .ciActions{display:flex;align-items:center;gap:10px}
.trashBtn{
  width:34px;height:34px;border-radius:10px;
  border:1px solid #eee;background:#fff;
  display:grid;place-items:center;cursor:pointer;
}
.cartEmpty{
  padding:18px;
  border:1px dashed #ddd;
  border-radius:14px;
  background:#fafafa;
  color:#666;
  text-align:center;
}
.cartTotalRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

/* Checkout */
.formGrid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.field{display:flex;flex-direction:column;gap:6px}
.field span{font-size:12px;color:#666;font-weight:900}
.field input{
  height:44px;
  border-radius:12px;
  border:1px solid #eee;
  padding:0 12px;
  outline:none;
  font-size:14px;
  background:#fff;
}
.field input:focus{border-color: rgba(238,77,45,.35); box-shadow: 0 0 0 4px rgba(238,77,45,.10)}
.field.full{grid-column:1/-1}

.payRow{display:flex;gap:10px;flex-wrap:wrap}
.payBtn{
  height:44px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid #eee;
  background:#fff;
  font-weight:1000;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:8px;
}
.payBtn.active{
  border-color: rgba(238,77,45,.35);
  background: rgba(238,77,45,.08);
  color: var(--shopee);
}

/* Lightbox */
.lightbox{
  position:fixed; inset:0;
  background: rgba(0,0,0,.72);
  display:none;
  z-index:120;
  align-items:center;
  justify-content:center;
  padding:16px;
}
.lightbox .imgWrap{
  width:min(var(--maxw), 100%);
  border-radius: 16px;
  overflow:hidden;
  background:#000;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
}
.lightbox img{width:100%;height:auto;display:block;}
.lightbox .lbTop{
  position:absolute;
  top:12px;
  width:min(var(--maxw), calc(100% - 32px));
  display:flex;
  justify-content:flex-end;
  gap:10px;
}
.lbBtn{
  width:40px;height:40px;border-radius:14px;
  background: rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.18);
  color:#fff;
  display:grid; place-items:center;
  cursor:pointer;
  user-select:none;
  backdrop-filter: blur(10px);
}

/* Toast */
.toast{
  position:fixed;
  left:50%; transform:translateX(-50%);
  bottom:92px;
  background: rgba(0,0,0,.78);
  color:#fff;
  padding:10px 12px;
  border-radius: 14px;
  font-size:13px;
  display:none;
  z-index:200;
  max-width:min(var(--maxw), calc(100% - 20px));
}
