:root {
  --page-bg: #e8e2dc;
  --surface: #fcfaf8;
  --surface-soft: #f6f0eb;
  --hero: #f2ddd6;
  --ink: #302f2d;
  --muted: #8b817b;
  --line: #ebe2dc;
  --accent: #8b665c;
  --accent-dark: #665049;
  --sage: #6f8277;
  --price: #95685e;
  --radius-card: 8px;
  --frame-width: 480px;
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "MiSans", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: auto; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--ink);
}
body.modal-open { overflow: hidden; }

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { border: 0; cursor: pointer; }

.site-frame {
  width: min(100%, var(--frame-width));
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
  background: var(--surface);
  box-shadow: 0 0 28px rgba(77, 59, 47, .08);
}

.hero {
  min-height: 0;
  padding: calc(16px + env(safe-area-inset-top)) 12px 12px;
  background: #fffdfb;
  border-radius: 0;
  text-align: center;
  overflow: visible;
}

.wordmark h1 {
  margin: 0;
  color: var(--accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
}

.wordmark p {
  margin: 7px 0 22px;
  color: #9e8177;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.search-form {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px 0 17px;
  background: #f1f0ef;
  border: 1px solid #ece8e5;
  border-radius: 8px;
  box-shadow: none;
  text-align: left;
}

.search-form input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 9px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
}

