:root {
  --orange: #ff712f;
  --orange-soft: #fff1e8;
  --orange-bg: #fff8f3;
  --ink: #222;
  --ink-2: #333;
  --ink-3: #444;
  --muted: #888;
  --muted-2: #adadad;
  --line: #e5e6eb;
  --line-soft: #f0f1f4;
  --page: #f5f5f5;
  --side: #fafafa;
  --green: #2f7d5c;
  --green-soft: #eaf7f1;
  --radius: 12px;
  --phone-w: 375px;
  --phone-h: 812px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 800px at 12% -10%, #fff3ea 0%, rgba(255, 243, 234, 0) 55%),
    radial-gradient(900px 700px at 100% 10%, #eaf1ff 0%, rgba(234, 241, 255, 0) 50%),
    #e9edf2;
  color: var(--ink);
  font-family: "PingFang SC", "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; }
button { cursor: pointer; }

.demo-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 48px 32px 64px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 48px;
}

/* ---------- side panel ---------- */

.demo-panel {
  width: 240px;
  flex: 0 0 240px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 24px 70px rgba(31, 45, 61, 0.12);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 32px;
}

.demo-panel h1 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.switch-row input {
  width: 14px;
  height: 14px;
  accent-color: var(--orange);
  margin: 0;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}

/* ---------- phone ---------- */

.phone-stage {
  flex: 0 0 auto;
  position: sticky;
  top: 32px;
}

.phone {
  width: var(--phone-w);
  height: var(--phone-h);
  background: var(--page);
  border-radius: 34px;
  box-shadow:
    0 0 0 1px rgba(17, 24, 39, 0.06),
    0 30px 80px rgba(17, 24, 39, 0.22),
    0 6px 20px rgba(17, 24, 39, 0.08);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.phone-top {
  height: 185px;
  flex: 0 0 185px;
  background: linear-gradient(180deg, #fefdf8 0%, #fdfbf3 100%);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.status-bar {
  height: 44px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  color: #080808;
}

.status-time { letter-spacing: 0.01em; }

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.signal {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 11px;
}
.signal i {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: #111;
}
.signal i:nth-child(1) { height: 4px; }
.signal i:nth-child(2) { height: 6px; }
.signal i:nth-child(3) { height: 8px; }
.signal i:nth-child(4) { height: 10px; }

.wifi { width: 16px; height: 12px; }

.battery {
  width: 24px;
  height: 12px;
  border: 1.5px solid #111;
  border-radius: 3px;
  padding: 1.5px;
  display: inline-flex;
  align-items: center;
  position: relative;
}
.battery::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 3px;
  width: 2px;
  height: 4px;
  background: #111;
  border-radius: 0 1px 1px 0;
}
.battery i {
  display: block;
  width: 72%;
  height: 100%;
  background: #111;
  border-radius: 1px;
}

.search-row {
  height: 50px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box {
  flex: 1;
  height: 32px;
  border: 1px solid var(--orange);
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: #888;
  font-size: 14px;
  min-width: 0;
}
.search-box img { width: 14px; height: 14px; flex-shrink: 0; }
.search-box span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.search-actions { display: flex; align-items: center; gap: 8px; }

.round-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #f0f1f4;
  background: #fff;
  color: #333;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}
.round-btn.dots { letter-spacing: 1px; padding-bottom: 4px; }
.round-btn.ring::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #333;
  display: block;
}

.category-nav-wrap {
  position: relative;
  height: 85px;
  margin-top: 6px;
  display: flex;
  align-items: flex-start;
  padding: 0 16px;
}

.category-nav {
  display: flex;
  gap: 12px;
  padding-right: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.category-nav::-webkit-scrollbar { display: none; }

.category-item {
  width: 52px;
  flex: 0 0 52px;
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.category-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid transparent;
  background: #f9f9f9;
  display: block;
}
.category-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.category-item.active .category-icon { border-color: var(--orange); }
.category-icon.placeholder {
  display: grid;
  place-items: center;
  color: #b0b7c0;
  font-size: 10px;
}

.category-label {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  color: #333;
  white-space: nowrap;
}
.category-item.active .category-label {
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  border-radius: 10px;
  padding: 2px 4px;
}

.category-all {
  position: absolute;
  right: 4px;
  top: 0;
  width: 12px;
  border: none;
  background: transparent;
  color: var(--orange);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}
.category-all img { width: 9px; height: 9px; }

.page-body {
  flex: 1;
  min-height: 0;
  margin-top: 0;
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  display: flex;
}

/* ---------- left sidebar ---------- */

.side-nav {
  width: 88px;
  flex: 0 0 88px;
  background: var(--side);
  overflow-y: auto;
  padding: 16px 14px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: none;
}
.side-nav::-webkit-scrollbar { display: none; }

.side-item {
  flex-shrink: 0;
  width: 60px;
  border: none;
  background: transparent;
  padding: 10px 0;
  color: #3d3d3d;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  border-radius: 8px;
  position: relative;
  word-break: break-word;
  transition: color 0.15s ease, background 0.15s ease;
}
.side-item:hover { background: rgba(255, 113, 47, 0.04); }
.side-item.selected {
  color: var(--orange);
  font-size: 15px;
  font-weight: 500;
  background: #fff;
  width: 88px;
  margin-left: -14px;
  padding-left: 0;
  border-radius: 0;
}
.side-item.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 40px;
  border-radius: 0 2px 2px 0;
  background: var(--orange);
}

/* ---------- product pane ---------- */

.product-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.context-bar {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 0.5px solid #e5e6eb;
}
.context-bar[hidden] { display: none; }

.tag-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
}

.context-tag {
  min-height: 30px;
  border: none;
  border-radius: 4px;
  background: #f2f2f2;
  color: #212121;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
}
.context-tag.active {
  background: rgba(255, 113, 47, 0.1);
  color: var(--orange);
  font-weight: 600;
}
.context-tag.more {
  background: transparent;
  color: #757575;
  gap: 4px;
  padding: 5px 2px;
}
.context-tag.more img { width: 12px; height: 12px; flex-shrink: 0; }

.tag-collapse {
  width: 100%;
  height: 44px;
  border: none;
  border-top: 0.5px solid #e5e6eb;
  background: #fff;
  color: #757575;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
}
.tag-collapse img { width: 12px; height: 12px; transform: rotate(180deg); }

.sort-bar {
  height: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 8px;
  background: #fff;
  border-bottom: 0.5px solid #e5e6eb;
}

.sort-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: #212121;
  font-size: 14px;
  font-weight: 400;
  padding: 0;
  line-height: 1.4;
  white-space: nowrap;
}
.sort-btn[data-sort="default"] { justify-content: flex-start; }
.sort-btn[data-sort="sales"] { justify-content: center; }
.sort-btn[data-sort="price"] { justify-content: flex-end; }
.sort-btn img { width: 14px; height: 14px; flex-shrink: 0; transition: transform 0.15s ease; }
.sort-btn.active { color: var(--orange); font-weight: 500; }
.sort-btn.desc img { transform: rotate(180deg); }
.sort-btn[data-sort="sales"] img { display: none; }
.sort-btn[data-sort="sales"].active img { display: block; }

