:root {
  --brand1: #7c3aed;
  --brand2: #ec4899;
  --brand3: #f59e0b;
  --grad: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  --grad-soft: linear-gradient(135deg, #ede9fe 0%, #fce7f3 100%);
  --ink: #0f172a;
  --muted: #64748b;
  --line: #ececf2;
  --bg: #fafafb;
  --card: #ffffff;
  --ok: #059669;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(17, 12, 46, 0.08);
  --shadow-lg: 0 18px 50px rgba(17, 12, 46, 0.14);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.brandtext {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 800; letter-spacing: -0.5px;
}
button { font-family: inherit; cursor: pointer; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line);
}
.header .wrap { display: flex; align-items: center; gap: 18px; height: 66px; }
.logo { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.logo .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 4px rgba(124,58,237,.15); }
.nav { display: flex; gap: 6px; margin-left: 8px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; }
.nav a:hover, .nav a.active { color: var(--ink); background: var(--grad-soft); }
.search { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.search input {
  width: 100%; padding: 11px 14px 11px 40px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; font-size: 14px; outline: none;
}
.search input:focus { border-color: var(--brand1); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.search svg { position: absolute; left: 13px; top: 11px; color: var(--muted); }
.hicons { display: flex; gap: 6px; align-items: center; }
.iconbtn {
  position: relative; border: 1px solid var(--line); background: #fff; width: 42px; height: 42px;
  border-radius: 12px; display: grid; place-items: center; color: var(--ink);
}
.iconbtn:hover { border-color: var(--brand1); color: var(--brand1); }
.badge-count {
  position: absolute; top: -6px; right: -6px; background: var(--brand2); color: #fff;
  font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px;
  display: grid; place-items: center; padding: 0 4px;
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 30px; align-items: center; padding: 46px 20px 30px; }
.hero h1 { font-size: 46px; line-height: 1.05; margin: 10px 0 14px; letter-spacing: -1.5px; }
.hero p { color: var(--muted); font-size: 17px; max-width: 460px; margin: 0 0 22px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--grad-soft); color: var(--brand1); font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 999px; }
.btn { border: 0; border-radius: 12px; padding: 13px 22px; font-weight: 700; font-size: 15px; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px rgba(124,58,237,.28); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn.block { width: 100%; }
.hero-art { position: relative; height: 340px; }
.blob { position: absolute; border-radius: 40% 60% 60% 40%/50%; filter: blur(2px); opacity: .9; }
.hero-card { position: absolute; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; width: 165px; }
.hero-card img { height: 130px; object-fit: cover; width: 100%; }
.hero-card .p { padding: 8px 10px; font-size: 12px; font-weight: 700; }
.hero-card .pr { color: var(--brand1); }

/* ---------- Category strip ---------- */
.cats { display: flex; gap: 12px; overflow-x: auto; padding: 8px 0 4px; }
.cat {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; font-weight: 700; color: var(--ink);
}
.cat .emoji { font-size: 22px; }
.cat:hover, .cat.active { border-color: transparent; background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(124,58,237,.25); }

/* ---------- Section ---------- */
.section { padding: 30px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-size: 26px; margin: 0; letter-spacing: -0.8px; }
.section-head .sub { color: var(--muted); font-size: 14px; }
.filters { display: flex; gap: 10px; align-items: center; }
.select { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; font-weight: 600; font-size: 14px; color: var(--ink); }

/* ---------- Product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .18s, box-shadow .18s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .imgwrap { position: relative; aspect-ratio: 1/1; background: var(--grad-soft); overflow: hidden; }
.card .imgwrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .imgwrap img { transform: scale(1.06); }
.card .fallback { width: 100%; height: 100%; display: grid; place-items: center; font-size: 54px; }
.card .badge { position: absolute; top: 12px; left: 12px; background: #111827; color: #fff; font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.card .badge.sale { background: var(--brand2); }
.card .wish { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.9); border: 0; display: grid; place-items: center; color: var(--muted); }
.card .wish.on { color: var(--brand2); }
.card .body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .cat-tag { font-size: 11px; font-weight: 700; color: var(--brand1); text-transform: uppercase; letter-spacing: .5px; }
.card h3 { font-size: 15px; margin: 0; line-height: 1.3; }
.card .rate { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.card .rate .star { color: #f59e0b; }
.card .price { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.card .price .now { font-size: 18px; font-weight: 800; }
.card .price .was { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.card .price .off { font-size: 12px; font-weight: 700; color: var(--ok); }
.card .add { margin-top: 10px; border: 0; border-radius: 11px; padding: 11px; font-weight: 700; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; }
.card .add:hover { background: var(--brand1); }

/* ---------- Trust strip ---------- */
.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 10px 0 0; }
.trust .t { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; gap: 12px; align-items: center; }
.trust .t .ic { font-size: 24px; }
.trust .t b { display: block; font-size: 14px; } .trust .t span { color: var(--muted); font-size: 12px; }

/* ---------- Drawer / cart ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 90; }
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 420px; max-width: 92vw; background: #fff;
  z-index: 100; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .28s ease;
  display: flex; flex-direction: column;
}
.drawer.show { transform: translateX(0); }
.drawer h3 { margin: 0; font-size: 18px; }
.drawer .dhead { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.drawer .ditems { flex: 1; overflow-y: auto; padding: 8px 20px; }
.citem { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.citem img { width: 68px; height: 68px; border-radius: 12px; object-fit: cover; background: var(--grad-soft); }
.citem .ci-b { flex: 1; }
.citem .ci-b h4 { margin: 0 0 4px; font-size: 14px; }
.citem .qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.citem .qty button { border: 0; background: #fff; width: 28px; height: 28px; font-weight: 700; }
.citem .qty span { min-width: 26px; text-align: center; font-size: 13px; font-weight: 700; }
.citem .rm { border: 0; background: none; color: var(--muted); font-size: 12px; }
.drawer .dfoot { padding: 18px 20px; border-top: 1px solid var(--line); }
.rowline { display: flex; justify-content: space-between; margin: 6px 0; font-size: 14px; }
.rowline.total { font-weight: 800; font-size: 18px; margin-top: 10px; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty .big { font-size: 46px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 110; display: none; place-items: center; padding: 20px; }
.modal.show { display: grid; }
.modal .box { background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 460px; padding: 26px; max-height: 92vh; overflow-y: auto; }
.modal.wide .box { max-width: 720px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #334155; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; font-size: 14px; font-family: inherit; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--brand1); box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tabbar { display: flex; gap: 8px; margin-bottom: 16px; }
.tabbar button { flex: 1; padding: 10px; border-radius: 11px; border: 1px solid var(--line); background: #fff; font-weight: 700; }
.tabbar button.active { background: var(--grad); color: #fff; border-color: transparent; }
.pay-opt { display: flex; gap: 10px; margin-bottom: 14px; }
.pay-opt label { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; font-weight: 600; font-size: 13px; }
.pay-opt input { margin-right: 8px; }
.pay-opt label.sel { border-color: var(--brand1); background: var(--grad-soft); }

/* ---------- Product detail ---------- */
.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 30px 0; }
.pdp .gallery { border-radius: var(--radius); overflow: hidden; background: var(--grad-soft); aspect-ratio: 1/1; }
.pdp .gallery img { width: 100%; height: 100%; object-fit: cover; }
.pdp h1 { font-size: 32px; margin: 8px 0; letter-spacing: -1px; }
.pdp .pprice { display: flex; align-items: baseline; gap: 12px; margin: 14px 0; }
.pdp .pprice .now { font-size: 30px; font-weight: 800; }
.pdp .pprice .was { text-decoration: line-through; color: var(--muted); }
.pdp .pprice .off { background: #ecfdf5; color: var(--ok); font-weight: 700; padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.pdp .desc { color: var(--muted); line-height: 1.6; margin: 12px 0 20px; }
.feat { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.feat span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 600; }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .3s; display: flex; gap: 10px; align-items: center; }
.toast.ok { background: #065f46; } .toast.err { background: #991b1b; }
@keyframes pop { from { transform: translateY(12px); opacity: 0; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 40px; background: #fff; }
.footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; padding: 40px 20px; }
.footer h4 { font-size: 14px; margin: 0 0 12px; } .footer a, .footer p { color: var(--muted); font-size: 13px; display: block; margin: 7px 0; }
.footer .copy { border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 13px; padding: 16px; }

.center { text-align: center; }
.muted { color: var(--muted); }
.skeleton { background: linear-gradient(90deg,#f1f1f4,#e9e9ef,#f1f1f4); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); aspect-ratio: 1/1; }
@keyframes sk { to { background-position: -200% 0; } }
.spin { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero .wrap { grid-template-columns: 1fr; } .hero-art { display: none; }
  .hero h1 { font-size: 34px; }
  .trust { grid-template-columns: repeat(2, 1fr); }
  .pdp { grid-template-columns: 1fr; }
  .footer .wrap { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .search { display: none; }
  .card .body { padding: 10px; } .card h3 { font-size: 13px; }
}