.search-form input::placeholder { color: #aa9992; }
.search-form input::-webkit-search-cancel-button { display: none; }

.icon, .icon-button, .bottom-icon, .back-link svg, .note-icon svg { flex: 0 0 auto; }
.icon { width: 19px; height: 19px; color: #a0877e; }
.icon svg, .icon-button svg, .bottom-icon svg, .back-link svg, .note-icon svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.icon-button {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: #a0877e;
  background: transparent;
  border-radius: 50%;
}
.icon-button:hover, .icon-button:focus-visible { background: rgba(139, 102, 92, .1); outline: none; }

.hero-copy { margin-top: 24px; }
.hero-title { margin: 0; color: #98776e; font-size: 17px; font-weight: 600; line-height: 1.5; }
.hero-subtitle { margin: 4px 0 0; color: #b18f85; font-size: 11px; line-height: 1.5; }

.filter-section { padding: 14px 16px 0; }
.category-section { padding-top: 13px; }
.filter-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 5px;
  scrollbar-width: none;
}
.filter-track::-webkit-scrollbar { display: none; }

.filter-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 17px;
  color: #93837b;
  background: var(--surface-soft);
  border: 1px solid #efe6e0;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.filter-button:hover { transform: translateY(-1px); }
.filter-button.is-active { color: #fffaf7; background: var(--accent); border-color: var(--accent); box-shadow: 0 5px 12px rgba(139, 102, 92, .16); }
.category-section > .filter-track:first-child .filter-button:not(.is-active) { background: #fffdfb; }
.sub-filter-track { margin-top: 4px; padding-left: 8px; }
.sub-filter-track .filter-button { min-height: 31px; padding: 0 12px; color: var(--sage); background: #f4f7f3; border-color: #e2ebe5; font-size: 11px; }
.sub-filter-track .filter-button.is-active { color: #fff; background: var(--sage); border-color: var(--sage); }

.catalog-main { padding: 0 8px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 2px 12px; }
.section-heading h1, .section-heading h2 { margin: 0; color: #5d524e; font-size: 18px; font-weight: 600; line-height: 1.35; }
.section-heading p { margin: 0; color: #b0a19a; font-family: Georgia, "Times New Roman", serif; font-size: 10px; letter-spacing: 0; white-space: nowrap; }
.catalog-section-heading { min-height: 52px; align-items: stretch; justify-content: flex-start; gap: 0; margin: 0 -8px 10px; padding: 0 12px; background: #fffdfb; border-bottom: 1px solid #ece6e2; }
.section-heading-copy { position: relative; display: flex; min-width: 0; flex: 0 0 auto; align-items: center; }
.section-heading-copy h1 { color: #8f5e55; font-size: 15px; font-weight: 600; white-space: nowrap; }
.section-heading-copy::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: #9a675f; content: ""; }
.section-heading-copy p { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
.catalog-results-summary { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
.catalog-filter-actions { display: flex; width: auto; min-width: 0; flex: 0 1 auto; align-items: stretch; gap: 16px; margin-left: 18px; }

.catalog-filter-trigger {
  display: inline-flex;
  width: auto;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  color: #514a47;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 14px;
  white-space: nowrap;
}
.catalog-filter-trigger:hover, .catalog-filter-trigger:focus-visible { color: var(--accent); outline: none; }
.catalog-filter-trigger.is-filtered { color: var(--accent); background: transparent; }
.catalog-filter-prefix { flex: 0 0 auto; color: inherit; font-weight: 400; }
.catalog-filter-current { display: none; min-width: 0; max-width: 70px; margin-left: 4px; overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.catalog-filter-trigger.is-filtered .catalog-filter-current { display: block; }
.catalog-filter-chevron { width: 6px; height: 6px; margin: -3px 1px 0 6px; flex: 0 0 auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .16s ease; }
.catalog-filter-trigger[aria-expanded="true"] .catalog-filter-chevron { margin-top: 3px; transform: rotate(225deg); }

body.catalog-filter-open { overflow: hidden; }
.catalog-filter-overlay {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 50%;
  display: flex;
  width: min(100%, var(--frame-width));
  align-items: flex-end;
  background: rgba(45, 34, 29, .38);
  overscroll-behavior: contain;
  transform: translateX(-50%);
}
.catalog-filter-overlay[hidden] { display: none; }
.catalog-filter-sheet {
  display: grid;
  width: 100%;
  height: min(78vh, 680px);
  height: min(78dvh, 680px);
  max-height: calc(100vh - 18px);
  max-height: calc(100dvh - 18px);
  overflow: hidden;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  background: #fffdfb;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -14px 36px rgba(45, 34, 29, .16);
  animation: catalog-filter-sheet-enter .16s ease-out;
}
.catalog-filter-sheet-header { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px 0 23px; border-bottom: 1px solid #eadfd9; }
.catalog-filter-sheet-header h2 { margin: 0; color: #795a52; font-size: 20px; font-weight: 600; line-height: 1.35; }
.catalog-filter-close { display: grid; width: 42px; height: 42px; padding: 11px; flex: 0 0 auto; place-items: center; color: #746965; background: #fff; border: 0; border-radius: 50%; box-shadow: 0 4px 14px rgba(91, 72, 61, .06); }
.catalog-filter-close:hover, .catalog-filter-close:focus-visible { color: var(--accent); background: #f8efeb; outline: none; }
.catalog-filter-close svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.catalog-filter-body { display: grid; min-width: 0; min-height: 0; grid-template-columns: 34% minmax(0, 66%); }
.catalog-filter-body-brands { display: block; }
.catalog-filter-groups { min-width: 0; min-height: 0; padding: 8px 10px 16px; overflow-y: auto; background: #fffdfb; border-right: 1px solid #e5dad4; overscroll-behavior: contain; scrollbar-width: none; }
.catalog-filter-groups::-webkit-scrollbar { display: none; }
.catalog-filter-group { position: relative; display: flex; width: 100%; min-width: 0; min-height: 56px; align-items: center; justify-content: center; margin: 0 0 4px; padding: 10px 7px; color: #716763; background: transparent; border: 1px solid transparent; border-radius: 8px; font-size: 14px; line-height: 1.45; text-align: center; overflow-wrap: anywhere; }
.catalog-filter-group:hover, .catalog-filter-group:focus-visible { color: var(--accent); background: #f8efeb; outline: none; }
.catalog-filter-group.is-active { color: #fff; background: #9a675f; border-color: #9a675f; font-weight: 600; }
.catalog-filter-group-label { min-width: 0; overflow-wrap: anywhere; }
.catalog-filter-group-count { position: absolute; top: 4px; right: 4px; display: grid; min-width: 17px; height: 17px; padding: 0 4px; place-items: center; color: #fff; background: #9a675f; border-radius: 9px; font-size: 10px; font-weight: 600; line-height: 1; }
.catalog-filter-group.is-active .catalog-filter-group-count { color: #9a675f; background: #fff; }
.catalog-filter-choices { display: grid; min-width: 0; min-height: 0; padding: 18px 14px 12px 18px; grid-template-rows: auto minmax(0, 1fr); background: #fffcfa; }
.brand-filter-choices { width: 100%; height: 100%; padding: 18px; grid-template-rows: minmax(0, 1fr); }
.catalog-filter-choices h3 { margin: 0 0 13px; color: #815a53; font-size: 15px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.catalog-filter-options { display: flex; min-width: 0; min-height: 0; flex-direction: column; gap: 10px; padding: 0 2px 12px 0; overflow-y: auto; overscroll-behavior: contain; }
#brand-filter-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; padding-right: 0; }
#brand-filter-options .catalog-filter-option { justify-content: center; padding-right: 7px; padding-left: 7px; text-align: center; }
.catalog-filter-option { display: flex; width: 100%; min-width: 0; min-height: 53px; flex: 0 0 auto; align-items: center; padding: 12px 14px; color: #6d6561; background: #fff; border: 1px solid #dfd8d4; border-radius: 8px; font-size: 14px; line-height: 1.45; text-align: left; box-shadow: 0 3px 9px rgba(91, 72, 61, .025); }
.catalog-filter-option:hover, .catalog-filter-option:focus-visible { color: var(--accent); border-color: #cdb7af; outline: none; }
.catalog-filter-option.is-active { color: #fff; background: #9a675f; border-color: #9a675f; font-weight: 600; box-shadow: 0 5px 12px rgba(139, 102, 92, .12); }
.catalog-filter-option-label { min-width: 0; overflow-wrap: anywhere; }
.catalog-filter-footer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: #fffdfb; border-top: 1px solid #e9dfda; }
.catalog-filter-reset, .catalog-filter-apply { display: flex; min-width: 0; min-height: 54px; align-items: center; justify-content: center; padding: 10px 8px; border: 1px solid #ddd4cf; border-radius: 8px; font-size: 15px; font-weight: 500; line-height: 1.35; text-align: center; }
.catalog-filter-reset { color: #746b67; background: #fff; }
.catalog-filter-apply { color: #fff; background: #9a675f; border-color: #9a675f; }
.catalog-filter-reset:hover, .catalog-filter-reset:focus-visible { color: var(--accent); border-color: #cdb7af; outline: none; }
.catalog-filter-apply:hover, .catalog-filter-apply:focus-visible { background: #865b54; border-color: #865b54; outline: none; }

@keyframes catalog-filter-sheet-enter {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-filter-sheet { animation: none; }
  .catalog-filter-chevron { transition: none; }
}

@media (max-width: 359px) {
  .catalog-section-heading { flex-wrap: nowrap; gap: 0; }
  .section-heading-copy { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-start; gap: 0; }
  .catalog-filter-actions { display: flex; width: auto; flex: 0 1 auto; gap: 10px; margin-left: 12px; }
  .catalog-filter-trigger { min-height: 52px; padding: 0 1px; font-size: 13px; }
  .catalog-filter-current { max-width: 48px; margin-left: 2px; font-size: 10px; }
  .catalog-filter-chevron { margin-left: 4px; }
  .catalog-filter-sheet-header { padding: 0 13px 0 18px; }
  .catalog-filter-sheet-header h2 { font-size: 18px; }
  .catalog-filter-groups { padding-right: 7px; padding-left: 7px; }
  .catalog-filter-group { padding-right: 5px; padding-left: 5px; font-size: 13px; }
  .catalog-filter-choices { padding-right: 10px; padding-left: 12px; }
  .catalog-filter-option { padding-right: 10px; padding-left: 10px; font-size: 13px; }
  .catalog-filter-footer { gap: 9px; padding-right: 12px; padding-left: 12px; }
  .catalog-filter-reset, .catalog-filter-apply { font-size: 14px; }
}

.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 8px; }
.product-card { display: block; min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: 0 4px 14px rgba(91, 72, 61, .035); transition: transform .18s ease, box-shadow .18s ease; }
.product-card:hover, .product-card:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(91, 72, 61, .1); outline: none; }
.product-image-wrap { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; min-height: 0; overflow: hidden; background: #f7ede6; }
.product-image { position: absolute; inset: 10px; top: 10px; right: 10px; bottom: 10px; left: 10px; display: block; width: calc(100% - 20px); height: calc(100% - 20px); min-width: 0; min-height: 0; object-fit: contain; border-radius: 6px; background: #fff; }
.product-info { display: block; padding: 12px 14px 14px; }
.product-brand { display: inline-block; max-width: 100%; padding: 2px 7px; overflow: hidden; color: var(--accent); border: 1px solid #eedfda; border-radius: 8px; font-size: 9.5px; letter-spacing: .12em; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.product-name { display: -webkit-box; min-height: 40px; margin: 8px 0 0; overflow: hidden; color: #4a4441; font-size: 13px; font-weight: 500; letter-spacing: .02em; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-top: 8px; }
.product-price {
  flex: 0 0 auto;
  color: var(--price);
  font-family: Arial, Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}
.product-price span { margin-right: 1px; font-size: 11px; font-weight: 500; }
.product-spec { min-width: 0; overflow: hidden; color: #a79a93; font-size: 10px; letter-spacing: .04em; line-height: 1.3; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

.empty-state { padding: 50px 16px 35px; color: var(--muted); text-align: center; }
.empty-mark { display: grid; width: 54px; height: 54px; margin: 0 auto 14px; place-items: center; color: var(--accent); background: #f5e8e3; border-radius: 50%; font-family: Georgia, "Times New Roman", serif; font-size: 31px; }
.empty-state h3, .not-found h1 { margin: 0; color: #665a55; font-size: 16px; font-weight: 600; }
.empty-state p { margin: 7px 0 16px; font-size: 12px; }
.text-button, .primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 17px; color: #fff; background: var(--accent); border-radius: 6px; font-size: 12px; }
.text-button:hover, .text-button:focus-visible, .primary-button:hover, .primary-button:focus-visible { background: var(--accent-dark); outline: none; }

.site-footer { padding: 14px 16px 8px; color: #b5a9a3; text-align: center; }
.site-footer p { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 9px; line-height: 1.4; }
.bottom-nav { position: fixed; z-index: 10; bottom: 0; left: 50%; display: grid; grid-template-columns: repeat(2, 1fr); width: min(100%, var(--frame-width)); padding: 8px 18px calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 253, 251, .96); border-top: 1px solid #eee5df; box-shadow: 0 -7px 18px rgba(85, 68, 58, .06); transform: translateX(-50%); backdrop-filter: blur(12px); }
.bottom-nav.has-cart { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bottom-link { display: flex; min-height: 47px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #aaa09b; font-size: 10px; }
.bottom-link.active { color: var(--accent); }
.bottom-icon { width: 20px; height: 20px; }
.bottom-link:hover, .bottom-link:focus-visible { color: var(--accent-dark); outline: none; }
.cart-bottom-link { position: relative; }
.cart-nav-badge {
  position: absolute;
  top: 0;
  left: calc(50% + 7px);
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  color: #fff;
  background: #a65f55;
  border: 2px solid #fffdfb;
  border-radius: 9px;
  font-family: Arial, sans-serif;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}
.cart-nav-badge[hidden] { display: none; }

body.cart-page { overflow-x: hidden; background: #e9e4df; }
.cart-frame { background: #fcfaf8; }
.cart-header {
  padding: 25px 18px 22px;
  background: #f2dfd8;
  border-radius: 0 0 22px 22px;
}
.cart-header p {
  margin: 0 0 5px;
  color: #9a8179;
  font-size: 11px;
  line-height: 1.4;
}
.cart-header h1 {
  margin: 0;
  color: #554945;
  font-family: "Songti SC", STSong, SimSun, Georgia, serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.35;
}
.cart-main { padding: 22px 14px 8px; }
.cart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
  padding: 0 2px;
}
.cart-heading h2 { margin: 0; color: #443d39; font-size: 19px; font-weight: 600; line-height: 1.4; }
.cart-heading p { margin: 0; color: #a59993; font-size: 10px; line-height: 1.4; white-space: nowrap; }
.cart-list { display: grid; gap: 10px; }
.cart-list[hidden] { display: none; }
.cart-item {
  display: grid;
  min-width: 0;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 11px;
  padding: 10px;
  background: #fff;
  border: 1px solid #e4c7c0;
  border-radius: 7px;
  box-shadow: 0 2px 8px rgba(154, 103, 92, .055);
}
.cart-item-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f8ece9;
  border-radius: 5px;
}
.cart-item-image {
  position: absolute;
  inset: 6px;
  top: 6px;
  right: 6px;
  bottom: 6px;
  left: 6px;
  display: block;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  object-fit: contain;
}
.cart-item-content { min-width: 0; }
.cart-item-name {
  display: -webkit-box;
  min-height: 38px;
  overflow: hidden;
  color: #443d39;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.cart-item-meta { margin: 4px 0 0; overflow: hidden; color: #a29690; font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-price {
  margin: 7px 0 0;
  color: var(--price);
  font-family: Arial, Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  line-height: 1.1;
}
.cart-item-price span { margin-right: 1px; font-size: 10px; font-weight: 500; }
.cart-item-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; }
.cart-quantity-stepper {
  display: grid;
  width: 101px;
  height: 34px;
  grid-template-columns: 33px 35px 33px;
  overflow: hidden;
  background: #fbf6f3;
  border: 1px solid #eadbd5;
  border-radius: 6px;
}
.cart-quantity-button,
.cart-remove-button { display: grid; padding: 0; place-items: center; color: #806d65; background: transparent; }
.cart-quantity-button { width: 33px; height: 32px; }
.cart-quantity-button[disabled] { cursor: default; opacity: .35; }
.cart-quantity-value { display: grid; min-width: 0; height: 32px; place-items: center; color: #514844; font-family: Arial, sans-serif; font-size: 12px; font-weight: 600; line-height: 1; }
.cart-remove-button { width: 34px; height: 34px; border-radius: 50%; }
.cart-quantity-button:hover:not([disabled]),
.cart-quantity-button:focus-visible,
.cart-remove-button:hover,
.cart-remove-button:focus-visible { color: var(--accent-dark); background: #f3e7e2; outline: none; }
.cart-quantity-button svg,
.cart-remove-button svg { display: block; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.cart-empty { padding: 70px 15px 42px; color: #9e918b; text-align: center; }
.cart-empty[hidden] { display: none; }
.cart-empty > span { display: grid; width: 58px; height: 58px; margin: 0 auto 15px; place-items: center; color: #9a675c; background: #f5e7e3; border-radius: 50%; }
.cart-empty svg { display: block; width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.cart-empty h2 { margin: 0; color: #665a55; font-size: 16px; font-weight: 600; line-height: 1.5; }
.cart-empty p { margin: 6px 0 17px; font-size: 12px; line-height: 1.5; }
.cart-total {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 4px 4px;
  border-top: 1px solid #eadfd9;
}
.cart-total[hidden] { display: none; }
.cart-total > div span { display: block; color: #a39791; font-size: 10px; line-height: 1.4; }
.cart-total > div strong { display: block; margin-top: 2px; color: #5b504b; font-size: 14px; font-weight: 600; line-height: 1.4; }
.cart-total > p { margin: 0; color: var(--price); font-family: Arial, sans-serif; font-variant-numeric: lining-nums tabular-nums; line-height: 1; white-space: nowrap; }
.cart-total > p span { margin-right: 2px; font-size: 12px; }
.cart-total > p strong { font-size: 23px; }

@media (max-width: 359px) {
  .cart-main { padding-right: 12px; padding-left: 12px; }
  .cart-item { grid-template-columns: 76px minmax(0, 1fr); gap: 9px; padding: 9px; }
  .cart-item-name { min-height: 34px; font-size: 12px; }
  .cart-item-price { font-size: 16px; }
  .cart-item-controls { margin-top: 9px; }
}

/* Category page: primary categories on the left, child categories and products on the right. */
body.category-browser-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overflow-x: hidden;
  background: #e9e4df;
}
.category-browser-frame {
  display: grid;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr);
  background: #fffdfb;
}
.category-browser-header {
  position: relative;
  z-index: 20;
  padding: 20px 16px 15px;
  background: #f2dfd8;
}
.category-browser-brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.category-browser-brand h1 {
  margin: 0;
  color: #554945;
  font-family: "Songti SC", STSong, SimSun, Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.35;
}
.category-browser-brand p {
  margin: 0;
  color: #9a8179;
  font-size: 11px;
  line-height: 1.4;
}
.category-search {
  display: flex;
  min-height: 46px;
  align-items: center;
  padding: 0 10px 0 15px;
  background: rgba(255, 254, 253, .94);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px;
  box-shadow: 0 6px 16px rgba(112, 83, 73, .055);
}
.category-search input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 9px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
}
.category-search input::placeholder { color: #aa9992; }
.category-search input::-webkit-search-cancel-button { display: none; }
.category-search .icon-button[hidden] { display: none; }
.category-side-button:focus-visible,
.category-child-button:focus-visible,
.category-product-tile:focus-visible {
  outline: 2px solid rgba(154, 103, 92, .35);
  outline-offset: 2px;
}
.category-browser-main {
  display: grid;
  min-height: 0;
  overflow: hidden;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: stretch;
}
.category-side-rail {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0 18px;
  background: #f7f1ed;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.category-side-rail::-webkit-scrollbar { display: none; }
.category-side-button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 66px;
  padding: 10px 9px;
  place-items: center;
  color: #736761;
  background: transparent;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-align: center;
}
.category-side-button.is-active {
  color: #875b52;
  background: #fffdfb;
  font-weight: 600;
}
.category-side-button.is-active::before {
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 0;
  width: 3px;
  background: #9a675c;
  border-radius: 0 2px 2px 0;
  content: "";
}
.category-results {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 0 10px 28px;
  background: #fffdfb;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.category-results::-webkit-scrollbar { display: none; }
.category-child-tabs-panel {
  position: sticky;
  z-index: 15;
  top: 0;
  margin: 0 -10px;
  padding: 17px 10px 13px;
  background: #fffdfb;
}
.category-child-tabs {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}
.category-child-button {
  min-width: 0;
  min-height: 42px;
  flex: 1 1 calc(50% - 4px);
  padding: 7px 9px;
  color: #776963;
  background: #f8f1ed;
  border: 1px solid #eadbd5;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.category-child-button.is-active {
  color: #fffaf7;
  background: #9a675c;
  border-color: #9a675c;
}
.category-results-heading {
  display: flex;
  min-height: 28px;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
  padding: 0 2px;
}
.category-results-heading h2 {
  min-width: 0;
  margin: 0;
  color: #443d39;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.category-results-heading p {
  flex: 0 0 auto;
  margin: 0;
  color: #aa9e98;
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
}
.category-product-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 8px;
}
.category-product-tile {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #4d4642;
  background: #fff;
  border: 1px solid #e4c7c0;
  border-radius: 7px;
  box-shadow: 0 2px 7px rgba(154, 103, 92, .06);
  text-align: left;
}
.category-product-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f8ece9;
}
.category-product-image {
  position: absolute;
  inset: 7px;
  top: 7px;
  right: 7px;
  bottom: 7px;
  left: 7px;
  display: block;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  object-fit: contain;
  background: #f8ece9;
}
.category-product-info {
  display: block;
  min-width: 0;
  padding: 8px 8px 10px;
}
.category-product-name {
  display: -webkit-box;
  min-height: 36px;
  margin: 0;
  overflow: hidden;
  color: #4d4642;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.category-product-price {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: var(--price);
  font-family: Arial, Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.category-product-price > span {
  margin-right: 1px;
  font-size: 10px;
  font-weight: 500;
}
.category-product-tile:active .category-product-image-wrap { transform: scale(.98); }
.category-empty {
  padding: 48px 5px 30px;
  color: #a2948e;
  text-align: center;
}
.category-empty > span {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 13px;
  place-items: center;
  color: #9a675c;
  background: #f6e8e4;
  border-radius: 50%;
}
.category-empty svg {
  display: block;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}
.category-empty strong {
  display: block;
  color: #71645e;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
.category-empty p {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 359px) {
  .category-browser-main { grid-template-columns: 88px minmax(0, 1fr); }
  .category-side-button { min-height: 62px; padding-right: 7px; padding-left: 7px; font-size: 12px; }
  .category-results { padding-right: 8px; padding-left: 8px; }
  .category-child-tabs-panel { margin-right: -8px; margin-left: -8px; padding-right: 8px; padding-left: 8px; }
  .category-child-tabs { gap: 6px; }
  .category-child-button { min-height: 40px; padding-right: 6px; padding-left: 6px; font-size: 11px; }
  .category-product-grid { column-gap: 6px; }
  .category-product-image { inset: 6px; top: 6px; right: 6px; bottom: 6px; left: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
  .category-product-info { padding-right: 6px; padding-left: 6px; }
  .category-product-name { font-size: 11px; }
  .category-product-price { font-size: 15px; }
}

/* Homepage presentation is scoped so product-detail and image-save views stay unchanged. */
body.catalog-page {
  --catalog-card-line: #e4c7c0;
  --catalog-card-soft: #fff;
  overflow-x: hidden;
  background: #fff;
}
.catalog-page .site-frame { background: #fff; box-shadow: none; }
.catalog-page .catalog-sticky-controls {
  position: sticky;
  z-index: 20;
  top: 0;
  background: #fff;
  box-shadow: 0 4px 10px rgba(85, 68, 58, .055);
}

/* Keep the store name visible above search and the fixed filter row. */
.catalog-page .catalog-brand-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: calc(16px + env(safe-area-inset-top)) 12px 0;
  color: #8f5e55;
  font-family: "Songti SC", STSong, SimSun, Georgia, serif;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}

.catalog-page .catalog-sticky-controls > .catalog-brand-title + .hero {
  padding-top: 0;
}

.catalog-page .catalog-brand-count {
  color: #a4776e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}
.catalog-page .catalog-row-count {
  align-self: center;
  margin-left: auto;
  padding-left: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.catalog-page .hero,
.catalog-page .catalog-section-heading,
.catalog-page .bottom-nav { background-color: #fff; }
.catalog-page .hero {
  min-height: 0;
  padding: calc(16px + env(safe-area-inset-top)) 12px 12px;
  background: #fff;
  border-radius: 0;
}
.catalog-page .wordmark h1 {
  color: #554945;
  font-family: "Songti SC", STSong, SimSun, Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.3;
}
.catalog-page .wordmark p {
  margin: 8px 0 27px;
  color: #957f78;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.2;
}
.catalog-page .search-form {
  min-height: 48px;
  padding: 0 12px 0 17px;
  background: #f1f0ef;
  border-color: #ece8e5;
  border-radius: 8px;
  box-shadow: none;
}
.catalog-page .search-form input {
  height: 44px;
  padding: 0 9px;
  font-size: 14px;
}
.catalog-page .hero-copy { margin-top: 29px; }
.catalog-page .hero-title {
  color: #725f59;
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
}
.catalog-page .hero-subtitle {
  margin-top: 5px;
  color: #a4877e;
  font-size: 11px;
  letter-spacing: 0;
}
.catalog-page .brand-section { padding: 0 16px; }
.catalog-page #brand-tabs {
  gap: 0;
  min-height: 59px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e5ddd7;
  border-radius: 30px;
  box-shadow: 0 5px 14px rgba(84, 67, 58, .055);
  scroll-padding: 6px;
}
.catalog-page #brand-tabs .filter-button {
  min-height: 45px;
  padding: 0 20px;
  background: transparent;
  border-color: transparent;
  border-radius: 23px;
  font-size: 12px;
  letter-spacing: 0;
}
.catalog-page #brand-tabs .filter-button.is-active {
  color: #fffaf7;
  background: #9a675c;
  border-color: #9a675c;
  box-shadow: none;
}
.catalog-page .category-section { padding: 24px 16px 0; }
.catalog-page .category-section > .filter-track:first-child { gap: 10px; padding: 1px 0 4px; }
.catalog-page .category-section > .filter-track:first-child .filter-button {
  min-height: 45px;
  padding: 0 20px;
  background: #fff;
  border-color: #e2dcd7;
  border-radius: 23px;
  font-size: 12px;
  letter-spacing: 0;
}
.catalog-page .category-section > .filter-track:first-child .filter-button.is-active {
  color: #fffaf7;
  background: #9a675c;
  border-color: #9a675c;
  box-shadow: none;
}
.catalog-page .sub-filter-track { margin-top: 7px; }
.catalog-page .catalog-main { padding: 10px 8px 0; }
.catalog-page .catalog-section-heading { margin: 0; padding: 0 12px; }
.catalog-page .section-heading h1,
.catalog-page .section-heading h2 {
  color: #8f5e55;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}
.catalog-page .catalog-filter-trigger {
  color: #8f5e55;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
}
.catalog-page .catalog-filter-prefix { font-weight: 600; }
.catalog-page .section-heading p {
  color: #a99e98;
  font-size: 10.5px;
  letter-spacing: 0;
}
.catalog-page .product-grid { gap: 10px 8px; }
.catalog-page .product-card {
  background: #fff;
  border-color: var(--catalog-card-line);
  box-shadow: 0 2px 8px rgba(154, 103, 92, .065);
}
.catalog-page .product-card:hover,
.catalog-page .product-card:focus-visible { box-shadow: 0 6px 15px rgba(154, 103, 92, .12); }
.catalog-page .product-image-wrap { background: #fff; }
.catalog-page .product-image {
  inset: 11px;
  top: 11px;
  right: 11px;
  bottom: 11px;
  left: 11px;
  width: calc(100% - 22px);
  height: calc(100% - 22px);
  background: #fff;
}
.catalog-page .product-brand {
  border-color: var(--catalog-card-line);
  letter-spacing: 0;
}
.catalog-page .product-name { letter-spacing: 0; }
.catalog-page .product-spec { letter-spacing: 0; }

body.category-browser-page,
.category-browser-frame,
.category-browser-header,
.category-browser-main,
.category-side-rail,
.category-results,
.category-child-tabs-panel {
  background: #fff;
}
.category-browser-header {
  border-bottom: 1px solid #eee8e4;
}
.category-side-rail {
  border-right: 1px solid #eee8e4;
}
.category-side-button.is-active,
.category-product-tile,
.category-product-image-wrap,
.category-product-image,
.category-product-info {
  background: #fff;
}
.category-child-button:not(.is-active) {
  background: #fff;
}

body.cart-page,
.cart-frame,
.cart-header,
.cart-main,
.cart-list,
.cart-item,
.cart-item-image-wrap,
.cart-item-image,
.cart-empty,
.cart-total {
  background: #fff;
}
.cart-header {
  border-bottom: 1px solid #eee8e4;
}
.category-browser-brand h1,
.category-browser-brand p,
.cart-header h1,
.cart-header p {
  color: #8f5e55;
}
.category-search {
  background: #f1f0ef;
  border-color: #ece8e5;
  border-radius: 8px;
  box-shadow: none;
}

/* Homepage filter preview: expand panels below the fixed filter row. */
body.catalog-page.catalog-filter-open { overflow: hidden; }
.catalog-page .catalog-sticky-controls { overflow: visible; }
.catalog-page .catalog-filter-overlay {
  position: fixed;
  z-index: 30;
  top: var(--catalog-filter-top, 0px);
  right: auto;
  bottom: var(--catalog-filter-bottom, 64px);
  left: 50%;
  display: block;
  width: min(100%, var(--frame-width));
  overflow: hidden;
  background: #fff;
  transform: translateX(-50%);
  border-top: 1px solid #eadfd9;
  box-shadow: 0 8px 18px rgba(85, 68, 58, .08);
}
.catalog-page .catalog-filter-overlay[hidden] { display: none; }
.catalog-page .catalog-filter-sheet {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  animation: catalog-filter-expand-down .16s ease-out;
}
.catalog-page .catalog-filter-sheet-header {
  min-height: 52px;
  padding: 0 14px 0 16px;
  background: #fff;
}
.catalog-page .catalog-filter-sheet-header h2 { font-size: 17px; }
.catalog-page .catalog-filter-close {
  width: 36px;
  height: 36px;
  padding: 9px;
  box-shadow: none;
}
.catalog-page .catalog-filter-body { min-height: 0; }
.catalog-page .catalog-filter-groups { background: #fff; }
.catalog-page .catalog-filter-choices { background: #fff; }
.catalog-page .catalog-filter-footer {
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
}
.catalog-page .catalog-filter-reset,
.catalog-page .catalog-filter-apply {
  min-height: 46px;
  font-size: 14px;
}
.catalog-page .catalog-filter-trigger[aria-expanded="true"] { color: var(--accent); }

@keyframes catalog-filter-expand-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-frame { position: relative; }
.detail-header {
  position: absolute;
  z-index: 10;
  top: 16px;
  left: 16px;
  width: 44px;
  height: 44px;
  min-height: 0;
  padding: 0;
  background: transparent;
}
.back-link {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff;
  background: rgba(38, 40, 42, .68);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(20, 20, 20, .2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.back-link svg { width: 22px; height: 22px; stroke-width: 2; }
.back-link:hover, .back-link:focus-visible { color: #fff; background: rgba(38, 40, 42, .84); outline: none; }
.back-link:active { transform: scale(.96); }
.detail-cart-bar {
  position: fixed;
  z-index: 12;
  bottom: 0;
  left: 50%;
  width: min(100%, var(--frame-width));
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 251, .97);
  border-top: 1px solid #eadfd9;
  box-shadow: 0 -7px 18px rgba(85, 68, 58, .08);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.detail-cart-bar[hidden] { display: none; }
.add-to-cart-button {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  color: #fffaf7;
  background: #9a675c;
  border-radius: 8px;
  box-shadow: 0 5px 13px rgba(139, 102, 92, .18);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}
.add-to-cart-button svg {
  display: block;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.add-to-cart-button:hover,
.add-to-cart-button:focus-visible { background: #81564d; outline: none; }
.add-to-cart-button:active { transform: scale(.99); }
.add-to-cart-button.is-added { background: var(--sage); box-shadow: 0 5px 13px rgba(111, 130, 119, .2); }
.detail-main { padding: 22px 16px 0; }
.detail-product { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-card); }
.detail-image-wrap {
  position: relative;
  display: grid;
  aspect-ratio: 1 / 1;
  place-items: center;
  overflow: hidden;
  background: #f3efeb;
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.detail-image { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; pointer-events: none; -webkit-touch-callout: none; -webkit-user-drag: none; -webkit-user-select: none; user-select: none; }
.image-longpress-shield { position: absolute; z-index: 1; inset: 0; top: 0; right: 0; bottom: 0; left: 0; display: block; background: rgba(255, 255, 255, .001); touch-action: pan-y; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.gallery-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: #675a55;
  background: rgba(255, 253, 251, .9);
  border: 1px solid rgba(111, 92, 83, .14);
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(69, 53, 45, .12);
  transform: translateY(-50%);
  backdrop-filter: blur(7px);
}
.gallery-nav:hover, .gallery-nav:focus-visible { color: var(--accent-dark); background: #fff; outline: 2px solid rgba(139, 102, 92, .28); outline-offset: 2px; }
.gallery-nav:active { transform: translateY(-50%) scale(.95); }
.gallery-nav[hidden] { display: none; }
.gallery-nav svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }
/* Main gallery changes images by swipe or thumbnails; keep the image unobstructed. */
.detail-image-wrap > .gallery-nav { display: none !important; }
.gallery-counter {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 10px;
  min-width: 45px;
  padding: 5px 8px;
  color: #fff;
  background: rgba(48, 47, 45, .7);
  border-radius: 13px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  line-height: 1;
  text-align: center;
}
.gallery-counter[hidden] { display: none; }
.gallery-thumbnails {
  display: flex;
  gap: 8px;
  min-height: 76px;
  padding: 9px 10px 10px;
  overflow-x: auto;
  background: #fff;
  border-top: 1px solid var(--line);
  scrollbar-color: #c8bbb4 transparent;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.gallery-thumbnails[hidden] { display: none; }
.gallery-thumbnail {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  padding: 2px;
  overflow: hidden;
  background: #f3efeb;
  border: 2px solid transparent;
  border-radius: 5px;
  scroll-snap-align: start;
}
.gallery-thumbnail:hover, .gallery-thumbnail:focus-visible { border-color: #cbbab3; outline: none; }
.gallery-thumbnail.is-active { border-color: var(--accent); }
.gallery-thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.detail-copy { padding: 16px 16px 18px; }
.detail-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-brand { margin: 0 0 7px; color: var(--sage); font-size: 12px; }
.detail-brand-row .detail-brand { min-width: 0; margin-bottom: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-share {
  display: inline-flex;
  min-height: 34px;
  flex: 0 0 auto;
  margin-left: auto;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  color: var(--accent);
  background: #f8f1ed;
  border: 1px solid #eaded8;
  border-radius: 6px;
  font-size: 11px;
}
.detail-share:hover, .detail-share:focus-visible { color: #fff; background: var(--accent); outline: none; }
.detail-share svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.detail-copy h1 { margin: 0; color: #453f3b; font-size: 21px; font-weight: 650; line-height: 1.45; }
.detail-brand-row + h1 { margin-top: 9px; }
.detail-price {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 13px;
  color: var(--price);
  font-family: Arial, Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  letter-spacing: 0;
}
.detail-price[hidden] { display: none; }
.detail-price span { font-size: 16px; font-weight: 600; line-height: 1; }
.detail-price strong { font-size: 27px; font-weight: 700; line-height: 1; }
.detail-price em { color: #a79a93; font-size: 12px; font-style: normal; font-weight: 400; line-height: 1; }
.detail-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin-top: 20px;
  border-top: 1px solid var(--line);
}
.detail-meta div {
  display: grid;
  min-width: 0;
  min-height: 50px;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.detail-meta[hidden], .detail-meta div[hidden] { display: none; }
.detail-meta span { display: block; margin: 0; color: #a79a93; font-size: 12px; line-height: 1.5; }
.detail-meta strong { display: block; overflow: hidden; color: #665a55; font-size: 13px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.filing-button {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  padding: 0 20px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
.filing-button:hover, .filing-button:focus-visible { color: var(--accent-dark); background: #fbf7f4; outline: none; }
.filing-button[hidden] { display: none; }
.detail-note { display: flex; gap: 10px; margin: 15px 0 25px; padding: 14px 15px; background: #f4f7f3; border: 1px solid #e3ebe5; border-radius: var(--radius-card); }
.note-icon { flex: 0 0 auto; width: 22px; height: 22px; color: var(--sage); }
.detail-note strong { display: block; color: #65756b; font-size: 12px; font-weight: 600; }
.detail-note p { margin: 4px 0 0; color: #89958e; font-size: 11px; line-height: 1.5; }
.detail-description { margin-bottom: 26px; }
.detail-description .section-heading { padding-bottom: 10px; }
.description-copy { margin: 0 2px 18px; color: #6d625d; font-size: 12px; line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
.product-long-images { overflow: hidden; background: #fff; }
.product-long-image-wrap { position: relative; width: 100%; overflow: hidden; background: #fff; touch-action: pan-y; -webkit-touch-callout: none; }
.product-long-images img { display: block; width: 100%; height: auto; max-width: 100%; background: #fff; pointer-events: none; -webkit-touch-callout: none; -webkit-user-drag: none; -webkit-user-select: none; user-select: none; }
.product-long-image-wrap + .product-long-image-wrap { border-top: 1px solid var(--line); }
.detail-video-section { margin-bottom: 26px; }
.detail-video-section .section-heading { padding-bottom: 12px; }
.detail-video { display: block; width: 100%; max-height: min(70vh, 520px); background: #1f1d1c; border-radius: var(--radius-card); object-fit: contain; }
.related-section .section-heading { padding-bottom: 12px; }
.related-grid { gap: 10px; }
.related-grid .product-info { padding: 8px; }
.related-grid .product-name { font-size: 12px; }
.related-grid .product-price { font-size: 15px; }
.not-found { padding: 50px 15px; text-align: center; }
.not-found .primary-button { margin-top: 18px; }

/* Detail preview: remove outer gutters while preserving the original image. */
body.detail-page {
  background: #fff;
}
.detail-page .site-frame {
  background: #fff;
  box-shadow: none;
}
.detail-page .detail-main {
  padding: 0;
}
.detail-page .detail-product {
  border: 0;
  border-radius: 0;
}
.detail-page .detail-image-wrap {
  background: #fff;
}
.detail-page .gallery-thumbnails {
  background: #fff;
}
.detail-page .product-long-images {
  background: #fff;
}
.detail-page .detail-cart-bar {
  padding-right: 0;
  padding-left: 0;
  background: rgba(255, 255, 255, .97);
}

.overlay {
  position: fixed;
  z-index: 50;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
  background: rgba(35, 31, 29, .58);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}
.overlay[hidden] { display: none; }
.overlay.is-open { opacity: 1; visibility: visible; }
.overlay-panel {
  position: relative;
  width: min(100%, 410px);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  padding: 21px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(35, 27, 23, .24);
  transform: translateY(10px);
  transition: transform .18s ease;
}
.overlay.is-open .overlay-panel { transform: translateY(0); }
.overlay-panel h2 { margin: 0 40px 17px 0; color: #4f4642; font-size: 18px; font-weight: 650; line-height: 1.4; }
.overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: #8f837d;
  background: transparent;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}
.overlay-close:hover, .overlay-close:focus-visible { color: var(--accent-dark); background: #f1e8e3; outline: none; }
.registration-track { display: flex; width: 100%; overflow-x: auto; background: #f7f0eb; border: 1px solid var(--line); border-radius: 6px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.registration-track::-webkit-scrollbar { display: none; }
.registration-slide { display: grid; min-width: 100%; min-height: 240px; place-items: center; scroll-snap-align: start; }
.registration-slide img { display: block; width: 100%; max-height: min(68vh, 560px); object-fit: contain; background: #fff; }
.registration-counter { min-height: 17px; margin: 10px 0 0; color: #9b8e87; font-family: Georgia, "Times New Roman", serif; font-size: 11px; line-height: 1; text-align: center; }
.share-panel { width: min(100%, 375px); }
.poster-container {
  position: relative;
  width: min(100%, 294px);
  aspect-ratio: 750 / 1300;
  margin: 0 auto;
  overflow: hidden;
  background: #f0e8e3;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.poster-container img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: auto;
  background: #f7f0eb;
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}
.poster-container img:not([src]) { visibility: hidden; }

html.legacy-image-layout .product-image-wrap,
html.legacy-image-layout .cart-item-image-wrap,
html.legacy-image-layout .category-product-image-wrap,
html.legacy-image-layout .detail-image-wrap {
  display: block;
  height: 0;
  padding-top: 100%;
}

html.legacy-image-layout .detail-image-wrap > .detail-image {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

html.legacy-image-layout .poster-container {
  height: 0;
  padding-top: 173.333333%;
}

html.legacy-image-layout .poster-container > img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
.poster-tip { min-height: 16px; margin: 10px 0 12px; color: #9a8d87; font-size: 10px; line-height: 1.6; text-align: center; white-space: pre-line; }
.poster-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
.poster-button {
  display: inline-flex;
  min-width: 0;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
}
.poster-button svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.poster-button-ghost { color: var(--accent); background: #f8f1ed; border: 1px solid #e7d9d2; }
.poster-button-primary { color: #fff; background: var(--accent); border: 1px solid var(--accent); }
.poster-button:hover, .poster-button:focus-visible { filter: brightness(.94); outline: none; }
.poster-button[disabled] { cursor: wait; opacity: .45; filter: none; }

.image-save-overlay { align-items: flex-end; padding: 0; }
.image-save-sheet {
  width: min(100%, 430px);
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  background: #fff;
  border-radius: 15px 15px 0 0;
  box-shadow: 0 -12px 35px rgba(35, 27, 23, .18);
  transform: translateY(12px);
  transition: transform .18s ease;
}
.overlay.is-open .image-save-sheet { transform: translateY(0); }
.image-save-sheet h2 { margin: 0 0 8px; color: #8a7c75; font-size: 13px; font-weight: 500; line-height: 1.4; text-align: center; }
.image-save-option, .image-save-cancel {
  display: block;
  width: 100%;
  min-height: 52px;
  color: #3f3936;
  background: #fff;
  border-top: 1px solid #eee8e4;
  font-size: 16px;
  text-align: center;
}
.image-save-option:first-of-type { border-top: 0; }
.image-save-option:active { background: #f8f2ee; }
.image-save-cancel { margin-top: 10px; border: 0; border-radius: 9px; background: #f6f1ee; }
.image-save-option[disabled], .image-save-cancel[disabled] { cursor: wait; opacity: .55; }
.image-save-option[hidden] { display: none; }

/* WeChat uses its native image long-press menu; keep the image itself touchable. */
html.is-wechat-browser .detail-image,
html.is-wechat-browser .product-long-images img {
  pointer-events: auto;
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}
html.is-wechat-browser .detail-image-wrap,
html.is-wechat-browser .product-long-image-wrap {
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}
html.is-wechat-browser .detail-image-wrap {
  touch-action: pan-y pan-x;
}

.image-preview-trigger { cursor: zoom-in; }
.image-preview-trigger:focus-visible {
  outline: 2px solid rgba(139, 102, 92, .78);
  outline-offset: -4px;
}
.image-preview-overlay {
  position: fixed;
  z-index: 70;
  top: 0;
  bottom: 0;
  left: 50%;
  display: grid;
  width: min(100%, var(--frame-width));
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #121110;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
  transition: opacity .18s ease, visibility .18s ease;
  overscroll-behavior: contain;
}
.image-preview-overlay[hidden] { display: none; }
.image-preview-overlay.is-open { opacity: 1; visibility: visible; }
.image-preview-stage {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: calc(58px + env(safe-area-inset-top)) 10px calc(60px + env(safe-area-inset-bottom));
  place-items: center;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.image-preview-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-out;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}
.image-preview-close,
.image-preview-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: rgba(54, 52, 50, .78);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.image-preview-close {
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
}
.image-preview-nav {
  top: 50%;
  transform: translateY(-50%);
}
.image-preview-prev { left: 10px; }
.image-preview-next { right: 10px; }
.image-preview-close svg,
.image-preview-nav svg {
  display: block;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}
.image-preview-close:hover,
.image-preview-close:focus-visible,
.image-preview-nav:hover,
.image-preview-nav:focus-visible {
  color: #fff;
  background: rgba(111, 103, 98, .92);
  outline: 2px solid rgba(255, 255, 255, .72);
  outline-offset: 2px;
}
.image-preview-close:active { transform: scale(.95); }
.image-preview-nav:active { transform: translateY(-50%) scale(.95); }
.image-preview-nav[hidden] { display: none; }
/* The preview closes by tapping the stage and changes images by swiping. */
.image-preview-close,
.image-preview-nav {
  display: none !important;
}
.image-preview-counter {
  position: absolute;
  z-index: 2;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 50%;
  min-width: 54px;
  padding: 6px 10px;
  color: #fff;
  background: rgba(54, 52, 50, .78);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 15px;
  font-family: Arial, Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
  transform: translateX(-50%);
}

@media (max-height: 720px) {
  .poster-container { width: min(100%, 228px); }
}

@media (min-width: 600px) {
  .site-frame { min-height: 100vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Gift-area overlay: keep the current storefront navigation at four columns. */
.bottom-nav.has-gift {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.catalog-page.gift-catalog-page,
body.catalog-page.gift-catalog-page .site-frame,
body.catalog-page.gift-catalog-page .product-image-wrap,
body.catalog-page.gift-catalog-page .product-image {
  background: #fff !important;
}

body.catalog-page.gift-catalog-page .site-frame {
  box-shadow: none !important;
}

body.catalog-page.gift-catalog-page .gift-brand-title {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 16px 12px 0;
  color: #8f5e55;
  font-size: 27px;
  line-height: 1.35;
  text-align: center;
}

body.catalog-page.gift-catalog-page .gift-brand-title .catalog-brand-name {
  display: block;
  color: #8f5e55;
  font-family: "Songti SC", STSong, SimSun, Georgia, serif;
  font-size: 27px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.35;
}

body.catalog-page.gift-catalog-page .gift-section-heading {
  min-height: 53px;
  padding: 0 12px;
}

body.catalog-page.gift-catalog-page .gift-catalog-main {
  padding-top: 10px;
}

.gift-access-loading,
.gift-access-gate {
  min-height: calc(100vh - 238px);
}

.gift-access-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 48px 20px 90px;
  color: #9b8e88;
  font-size: 13px;
}

.gift-access-loading p { margin: 0; }

.gift-access-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e7ddd8;
  border-top-color: #95685e;
  border-radius: 50%;
  animation: gift-access-spin .75s linear infinite;
}

@keyframes gift-access-spin {
  to { transform: rotate(360deg); }
}

.gift-access-gate {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 54px 20px 92px;
  text-align: center;
}

.gift-access-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 17px;
  place-items: center;
  color: #8f5e55;
  background: #faf6f3;
  border: 1px solid #eaded8;
  border-radius: 50%;
}

.gift-access-mark svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.gift-access-gate h2 {
  margin: 0;
  color: #4f4744;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.gift-access-gate > p {
  margin: 8px 0 22px;
  color: #9d918c;
  font-size: 13px;
  line-height: 1.5;
}

.gift-access-form {
  width: min(100%, 338px);
}

.gift-access-form .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.gift-access-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
}

.gift-access-controls input,
.gift-access-controls button {
  min-height: 46px;
  border-radius: 6px;
  font-size: 14px;
}

.gift-access-controls input {
  width: 100%;
  min-width: 0;
  padding: 0 13px;
  color: #403a37;
  background: #fff;
  border: 1px solid #ded5d0;
  outline: none;
}

.gift-access-controls input::placeholder { color: #b3aaa5; }
.gift-access-controls input:focus { border-color: #9a675f; box-shadow: 0 0 0 3px rgba(154, 103, 95, .1); }

.gift-access-controls button {
  padding: 0 12px;
  color: #fff;
  background: #95685e;
  font-weight: 600;
  white-space: nowrap;
}

.gift-access-controls button:focus-visible { outline: 2px solid #684d46; outline-offset: 2px; }
.gift-access-controls button:active { background: #79574f; }
.gift-access-controls button:disabled { cursor: wait; opacity: .68; }

.gift-access-error {
  min-height: 20px;
  margin: 10px 2px 0;
  color: #b14747;
  font-size: 12px;
  line-height: 1.6;
}

.gift-access-loading[hidden],
.gift-access-gate[hidden],
.gift-catalog-content[hidden],
.gift-access-error[hidden] {
  display: none !important;
}

@media (max-width: 359px) {
  .gift-access-gate { padding-right: 12px; padding-left: 12px; }
  .gift-access-controls { grid-template-columns: minmax(0, 1fr) 88px; }
}

@media (prefers-reduced-motion: reduce) {
  .gift-access-spinner { animation: none; }
}
