/* homepage typography aligned to omgbuy.com/product */
:root {
  --brand: #D77327;
  --brand-dark: #C46520;
  --logo: #7c3aed;
  --bg: #ECEDF2;
  --surface: #ffffff;
  --border: #E8EAED;
  --text: #1a1d24;
  --text-muted: #6b7280;
  --text-light: #9CA3AF;
  --radius: 10px;
  --max-width: 1800px; /* omgbuy product-layout-wide: 112.5rem */
  --detail-max: 1600px; /* omgbuy detail container-main / product-detail-container */
  --detail-pad-outer: 2.25rem; /* 36px */
  --detail-pad-inner: 1.8rem; /* 28.8px */
  --shadow: 0 2px 8px rgba(0,0,0,.06);
  --header-h: 56px;
  --tabs-h: 48px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-size: 14px; /* omgbuy product 基准 */
  font-family: Inter, "Fivo Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; }
img { max-width: 100%; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
/* omgbuy：三列 grid；左列右对齐 Logo、右列左对齐操作，整体向中间收拢 */
.header-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 10px 2.25rem;
  display: grid; grid-template-columns: 1fr minmax(280px, 520px) 1fr;
  align-items: center; gap: 12px;
}
.logo {
  display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 22px;
  color: var(--text); text-decoration: none; letter-spacing: -0.4px;
  justify-self: end; min-width: 0;
}
.logo-icon { width: 32px; height: 32px; background: linear-gradient(135deg, #7c3aed, #8b5cf6); border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 700; flex-shrink: 0; }
.logo-image { height: 32px; width: auto; max-width: 140px; object-fit: contain; display: block; }

.search-bar { width: 100%; position: relative; justify-self: center; max-width: 520px; }
.search-bar input {
  width: 100%; padding: 9px 16px 9px 40px; border: 1px solid #e0e0e0;
  border-radius: 999px; background: #fafafa; font-size: 13px; outline: none;
  height: 36px; box-sizing: border-box;
}
.search-bar input:focus { border-color: #d0d0d0; background: #fff; }
.search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--brand); pointer-events: none; }
/* search-cam removed: no image search */

.header-actions { display: flex; align-items: center; gap: 12px; justify-self: start; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 999px; border: 1px solid #e0e0e0;
  background: #fafafa; display: grid; place-items: center; color: #555; text-decoration: none;
  box-sizing: border-box; flex-shrink: 0;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { color: #333; background: #fff; border-color: #d0d0d0; }

.currency-wrap { position: relative; }
.currency-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 18px;
  border: 1px solid #e0e0e0; border-radius: 999px; background: #fff;
  font-size: 16px; font-weight: 700; cursor: pointer; color: #333;
  height: 32px; box-sizing: border-box; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.currency-btn:hover { background: #fafafa; }
.currency-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 140px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 50;
}
.currency-menu.open { display: block; }
.cur-item {
  width: 100%; display: flex; justify-content: space-between; gap: 16px;
  border: none; background: transparent; padding: 10px 12px; border-radius: 8px;
  font-size: 14px; cursor: pointer; color: var(--text);
}
.cur-item:hover { background: #f7f7f8; }
.cur-item.active { color: var(--brand); font-weight: 700; }

/* 顶部分类：全宽通栏；横向独立滑动（对齐 omgbuy） */
.category-tabs {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #ececec;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  position: sticky;
  top: var(--header-h);
  z-index: 90;
}
.tabs-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 8px 2.5rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
  gap: 20px; /* omgbuy md:gap-5 */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-sizing: border-box;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-x;
}
/* 内容未溢出时居中；溢出时 auto margin 归零，可完整横向滚动 */
.tabs-inner::before,
.tabs-inner::after {
  content: "";
  margin: auto;
  width: 0;
  height: 0;
  pointer-events: none;
}
.tabs-inner::-webkit-scrollbar { display: none; height: 0; }
.tabs-inner.is-drag-scroll {
  cursor: grabbing;
  scroll-behavior: auto;
}
.tabs-inner.is-drag-scroll .tab {
  pointer-events: none; /* 拖动中不触发 tab 点击 */
}
.tabs-inner .tab {
  cursor: pointer;
  -webkit-user-drag: none;
}
.tab {
  padding: 10px 20px; white-space: nowrap; cursor: pointer;
  font-size: 16px; font-weight: 500; line-height: 1.25; /* omgbuy md:text-[1rem] */
  color: #555; border: 1px solid transparent; border-radius: 999px;
  background: transparent; flex-shrink: 0;
  transition: color .15s, border-color .15s, background .15s;
  text-decoration: none; display: inline-flex; align-items: center;
  box-sizing: border-box; min-height: 40px;
}
.tab:hover { color: #333; background: #f3f4f6; }
.tab.active {
  color: #9A5F06; font-weight: 500;
  border-color: rgba(232, 162, 60, 0.55);
  background: rgba(245, 166, 35, 0.22);
  box-shadow: 0 1px 2px rgba(245, 166, 35, 0.15);
}

/* 列表主体：侧栏 + 商品区（有 max-width） */
.list-shell {
  --side-w: 18.75rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2.5rem 48px;
  background: #fff;
  box-sizing: border-box;
}

.page {
  display: flex; gap: 0; align-items: flex-start;
  margin: 0 -2.5rem; padding: 0;
  background: #fff;
}
.sidebar {
  width: var(--side-w); flex-shrink: 0;
  position: sticky; top: calc(var(--header-h) + var(--tabs-h));
  max-height: calc(100vh - var(--header-h) - var(--tabs-h));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  margin: 0;
  padding: 14px 12px 16px 2.5rem;
  border: none;
  border-right: 1px solid #ececec;
  border-radius: 0;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1px #e8e8e8;
}
.main {
  flex: 1; min-width: 0;
  background: var(--bg);
  padding: 16px 2.5rem 40px 28px;
  box-sizing: border-box;
  border-radius: 0;
}
.mobile-filter-btn { display: none; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 15px; cursor: pointer; }
.list-controls {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  margin-bottom: 16px; min-height: 40px;
}
.list-controls .toolbar { margin-bottom: 0; flex: 1; justify-content: flex-end; }

.filter-heading {
  font-size: 17px; font-weight: 600; margin: 0 0 2px; color: #1a1a1a; /* omgbuy 1.0625rem */
  letter-spacing: -0.02em; line-height: 1.25;
}
.filter-group-title {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 16px; margin: 12px 0 6px; color: #1a1a1a; /* omgbuy md:text-base */
  cursor: pointer; user-select: none; line-height: 1.3;
}
.filter-group-title .chev {
  color: #666; font-size: 16px; font-weight: 300; line-height: 1;
  width: 16px; text-align: center; flex-shrink: 0;
}
.filter-group-title.collapsed .chev { transform: none; }
.filter-section { margin-bottom: 2px; }
.filter-section.collapsed .filter-body { display: none; }
/* 左侧分类区独立纵向滑动，价格区固定在下方 */
.filter-section.cats-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.filter-body-cats {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
  cursor: grab;
  touch-action: pan-y;
  padding-right: 4px;
}
.filter-body-cats.is-drag-scroll { cursor: grabbing; }
.filter-body-cats.is-drag-scroll .filter-list li { pointer-events: none; }
.filter-section.price-section { flex-shrink: 0; padding-top: 4px; }

.filter-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px; /* omgbuy space-y ~2.5/3.5 */
}
.filter-list li {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; margin: 0;
  min-height: 52px;
  font-size: 15px; font-weight: 600; color: #374151; cursor: pointer; /* omgbuy md:r-text-[15px] */
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
  box-sizing: border-box;
  transition: border-color .15s, color .15s, background .15s;
}
.filter-list li:hover { color: #111; background: #F5F7FA; border-color: #E8ECF1; }
/* omgbuy：选中 = 直角细橙框 + 橙字 + 橙图标 */
.filter-list li.active {
  color: var(--brand);
  font-weight: 600;
  background: #fff;
  border-color: rgba(215, 115, 39, 0.55);
}
.filter-list li svg {
  width: 28px; height: 28px; flex-shrink: 0;
  color: #b0b0b0; fill: currentColor;
}
.filter-list li.active svg { color: var(--brand); }
.filter-list .cat-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 0; flex-shrink: 0; }
.filter-list li span { line-height: 1.3; min-width: 0; word-break: break-word; }

.price-inputs { display: flex; gap: 10px; margin: 4px 0 12px; }
.price-inputs input {
  width: 100%; height: 40px; padding: 0 14px;
  border: 1px solid #d0d0d0; border-radius: 999px;
  font-size: 14px; color: #333; background: #fff; box-sizing: border-box;
  outline: none;
}
.price-inputs input::placeholder { color: #aaa; }
.price-inputs input:focus { border-color: #bbb; }
.apply-btn {
  width: 100%; height: 40px; padding: 0 14px;
  background: #fff; color: #222; border: 1px solid #d0d0d0;
  border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer;
  box-sizing: border-box;
}
.apply-btn:hover { border-color: var(--brand); color: var(--brand); }

.toolbar {
  display: flex; justify-content: flex-end; align-items: center;
  margin-bottom: 16px; gap: 16px; height: 40px;
}
.result-count { display: none; font-size: 14px; color: var(--text-muted); margin-right: auto; }
.sort { display: flex; align-items: center; gap: 8px; }
.sort label { font-size: 14px; color: #666; }
.sort select {
  padding: 8px 32px 8px 14px; border: 1px solid #e0e0e0; border-radius: 999px;
  background: #fff; font-size: 14px; color: var(--text); appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; cursor: pointer;
}

.products-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 44px 32px; } /* omgbuy lg:gap-y-11 gap-x-8 */
.product-card {
  background: #fff; border-radius: 8px; overflow: hidden;
  text-decoration: none; color: inherit; border: 1px solid rgba(226, 232, 240, 0.9);
  display: flex; flex-direction: column;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
.product-card:hover {
  box-shadow: 0 24px 56px rgba(245, 166, 35, 0.1);
  border-color: rgba(245, 166, 35, 0.4);
}
@media (hover: hover) and (min-width: 769px) {
  .product-card:hover { transform: translateY(-6px); }
}
.product-image {
  aspect-ratio: 1; background: #f3f4f6; position: relative; overflow: hidden;
  flex-shrink: 0;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wish-btn {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%;
  border: none; background: rgba(70,70,70,.45); display: grid; place-items: center;
  cursor: pointer; color: #fff; z-index: 2; backdrop-filter: blur(2px);
}
.wish-btn svg { width: 14px; height: 14px; color: #fff; stroke: #fff; fill: none; }
.wish-btn:hover { background: rgba(50,50,50,.6); }
.wish-btn.active { background: rgba(70,70,70,.55); color: #ff6b6b; }
.wish-btn.active svg { fill: #ff6b6b; stroke: #ff6b6b; color: #ff6b6b; }
.product-info {
  padding: 12px 16px 16px;
  display: flex; flex-direction: column; flex: 1;
  gap: 6px;
  min-height: 118px;
  text-align: left;
}
.brand {
  display: block; align-self: flex-start; max-width: 100%;
  font-size: 12px; font-weight: 600; color: #9A3412; /* omgbuy md:text-[0.75rem] */
  text-transform: uppercase; letter-spacing: .06em; margin: 0;
  line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-title {
  font-size: 16px; line-height: 1.375; margin: 0; font-weight: 500; color: #111827; /* omgbuy md:text-[1rem] */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.65em;
}
.price {
  font-size: 18px; font-weight: 700; color: #C2410C; margin-top: auto; /* omgbuy md:text-[1.125rem] */
  line-height: 1.25; padding-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.state-msg { text-align: center; padding: 60px 20px; color: var(--text-light); font-size: 15px; grid-column: 1 / -1; }
.pagination-wrap { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); flex-wrap: wrap; gap: 12px; }
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.pagination a, .pagination span { display: block; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; color: var(--text-muted); min-width: 36px; text-align: center; cursor: pointer; background: #fff; }
.pagination li.active span { background: var(--text); color: #fff; border-color: var(--text); }
.pagination li.disabled a { opacity: .4; pointer-events: none; }
.per-page { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text-muted); }
.per-page a { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: #fff; }
.per-page a.active { background: var(--text); color: #fff; border-color: var(--text); }

.fab { position: fixed; right: 18px; bottom: 28px; display: flex; flex-direction: column; gap: 12px; z-index: 40; }
.fab-item {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.fab-item svg { width: 24px; height: 24px; }
.fab-item.wa { background: #25D366; }
.fab-item.tg { background: #2AABEE; }
.fab-item.dc { background: #5865F2; }

.shop-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: rgba(26,29,36,.92); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 17px; opacity: 0; pointer-events: none; transition: .25s; z-index: 200;
}
.shop-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Detail — 主体 1600；顶栏分类 tabs/header 与主体同宽 */
.m-header { display: none; }

body.is-detail .header-inner,
body.is-detail .tabs-inner {
  max-width: var(--detail-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--detail-pad-outer);
  padding-right: var(--detail-pad-outer);
}
body.is-detail .tabs-inner {
  justify-content: center;
}

.detail-shell {
  max-width: var(--detail-max);
  margin: 0 auto;
  padding: 0 var(--detail-pad-outer);
  box-sizing: border-box;
}
.detail-page {
  max-width: none;
  margin: 0;
  padding: 0 var(--detail-pad-inner) 40px;
}
.detail-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 calc(-1 * var(--detail-pad-inner)) 18px;
  padding: 10px var(--detail-pad-inner);
  min-height: 34px;
  border-radius: 0;
}
.go-back {
  display: inline-flex; align-items: center; gap: 7px;
  color: #555; text-decoration: none; font-size: 18px; font-weight: 500;
  padding: 0; border-radius: 0;
}
.go-back:hover { color: var(--brand); }
.detail-top-actions { display: flex; align-items: center; gap: 16px; }
.detail-top-actions a, .detail-top-actions button {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; color: #666; font-size: 17px; cursor: pointer;
  text-decoration: none; padding: 0;
}
.detail-top-actions a:hover, .detail-top-actions button:hover { color: var(--brand); }
.detail-wrap {
  max-width: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px 48px;
  align-items: start;
  background: transparent; border-radius: 0; box-shadow: none;
}
.gallery { background: transparent; border-radius: 0; padding: 0; border: none; min-width: 0; }
/* 主图轮播（对齐 omgbuy Embla：方图、横向滑动、圆角 16px） */
.main-image {
  aspect-ratio: 1 / 1;
  border-radius: 16px; overflow: hidden; background: #fff; position: relative;
  width: 100%; margin: 0; touch-action: pan-y; user-select: none;
  cursor: grab;
}
.main-image.is-dragging { cursor: grabbing; }
.main-track {
  display: flex; height: 100%; width: 100%;
  transition: transform .35s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
.main-image.is-dragging .main-track { transition: none; }
.main-slide {
  flex: 0 0 100%; min-width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
}
.main-slide img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  pointer-events: none; -webkit-user-drag: none;
}
.main-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.92); box-shadow: 0 2px 10px rgba(0,0,0,.14);
  display: grid; place-items: center; cursor: pointer; z-index: 3;
  color: #222; padding: 0; opacity: 0; transition: opacity .2s, background .15s;
}
.main-image:hover .main-nav,
.main-image:focus-within .main-nav { opacity: 1; }
.main-nav:hover { background: #fff; color: var(--brand); }
.main-nav.prev { left: 12px; }
.main-nav.next { right: 12px; }
.main-nav[hidden] { display: none; }
.img-count {
  position: absolute; right: 12px; bottom: 12px; left: auto; transform: none;
  background: rgba(0,0,0,.7); color: #fff;
  font-size: 16px; padding: 4px 10px; border-radius: 999px;
  z-index: 3; pointer-events: none; white-space: nowrap;
}
/* 缩略图轮播：横向滚动 + 左右箭头；圆角 16px（对齐 omgbuy rounded-[16px]） */
.thumbs-carousel {
  position: relative; margin-top: 16px; width: 100%;
}
.thumbs {
  display: flex; gap: 18px; overflow-x: auto; scroll-behavior: smooth;
  padding: 4px 0 6px; scrollbar-width: none; -ms-overflow-style: none;
}
.thumbs::-webkit-scrollbar { display: none; }
.thumb {
  /* 与参考站一致：圆角在图片容器上 16px，选中用外圈，不吃掉圆角 */
  width: 100px; height: 100px; min-width: 100px; max-width: 100px;
  border-radius: 16px; overflow: hidden; border: none;
  flex: 0 0 100px; cursor: pointer; opacity: 1; box-sizing: border-box;
  background: #f5f5f5;
  box-shadow: 0 0 0 2px transparent;
}
.thumb:hover { opacity: .92; }
.thumb.active { box-shadow: 0 0 0 2px #f5a623; }
.thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: 16px;
}
.thumbs-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.95); box-shadow: 0 2px 8px rgba(0,0,0,.12);
  display: grid; place-items: center; cursor: pointer; z-index: 2;
  color: #333; padding: 0;
}
.thumbs-nav:hover { background: #fff; color: #f5a623; }
.thumbs-nav.prev { left: 4px; }
.thumbs-nav.next { right: 4px; }
.thumbs-nav[hidden] { display: none; }
.thumbs-carousel.has-overflow .thumbs { padding-left: 36px; padding-right: 36px; }

.info-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
}
/* 参考图：标题/价格/说明 → Style(色名+橙边) → Size(圆钮) → Buy → Share & Earn */
.info-top {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 0 48px;
  border-bottom: 1px solid #c9ced8;
}
.info-buy {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 18px;
}
.badge-market {
  display: inline-block; font-size: 17px; font-weight: 600; color: #3b82f6;
  background: transparent; padding: 0; border-radius: 0; margin-bottom: 18px;
}
.info-panel h1 { font-size: 28px; line-height: 1.35; margin: 0 0 24px; font-weight: 700; color: #1a1a1a; }
.pid { display: none; }
.price-lg { font-size: 32px; font-weight: 700; color: #c2410c; margin: 0 0 16px; letter-spacing: -0.02em; }
.price-note { display: none; }
.hint {
  background: transparent; color: #8b8b8b; border-radius: 0; padding: 0;
  font-size: 17px; line-height: 1.55; margin: 0; max-width: 40em;
}
.meta-inline { display: flex; flex-wrap: wrap; gap: 12px 18px; font-size: 17px; color: var(--text-muted); margin: 10px 0 0; }
.meta-inline b { color: var(--text); font-weight: 600; }

.selector {
  margin-bottom: 0; padding: 28px 0;
  border-top: none;
  border-bottom: 1px solid #c9ced8;
}
.selector + .selector { padding-top: 28px; }
.selector--size {
  padding-top: 36px;
  padding-bottom: 36px;
}
.selector-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
/* 借鉴参考图：Size 标签到圆钮之间留出明显空隙 */
.selector--size .selector-head { margin-bottom: 32px; }
.selector--size .size-grid { gap: 12px; }
.selector-label { font-size: 18px; font-weight: 600; color: #222; }
.selector-label em { font-style: normal; color: #222; font-weight: 700; }
.more-link { font-size: 17px; color: #9ca3af; cursor: pointer; background: none; border: none; padding: 0; }
.more-link:hover { color: var(--brand); }
.style-grid { display: flex; flex-wrap: wrap; gap: 12px 14px; max-height: none; overflow: visible; align-items: flex-start; }
.style-grid:not(.expanded) { max-height: none; }
.style-grid.expanded { max-height: none; }
.style-chip {
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 100%;
  padding: 5px 14px 5px 5px;
  border: 1.5px solid #e5e7eb; border-radius: 999px; background: #fff;
  cursor: pointer; font-size: 17px; font-weight: 600; color: #374151;
  box-sizing: border-box;
}
.style-chip img {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  border: none; background: #f3f4f6; flex-shrink: 0;
}
.style-chip .style-idx { font-size: 18px; font-weight: 700; min-width: 1.1em; flex-shrink: 0; }
.style-chip .style-name {
  display: inline-block; font-size: 17px; font-weight: 600; line-height: 1.25;
  max-width: min(12em, 42vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 参考：选中 Style 为实心橙底 */
.style-chip.active {
  background: #f5a623; border-color: #f5a623; color: #1a1a1a;
}
.style-chip.active img { border: none; }
.size-grid { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
/* 尺码按文案自适应宽度，避免 35(US3.5) 等长标签挤爆圆钮 */
.size-chip {
  width: auto; min-width: 44px; height: auto; min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #d1d5db; border-radius: 999px;
  background: #fff; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px; color: #333; font-weight: 500;
  line-height: 1.25; white-space: nowrap; box-sizing: border-box;
  max-width: 100%;
}
.size-chip.size-chip--long {
  white-space: normal;
  text-align: center;
  max-width: min(220px, 100%);
  line-height: 1.3;
}
.size-chip:hover { border-color: #f5a623; }
.size-chip.active {
  background: #fff; color: #222; border-color: #f5a623; font-weight: 600;
  box-shadow: 0 0 0 1px #f5a623;
}

.action-bar {
  display: flex; gap: 11px; align-items: center;
  margin: 0; padding: 34px 0;
  border-top: none;
  border-bottom: 1px solid #c9ced8;
  background: transparent;
}
.buy-now {
  flex: 1; height: 52px; border: 1px solid #e8a23c; border-radius: 36px; background: #f5a623; color: #fff;
  font-size: 20px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.buy-now svg { width: 22px; height: 22px; flex-shrink: 0; }
.buy-now:hover { background: #e5971f; }
.side-actions { display: flex; gap: 11px; }
.side-btn {
  width: 52px; height: 52px; border-radius: 12px; border: 1px solid #d1d5db; background: #fff;
  display: grid; place-items: center; cursor: pointer; color: #333;
}
.side-btn svg { width: 24px; height: 24px; }
.side-btn:hover { border-color: #9ca3af; }
.side-btn.active { color: #ef4444; border-color: #fecaca; }

.share-earn {
  margin-top: 34px;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  background: #fff6e8;
  border-radius: 12px;
}
.share-earn-copy { flex: 1; min-width: 0; }
.share-earn-copy strong {
  display: block; font-size: 19px; font-weight: 700; color: #1a1a1a; margin: 0 0 4px;
}
.share-earn-copy p {
  margin: 0; font-size: 16px; line-height: 1.45; color: #8a8a8a;
}
.share-earn-btn {
  flex-shrink: 0; height: 36px; padding: 0 16px;
  border: none; border-radius: 8px;
  background: #f5a623; color: #fff; font-size: 17px; font-weight: 700; cursor: pointer;
}
.share-earn-btn:hover { background: #e5971f; }

/* Buy Now — 购买链接弹层 */
.buy-modal {
  display: none; position: fixed; inset: 0; z-index: 300;
  align-items: center; justify-content: center; padding: 20px;
}
.buy-modal.open { display: flex; }
.buy-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.45);
}
.buy-modal-panel {
  position: relative; z-index: 1; width: 100%; max-width: 420px; max-height: min(80vh, 560px);
  background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.18);
  display: flex; flex-direction: column; overflow: hidden;
}
.buy-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid #eee;
}
.buy-modal-head h3 { margin: 0; font-size: 20px; font-weight: 700; color: #111; }
.buy-modal-close {
  width: 32px; height: 32px; border: none; border-radius: 50%; background: #f3f4f6;
  cursor: pointer; font-size: 22px; line-height: 1; color: #555;
}
.buy-modal-close:hover { background: #e5e7eb; }
.buy-modal-list {
  padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
}
.buy-link-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid #e8e8e8; border-radius: 12px;
  text-decoration: none; color: #222; background: #fff;
  transition: border-color .15s, background .15s;
}
.buy-link-item:hover { border-color: #f5a623; background: #fffbf5; }
.buy-link-item .agent-logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: #f7f7f8; border: 1px solid #eee; flex-shrink: 0;
  display: grid; place-items: center; font-size: 18px; font-weight: 700; color: #666;
  overflow: hidden;
}
.buy-link-item .agent-logo img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.buy-link-item .name { flex: 1; font-size: 19px; font-weight: 600; min-width: 0; }
.buy-link-item .go {
  font-size: 17px; color: #f5a623; font-weight: 600; white-space: nowrap;
}

.tabs-block { max-width: none; margin: 0; padding: 8px var(--detail-pad-inner) 48px; }
.tabs-nav { display: flex; gap: 28px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs-nav button {
  background: none; border: none; padding: 12px 0; font-size: 19px; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent; font-weight: 600;
}
.tabs-nav button.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; background: #fff; border-radius: 12px; padding: 18px; border: 1px solid var(--border); }
.tab-panel.active { display: block; }
.tab-panel .desc img { width: 100%; height: auto; display: block; border-radius: 6px; margin: 0 0 8px; }
.attr-table { width: 100%; border-collapse: collapse; font-size: 18px; }
.attr-table th, .attr-table td { padding: 12px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.attr-table th { width: 160px; color: var(--text-muted); font-weight: 500; }
.qc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qc-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #f3f4f6; }

.related-section { max-width: none; margin: 0; padding: 0 var(--detail-pad-inner) 48px; }
.related-section h2 { font-size: 22px; margin: 0 0 16px; }
.related-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 28px; }

.wishlist-page { max-width: var(--max-width); margin: 0 auto; padding: 24px 2.5rem; }
.wish-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.wish-tabs .pill {
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border); background: #fff;
  font-size: 18px; font-weight: 600; cursor: pointer;
}
.wish-tabs .pill.active { background: #e8f8ef; border-color: #b7ebc9; color: #178a45; }
.wish-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.wish-card { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.wish-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.wish-card .body { padding: 12px; }
.wish-card .buy { width: 100%; margin-top: 10px; height: 40px; border: none; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 700; cursor: pointer; }

/* omgbuy: ≥1600px 列表主体左右 padding 为 0；详情外层 pad 清零，内层保留 32px */
@media (min-width: 1600px) {
  .header-inner,
  .wishlist-page {
    padding-left: 0;
    padding-right: 0;
  }
  .list-shell {
    padding-left: 0;
    padding-right: 0;
  }
  .tabs-inner {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
  .page {
    margin-left: 0;
    margin-right: 0;
  }
  .main { padding-right: 0; }
  .header-inner { padding-top: 12px; padding-bottom: 12px; }
  .wishlist-page { padding-top: 24px; padding-bottom: 24px; }

  .detail-shell {
    padding-left: 0;
    padding-right: 0;
  }
  body.is-detail .header-inner,
  body.is-detail .tabs-inner {
    padding-left: 0;
    padding-right: 0;
  }
  .detail-page,
  .tabs-block,
  .related-section {
    padding-left: 32px;
    padding-right: 32px;
  }
}

@media (max-width: 1200px) {
  .products-grid, .related-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wish-grid { grid-template-columns: repeat(3, 1fr); }
  .list-shell { padding-left: 20px; padding-right: 20px; }
  .tabs-inner { padding-left: 20px; padding-right: 20px; }
  .page { margin-left: -20px; margin-right: -20px; }
  .sidebar { width: 15rem; padding-left: 20px; padding-right: 16px; }
  .main { padding-right: 20px; padding-left: 20px; }
  .detail-shell { padding-left: 20px; padding-right: 20px; }
  .detail-page, .tabs-block, .related-section { padding-left: 16px; padding-right: 16px; }
  .thumb { width: 72px; height: 72px; min-width: 72px; max-width: 72px; flex-basis: 72px; }
}
@media (max-width: 900px) {
  .products-grid, .related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-wrap { grid-template-columns: 1fr; gap: 20px; padding: 0; }
  .main-image { max-height: none; aspect-ratio: 1; }
  .qc-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  /* 手机端 header 两行（Logo+操作 / 搜索），sticky 分类栏需对准实际高度 */
  :root { --header-h: 106px; --tabs-h: 46px; }

  /* 1) Logo 行：左品牌 + 右操作 */
  .header-inner {
    padding: 10px 12px 12px;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "logo actions"
      "search search";
  }
  .logo {
    grid-area: logo;
    justify-self: start;
    max-width: 100%;
    font-size: 22px;
    gap: 6px;
  }
  .logo span#logoText { font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .logo-image { height: 28px; max-width: 118px; }
  .logo-icon { width: 28px; height: 28px; font-size: 16px; }
  .header-actions {
    grid-area: actions;
    justify-self: end;
    gap: 8px;
  }
  .icon-btn { width: 34px; height: 34px; }
  .currency-btn { height: 34px; padding: 4px 10px; font-size: 17px; }

  /* 2) 搜索：单独第二行，完整可用 */
  .search-bar {
    display: block;
    grid-area: search;
    max-width: none;
    width: 100%;
    justify-self: stretch;
  }
  .search-bar input {
    height: 40px;
    font-size: 18px;
    padding-left: 40px;
    background: #fff;
  }

  .category-tabs {
    display: block;
    position: sticky;
    top: var(--header-h);
    z-index: 90;
    border-bottom: 1px solid #ececec;
  }
  /* 详情页手机端不要顶部分类，只保留 Go Back（对齐 omgbuy） */
  body.is-detail .category-tabs,
  .category-tabs.desktop-only {
    display: none !important;
  }
  .tabs-inner {
    padding: 8px 12px;
    gap: 6px;
  }
  .tabs-inner::before,
  .tabs-inner::after { display: none; content: none; }
  .tab {
    padding: 6px 12px;
    font-size: 15px;
    min-height: 30px;
  }
  .page { flex-direction: column; gap: 12px; margin: 0; }
  .sidebar {
    display: none; width: 100%; position: static;
    min-height: 0; max-height: none; padding: 16px; border-radius: 0;
    border: none; box-shadow: none; overflow: visible;
  }
  .list-shell { padding: 0 12px 24px; background: transparent; }
  .main { padding: 0; background: transparent; }
  .sidebar.open {
    display: flex; margin-bottom: 12px;
    border: 1px solid var(--border); border-radius: 12px; background: #fff;
    max-height: 70vh;
  }
  .sidebar.open .filter-body-cats { max-height: 40vh; }

  /* 3) Filters + Sort 同一行，等高对齐 */
  .list-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 0 14px;
    min-height: 40px;
  }
  .mobile-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    height: 40px;
    padding: 0 14px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid #dbe3f0;
    background: #eef4ff;
    color: #2f6fed;
    font-size: 18px;
    font-weight: 600;
  }
  .list-controls .toolbar {
    flex: 1;
    min-width: 0;
    margin: 0;
    height: 40px;
    justify-content: flex-end;
    gap: 8px;
  }
  .sort {
    width: 100%;
    max-width: 220px;
    justify-content: flex-end;
    gap: 6px;
  }
  .sort label {
    flex-shrink: 0;
    font-size: 17px;
    color: #666;
  }
  .sort select {
    flex: 1;
    min-width: 0;
    height: 40px;
    border-radius: 10px;
    padding: 0 34px 0 12px;
    font-size: 17px;
    background-color: #fff;
  }

  .products-grid, .related-grid, .wish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .toolbar { justify-content: space-between; }
  .detail-page { padding: 0 0 80px; }
  .detail-shell { padding: 0; }
  /* 手机详情：不显示分类；保留 Go Back（对齐 omgbuy） */
  .detail-topbar {
    display: flex;
    margin: 0;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #ececec;
  }
  .detail-top-actions { display: none; }
  .detail-wrap {
    padding: 0 0 80px; border-radius: 0; box-shadow: none; gap: 0;
    grid-template-columns: 1fr; background: transparent;
  }
  .gallery { border: none; border-radius: 0; padding: 0; }
  .main-image { border-radius: 0; max-height: none; aspect-ratio: 1; }
  .main-nav { opacity: 1; width: 36px; height: 36px; }
  /* 手机详情：去掉主图下方缩略图条 */
  .thumbs-carousel { display: none !important; }
  .info-panel { padding: 14px 14px 0; background: #fff; }
  .info-top { margin-bottom: 0; padding-bottom: 14px; }
  .info-panel h1 { font-size: 22px; }
  .price-lg { font-size: 28px; }
  .share-earn { flex-wrap: wrap; }
  .share-earn-btn { width: 100%; }
  .tabs-block, .related-section { padding-left: 12px; padding-right: 12px; }
  .m-header {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff;
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 80;
  }
  .m-header .back, .m-header .icon-btn {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
    background: #fff; display: grid; place-items: center; text-decoration: none; color: var(--text);
  }
  .m-header .spacer { flex: 1; }
  .site-header.desktop-only { display: none; }
  .category-tabs.desktop-only { display: none !important; }
  .tabs-block { padding: 8px 12px 100px; }
  .action-bar {
    position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--border); border-bottom: none; z-index: 90;
  }
  .fab { bottom: 84px; }
}
