:root {
  --orange: #f56400;
  --orange-dark: #d4541f;
  --ink: #1a1a1a;
  --text: #2c2c2c;
  --muted: #767676;
  --line: #e1e3df;
  --bg: #ffffff;
  --bg-soft: #f6f6f4;
  --bg-card: #fafaf8;
  --star: #f6b04a;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 14px rgba(0,0,0,0.04);
  --crypto: #f7931a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* Top bar */
.topbar {
  background: #161616;
  color: #fff;
  font-size: 13px;
  padding: 7px 0;
}
.topbar-inner { max-width: 1320px; margin: 0 auto; padding: 0 24px; text-align: center; letter-spacing: 0.2px; }

/* Header */
.header {
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  color: var(--orange);
  white-space: nowrap;
}
.logo-mark { font-size: 20px; }
.logo-text em { color: var(--ink); font-style: normal; font-weight: 800; }

.search {
  flex: 1;
  display: flex;
  max-width: 720px;
  border: 2px solid var(--orange);
  border-radius: 40px;
  overflow: hidden;
  background: #fff;
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 20px;
  font-size: 15px;
  background: transparent;
}
.search-btn {
  background: var(--orange);
  border: none;
  color: #fff;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-btn:hover { background: var(--orange-dark); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-link { font-size: 14px; font-weight: 600; color: var(--ink); }
.nav-link:hover { color: var(--orange); }
.icon-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--ink);
  padding: 6px;
  display: flex;
  align-items: center;
}
.icon-btn:hover { color: var(--orange); }
.badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Category strip */
.cat-strip {
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.cat-strip-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-strip-inner::-webkit-scrollbar { display: none; }
.cat-chip {
  white-space: nowrap;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.cat-chip:hover { color: var(--ink); }
.cat-chip.active { color: var(--ink); border-bottom-color: var(--orange); }

/* Page head */
.page-head { background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.page-head-inner { max-width: 1320px; margin: 0 auto; padding: 22px 24px 18px; }
.breadcrumb { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.breadcrumb a:hover { color: var(--orange); text-decoration: underline; }
.breadcrumb .current { color: var(--ink); font-weight: 600; }
.page-title { font-size: 30px; font-weight: 800; margin: 10px 0 4px; color: var(--ink); }
.page-meta { font-size: 14px; color: var(--muted); margin: 0; }

/* Layout */
.layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 28px;
  align-items: start;
}

/* Filters */
.filters {
  position: sticky;
  top: 76px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-right: 4px;
}
.filter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 6px;
}
.filter-head h2 { font-size: 16px; font-weight: 700; margin: 0; }
.link-btn { background: none; border: none; color: var(--orange); font-size: 13px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

.filter-group { border-bottom: 1px solid var(--line); padding: 8px 0; }
.filter-group summary {
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.filter-group summary::-webkit-details-marker { display: none; }
.filter-group summary::after {
  content: '+';
  font-size: 18px;
  font-weight: 400;
  color: var(--muted);
}
.filter-group[open] summary::after { content: '−'; }
.filter-body { padding: 6px 0 10px; display: flex; flex-direction: column; gap: 8px; }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; color: var(--text); }
.check input { width: 16px; height: 16px; accent-color: var(--orange); cursor: pointer; }
.check .count { color: var(--muted); font-size: 12px; margin-left: auto; }

.color-swatch-row { display: flex; flex-wrap: wrap; gap: 10px; }
.color-swatch {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}
.color-swatch.selected { box-shadow: 0 0 0 2px var(--orange); }

.price-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.price-row input {
  width: 70px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}
.apply-btn {
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
}
.apply-btn:hover { background: #000; }

.rating-row { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; padding: 4px 0; }
.rating-row .stars { color: var(--star); letter-spacing: 1px; }

/* Results bar */
.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  position: relative;
}
.sort-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 9px 16px;
  font-size: 14px;
  color: var(--text);
}
.sort-btn:hover { border-color: var(--ink); }
.sort-menu {
  position: absolute;
  top: 44px;
  left: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 20;
  min-width: 220px;
  overflow: hidden;
}
.sort-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 11px 16px;
  font-size: 14px;
  color: var(--text);
}
.sort-menu button:hover { background: var(--bg-soft); color: var(--orange); }
.sort-menu button.active { color: var(--orange); font-weight: 600; }

.view-toggle { display: flex; gap: 4px; }
.view-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px;
  color: var(--muted);
  display: flex;
  align-items: center;
}
.view-btn.active { color: var(--ink); border-color: var(--ink); }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.grid.list-view {
  grid-template-columns: 1fr;
}
.grid.list-view .card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
}
.grid.list-view .card-img { aspect-ratio: 4/3; }

