:root{
  --bg:#f5f6fb; --card:#ffffff; --ink:#191b2a; --muted:#6b7189;
  --accent:#6c5ce7; --accent2:#8f7bff; --accent-ink:#ffffff;
  --line:#e7e9f4; --ok:#12a06a; --warn:#d9832a; --danger:#e05666;
  --radius:16px; --shadow:0 8px 30px rgba(30,32,80,.08); --shadow-sm:0 2px 10px rgba(30,32,80,.06);
  --maxw:1160px;
}
*{box-sizing:border-box}
html,body{margin:0}
body{font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg); color:var(--ink); line-height:1.5; -webkit-font-smoothing:antialiased}
a{color:inherit; text-decoration:none}
img{max-width:100%}
.wrap{max-width:var(--maxw); margin:0 auto; padding:0 20px}

/* --- top bar --- */
.nav{position:sticky; top:0; z-index:40; background:rgba(255,255,255,.86);
  backdrop-filter:saturate(1.4) blur(10px); border-bottom:1px solid var(--line)}
.nav .wrap{display:flex; align-items:center; gap:20px; height:64px}
.brand{display:flex; align-items:center; gap:10px; font-weight:800; font-size:19px; letter-spacing:-.02em}
.brand .logo{width:30px; height:30px; border-radius:9px; display:grid; place-items:center;
  background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#fff; font-weight:900}
.nav .cats{display:flex; gap:6px; flex:1; overflow:auto}
.nav .cats a{padding:8px 12px; border-radius:10px; color:var(--muted); font-size:14px; white-space:nowrap; font-weight:600}
.nav .cats a:hover{background:var(--bg); color:var(--ink)}
.nav .actions{display:flex; align-items:center; gap:10px}
.pill{display:inline-flex; align-items:center; gap:8px; padding:9px 14px; border-radius:11px;
  border:1px solid var(--line); background:#fff; font-weight:600; font-size:14px; cursor:pointer}
.pill:hover{border-color:var(--accent)}
.pill.primary{background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#fff; border:none}
.pill.primary:hover{filter:brightness(1.05)}

/* --- hero --- */
.hero{background:linear-gradient(135deg,#ece9ff,#f4f0ff 60%,#eef6ff); border-bottom:1px solid var(--line)}
.hero .wrap{display:grid; grid-template-columns:1.2fr .9fr; gap:24px; padding:52px 20px; align-items:center}
.hero h1{font-size:40px; line-height:1.08; letter-spacing:-.03em; margin:0 0 12px}
.hero p{font-size:17px; color:var(--muted); margin:0 0 22px; max-width:460px}
.hero .cta{display:flex; gap:12px; flex-wrap:wrap}
.hero .art{aspect-ratio:4/3; border-radius:20px; background:linear-gradient(135deg,var(--accent),var(--accent2));
  box-shadow:var(--shadow); display:grid; place-items:center; color:#fff; font-size:120px}
.badge{display:inline-block; padding:6px 12px; border-radius:999px; background:#fff;
  border:1px solid var(--line); font-size:13px; font-weight:700; color:var(--accent); margin-bottom:16px}

/* --- sections --- */
.section{padding:36px 0}
.section h2{font-size:22px; letter-spacing:-.02em; margin:0 0 18px; display:flex; align-items:center; gap:10px}
.chips{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:22px}
.chip{padding:8px 14px; border-radius:999px; border:1px solid var(--line); background:#fff;
  font-size:13px; font-weight:600; cursor:pointer; color:var(--muted)}
.chip.active,.chip:hover{background:var(--accent); color:#fff; border-color:var(--accent)}

/* --- product grid --- */
.grid{display:grid; grid-template-columns:repeat(4,1fr); gap:18px}
.card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  overflow:hidden; box-shadow:var(--shadow-sm); transition:transform .12s, box-shadow .12s; display:flex; flex-direction:column}
.card:hover{transform:translateY(-3px); box-shadow:var(--shadow)}
.thumb{position:relative; overflow:hidden; aspect-ratio:1/1; display:grid; place-items:center; font-size:64px; color:#fff}
.thumb .ph{line-height:1}
.thumb img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover}
.card .body{padding:14px; display:flex; flex-direction:column; gap:6px; flex:1}
.card .cat{font-size:12px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.04em}
.card .title{font-weight:700; font-size:15px; line-height:1.25}
.card .row{margin-top:auto; display:flex; align-items:center; justify-content:space-between; gap:8px}
.price{font-weight:800; font-size:18px}
.rating{font-size:13px; color:var(--warn); font-weight:700}
.stock{font-size:12px; color:var(--muted)}
.sku{font-size:11px; color:#9aa0b8; font-family:ui-monospace,Menlo,monospace}

/* --- generic --- */
.panel{background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:22px; box-shadow:var(--shadow-sm)}
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:11px 18px; border-radius:12px;
  border:none; background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#fff; font-weight:700; font-size:15px; cursor:pointer}
.btn.ghost{background:#fff; color:var(--ink); border:1px solid var(--line)}
.btn:hover{filter:brightness(1.04)}
.input{width:100%; padding:12px 14px; border:1px solid var(--line); border-radius:12px; font-size:15px; font-family:inherit; background:#fff}
.input:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(108,92,231,.15)}
.label{font-size:13px; font-weight:700; color:var(--muted); margin-bottom:6px; display:block}
table{width:100%; border-collapse:collapse; font-size:14px}
th,td{text-align:left; padding:11px 10px; border-bottom:1px solid var(--line)}
th{font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted)}
.tag{display:inline-block; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:700}
.tag.green{background:#e4f7ee; color:var(--ok)} .tag.gray{background:#eef0f6; color:var(--muted)}
.tag.blue{background:#e8efff; color:#3d6bd6} .tag.red{background:#fdeaec; color:var(--danger)}
.muted{color:var(--muted)}
.warnbar{background:#fff7e9; border:1px solid #f5e2bd; color:#8a6420; padding:9px 14px;
  border-radius:12px; font-size:13px; margin:14px 0}

footer{border-top:1px solid var(--line); background:#fff; margin-top:40px}
footer .wrap{display:flex; justify-content:space-between; gap:20px; padding:28px 20px; color:var(--muted); font-size:13px; flex-wrap:wrap}

/* --- chat widget --- */
#sw-fab{position:fixed; right:22px; bottom:22px; z-index:60; width:60px; height:60px; border-radius:50%;
  background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#fff; border:none; cursor:pointer;
  box-shadow:0 10px 30px rgba(108,92,231,.45); font-size:26px; display:grid; place-items:center}
#sw-fab:hover{transform:scale(1.05)}
#sw-chat{position:fixed; right:22px; bottom:94px; z-index:60; width:390px; max-width:calc(100vw - 28px);
  height:560px; max-height:calc(100vh - 130px); background:#fff; border:1px solid var(--line);
  border-radius:20px; box-shadow:var(--shadow); display:none; flex-direction:column; overflow:hidden}
#sw-chat.open{display:flex}
.sw-head{background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#fff; padding:14px 16px; display:flex; align-items:center; gap:10px}
.sw-head .t{font-weight:800; font-size:15px} .sw-head .s{font-size:12px; opacity:.85}
.sw-head select{margin-left:auto; background:rgba(255,255,255,.18); color:#fff; border:1px solid rgba(255,255,255,.35);
  border-radius:9px; padding:6px 8px; font-size:12px}
.sw-head select option{color:#000}
.sw-head .x{background:transparent; border:none; color:#fff; font-size:20px; cursor:pointer; padding:0 4px}
.sw-log{flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:10px; background:var(--bg)}
.sw-msg{max-width:86%; padding:9px 13px; border-radius:14px; font-size:14px; white-space:pre-wrap; word-wrap:break-word; box-shadow:var(--shadow-sm)}
.sw-msg.user{align-self:flex-end; background:var(--accent); color:#fff; border-bottom-right-radius:4px}
.sw-msg.bot{align-self:flex-start; background:#fff; border-bottom-left-radius:4px}
.sw-msg.meta{align-self:center; background:transparent; box-shadow:none; color:var(--muted); font-size:12px}
.sw-msg img{border-radius:8px; margin-bottom:6px; max-width:180px}
.sw-hints{padding:10px 12px; border-top:1px solid var(--line); background:#fff; display:none; flex-wrap:wrap; gap:6px}
.sw-hints.show{display:flex}
.sw-hints b{width:100%; font-size:12px; color:var(--muted)}
.sw-hint{font-size:12px; padding:6px 10px; border:1px solid var(--line); border-radius:999px; cursor:pointer; background:#fff}
.sw-hint:hover{border-color:var(--accent); color:var(--accent)}
.sw-input{display:flex; gap:8px; align-items:flex-end; padding:12px; border-top:1px solid var(--line); background:#fff}
.sw-input textarea{flex:1; resize:none; height:42px; max-height:120px; border:1px solid var(--line); border-radius:12px; padding:10px; font:inherit; font-size:14px}
.sw-input .icon{width:42px; height:42px; border-radius:12px; border:1px solid var(--line); background:#fff; cursor:pointer; font-size:18px; display:grid; place-items:center}
.sw-input .send{width:42px; height:42px; border-radius:12px; border:none; background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#fff; font-size:18px; cursor:pointer; display:grid; place-items:center}

@media(max-width:900px){ .grid{grid-template-columns:repeat(2,1fr)} .hero .wrap{grid-template-columns:1fr} .hero .art{display:none} }
@media(max-width:560px){ .grid{grid-template-columns:1fr 1fr} .nav .cats{display:none} }