.product-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 12px 28px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.product-list::-webkit-scrollbar { display: none; }

.tag-section {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #9aa3ad;
  padding: 2px 0 0;
}
.tag-section::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.product-card {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  min-height: 91px;
  position: relative;
}

.product-media {
  width: 90px;
  height: 90px;
  flex: 0 0 90px;
  border-radius: 8px;
  overflow: hidden;
  background: #d9d9d9;
  position: relative;
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: linear-gradient(135deg, #f3f5f7 0%, #e5e9ee 100%);
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}
.badge-soft {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 4px;
  border-radius: 2px;
  background: #ffefe9;
  color: var(--orange);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.soldout-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.42);
}
.soldout-overlay span {
  display: inline-block;
  transform: rotate(-25deg);
  background: rgba(60, 60, 60, 0.58);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 4px;
}

.product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.product-name {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.product-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.tag-supplier,
.tag-label {
  font-size: 10px;
  line-height: 1;
  padding: 3px 4px;
  border-radius: 2px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag-supplier { color: var(--orange); background: #fff; border: 0.5px solid rgba(255, 113, 47, 0.5); font-weight: 500; }
.tag-label { color: var(--orange); background: #fff; border: 0.5px solid rgba(255, 113, 47, 0.5); }

.product-stock {
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
  margin-top: 3px;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.price-main {
  display: flex;
  align-items: baseline;
  color: var(--orange);
  font-family: "DIN Alternate", "MiSans", "Helvetica Neue", sans-serif;
  white-space: nowrap;
  min-width: 0;
}
.price-main .currency { font-size: 12px; font-weight: 600; margin-right: 1px; }
.price-main .int { font-size: 20px; font-weight: 600; line-height: 1; }
.price-main .dot { font-size: 16px; font-weight: 600; }
.price-main .dec { font-size: 12px; font-weight: 600; }
.price-main .unit {
  font-family: "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: #adadad;
  margin-left: 2px;
}

.price-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.2;
  color: #888;
  font-variant-numeric: tabular-nums;
}
.price-detail .price-gross { color: #888; }
.price-detail .price-net { color: #888; }
.phone:not(.show-net) .price-detail .price-net { display: none; }

.multi-btn {
  height: 27px;
  padding: 0 10px;
  border: none;
  border-radius: 13.5px;
  background: linear-gradient(161deg, #ff712f 14%, #ff9665 85%);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  flex-shrink: 0;
}

.spec-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.spec-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.supplier-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  min-width: 0;
}
.supplier-row .tag-supplier { flex-shrink: 0; }
.supplier-name {
  font-size: 12px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.add-btn {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(161deg, #ff712f 14%, #ff9665 85%);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  padding: 0 0 2px;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(255, 113, 47, 0.25);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.step-btn {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1px solid var(--orange);
  background: #fff;
  color: var(--orange);
  font-size: 18px;
  line-height: 1;
  padding: 0 0 2px;
  display: grid;
  place-items: center;
}
.step-btn.plus { background: var(--orange); color: #fff; }
.step-count {
  min-width: 24px;
  text-align: center;
  font-size: 18px;
  color: var(--ink-2);
  font-family: "DIN Alternate", "MiSans", "Helvetica Neue", sans-serif;
  font-variant-numeric: tabular-nums;
}

.soldout-note {
  font-size: 12px;
  color: #9aa3ad;
  white-space: nowrap;
}

.empty-state {
  padding: 48px 12px;
  text-align: center;
  font-size: 13px;
  color: #9aa3ad;
}

/* ---------- bottom cart bar ---------- */

.cart-bar {
  flex: 0 0 54px;
  height: 54px;
  background: #fff;
  box-shadow: 0 -4px 6px rgba(61, 64, 76, 0.06);
  display: flex;
  align-items: center;
  padding: 0 12px 0 14px;
  position: relative;
  z-index: 4;
}

.cart-entry {
  position: relative;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: none;
  background: transparent;
  padding: 0;
}
.cart-entry img { width: 26px; height: 26px; display: block; }

.cart-badge {
  position: absolute;
  left: 19px;
  top: -9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 20px;
  background: #e94c43;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  text-align: center;
}

.cart-total { margin-left: 98px; min-width: 0; }

.cart-total-line {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #000;
  white-space: nowrap;
}
.cart-total-line span {
  font-family: "DIN Alternate", "MiSans", "Helvetica Neue", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--orange);
}

.cart-total-note {
  margin: 0 0 0 65px;
  font-size: 10px;
  line-height: 1.2;
  color: #adadad;
  white-space: nowrap;
}

.checkout-btn {
  margin-left: auto;
  width: 108px;
  height: 38px;
  flex: 0 0 108px;
  border: none;
  border-radius: 19px;
  padding: 0;
  background: #ff712f url("assets/checkout-btn.svg") center / 100% 100% no-repeat;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}

/* ---------- bottom tab bar ---------- */

.tab-bar {
  flex: 0 0 84px;
  height: 84px;
  background: #fff;
  border-top: 0.5px solid #e0e0e0;
  display: flex;
  align-items: flex-start;
  padding-top: 7.5px;
  z-index: 4;
}

.tab-item {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #c2c2c2;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
}
.tab-item img { width: 24px; height: 24px; display: block; }
.tab-item.active { color: var(--orange); }

.home-indicator {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: #111;
  opacity: 0.85;
  z-index: 5;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 150px;
  transform: translate(-50%, 8px);
  max-width: 280px;
  padding: 8px 14px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .demo-shell {
    flex-direction: column;
    align-items: center;
    padding: 28px 16px 48px;
    gap: 28px;
  }
  .demo-panel {
    width: 100%;
    max-width: 420px;
    flex: 0 0 auto;
    position: static;
  }
  .phone-stage { position: static; }
}

@media (max-width: 420px) {
  .demo-shell { padding: 0 0 32px; gap: 0; }
  .demo-panel {
    max-width: none;
    border-radius: 0 0 22px 22px;
    padding: 20px 18px;
  }
  .phone {
    width: 100%;
    max-width: var(--phone-w);
    height: var(--phone-h);
    border-radius: 0;
    box-shadow: none;
  }
}