/* Card */
.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: transform 0.15s ease;
}
.card:hover { transform: translateY(-2px); }
.card:hover .card-img img { transform: scale(1.04); }

.card-img {
  position: relative;
  aspect-ratio: 1/1;
  background: var(--bg-soft);
  overflow: hidden;
  border-radius: var(--radius);
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.badge-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge-tag.sale { background: var(--orange); color: #fff; }

.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  z-index: 2;
}
.fav-btn svg { transition: transform 0.15s; }
.fav-btn.active svg { fill: var(--orange); stroke: var(--orange); }
.fav-btn:hover svg { transform: scale(1.15); }

.card-body { padding: 10px 4px 6px; }
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.card-shop { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.card-rating { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stars { color: var(--star); letter-spacing: 1px; }
.card-price { font-size: 17px; font-weight: 700; color: var(--ink); }
.card-price .old { color: var(--muted); text-decoration: line-through; font-weight: 400; font-size: 13px; margin-left: 6px; }
.card-price .ship { display: block; font-size: 12px; font-weight: 500; color: #2b8a3e; margin-top: 2px; }

/* Empty */
.empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.btn-primary {
  margin-top: 14px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 600;
}
.btn-primary:hover { background: var(--orange-dark); }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 40px 0 20px;
}
.page-btn {
  min-width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}
.page-btn:hover:not(:disabled) { border-color: var(--ink); }
.page-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.page-btn:disabled { opacity: 0.4; cursor: default; }
.page-ellipsis { padding: 0 4px; color: var(--muted); }

/* Footer */
.footer { background: #fafaf8; border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 24px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { font-size: 14px; font-weight: 700; margin: 0 0 4px; color: var(--ink); }
.footer-col a { font-size: 13px; color: var(--muted); }
.footer-col a:hover { color: var(--orange); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 18px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.footer-pay { margin-top: 6px; font-weight: 600; color: var(--ink); }

/* Payment strip */
.pay-strip { background: #161616; color: #fff; }
.pay-strip-inner {
  max-width: 1320px; margin: 0 auto; padding: 9px 24px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px;
}
.pay-strip-label { font-weight: 700; letter-spacing: 0.3px; }
.pay-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
  padding: 4px 12px; border-radius: 20px; font-weight: 600;
}
.pay-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--orange); color: #fff; font-size: 11px; font-weight: 800;
}
.pay-strip-note { margin-left: auto; color: rgba(255,255,255,0.65); font-size: 12px; }

/* Add to cart button on cards */
.card-add {
  position: absolute; left: 10px; bottom: 10px; right: 10px;
  background: var(--ink); color: #fff; border: none; border-radius: 24px;
  padding: 9px 14px; font-size: 13px; font-weight: 600;
  opacity: 0; transform: translateY(8px); transition: 0.18s ease;
  z-index: 2; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.card:hover .card-add { opacity: 1; transform: translateY(0); }
.card-add:hover { background: var(--orange); }
.card-add.added { background: #2b8a3e; }

/* Overlay + drawer */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 100; animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 380px; max-width: 92vw;
  background: #fff; z-index: 101; box-shadow: -8px 0 30px rgba(0,0,0,0.2);
  display: flex; flex-direction: column; animation: slide 0.25s ease;
}
@keyframes slide { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-close {
  background: none; border: none; font-size: 28px; line-height: 1; color: var(--muted);
}
.drawer-close:hover { color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px; }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.cart-item .ci-info { flex: 1; min-width: 0; }
.cart-item .ci-title { font-size: 13px; font-weight: 600; line-height: 1.3; margin: 0 0 4px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cart-item .ci-shop { font-size: 11px; color: var(--muted); }
.cart-item .ci-price { font-size: 14px; font-weight: 700; margin-top: 4px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; margin-top: 6px; }
.qty button { background: #fff; border: none; width: 26px; height: 26px; font-size: 15px; color: var(--ink); }
.qty button:hover { background: var(--bg-soft); }
.qty span { padding: 0 10px; font-size: 13px; font-weight: 600; min-width: 18px; text-align: center; }
.ci-remove { background: none; border: none; color: var(--muted); font-size: 12px; align-self: flex-start; }
.ci-remove:hover { color: var(--orange); }
.drawer-foot { border-top: 1px solid var(--line); padding: 16px 20px; }
.cart-total { display: flex; justify-content: space-between; align-items: center; font-size: 16px; margin-bottom: 6px; }
.cart-total strong { font-size: 20px; }
.cart-note { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.btn-block { width: 100%; }
.cart-empty { text-align: center; color: var(--muted); padding: 50px 20px; font-size: 14px; }

/* Modal */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade 0.2s ease;
}
.modal-card {
  background: #fff; border-radius: 12px; width: 520px; max-width: 100%; max-height: 92vh;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: pop 0.2s ease;
}
.modal-sm { width: 380px; }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px 22px; }
.checkout-summary { display: flex; justify-content: space-between; align-items: baseline; background: var(--bg-soft); padding: 14px 16px; border-radius: 8px; margin-bottom: 14px; }
.checkout-summary strong { font-size: 22px; }
.checkout-intro { font-size: 13px; color: var(--text); margin: 0 0 14px; line-height: 1.5; }
.pay-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pay-tab {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 20px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--text);
}
.pay-tab:hover { border-color: var(--ink); }
.pay-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pay-panel { border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; background: #fff; }
.pay-panel h3 { margin: 0 0 4px; font-size: 15px; }
.pay-panel .pay-desc { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.pay-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pay-row label { font-size: 12px; color: var(--muted); min-width: 70px; }
.pay-row .pay-val {
  flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px;
  background: var(--bg-soft); padding: 9px 12px; border-radius: 6px; word-break: break-all;
}
.copy-btn {
  background: var(--ink); color: #fff; border: none; border-radius: 6px;
  padding: 9px 14px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.copy-btn:hover { background: var(--orange); }
.copy-btn.copied { background: #2b8a3e; }
.pay-qr { text-align: center; margin-top: 8px; }
.pay-qr img { width: 150px; height: 150px; border-radius: 8px; border: 1px solid var(--line); }
.order-fields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.order-fields label { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; flex-direction: column; gap: 5px; }
.order-fields input, .order-fields textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-size: 14px; font-family: inherit; resize: vertical;
}
.order-fields input:focus, .order-fields textarea:focus { outline: none; border-color: var(--orange); }
.checkout-foot { font-size: 11px; color: var(--muted); margin: 12px 0 0; text-align: center; }
.center { text-align: center; }
.confirm-ico {
  width: 64px; height: 64px; border-radius: 50%; background: #2b8a3e; color: #fff;
  font-size: 32px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.modal-body h2 { margin: 0 0 8px; }
#confirmMsg { font-size: 14px; color: var(--text); margin: 0 0 18px; line-height: 1.5; }

/* Responsive */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
  .header-inner { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .page-title { font-size: 24px; }
  .card-title { font-size: 13px; }
  .grid.list-view .card { grid-template-columns: 120px 1fr; }
}
