:root {
  --bg: #ffffff;
  --canvas: #f8f6f3;
  --ink: #4f4642;
  --muted: #857b76;
  --line: #ece7e1;
  --bar: #a8a4a3;
  --accent: #5e7760;
  --accent-deep: #314634;
  --panel: #fcfbf8;
  --shadow: 0 10px 24px rgba(62, 49, 38, 0.08);
  --chat: #5da8ff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Noto Sans TC", sans-serif;
}

body.is-locked {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.announcement-bar {
  display: grid;
  place-items: center;
  min-height: 3.75rem;
  color: #fff;
  background: var(--bar);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.site-frame {
  width: min(100%, 40rem);
  margin: 0 auto;
  background: var(--bg);
  min-height: calc(100vh - 3.75rem);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.02);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 5.6rem;
  padding: 0 0.9rem;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}

.category-drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 28;
  width: min(76vw, 24rem);
  height: 100vh;
  padding: 1.45rem 1.25rem 1.8rem;
  background: #fff;
  box-shadow: 14px 0 30px rgba(29, 23, 18, 0.08);
  transform: translateX(-100%);
  transition: transform 220ms ease;
  overflow: auto;
}

.category-drawer.is-open {
  transform: translateX(0);
}

.category-drawer-header {
  padding-top: 3.9rem;
  margin-bottom: 1rem;
}

.category-drawer-header p {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 400;
}

.category-drawer-body {
  display: grid;
  gap: 0.3rem;
}

.category-group-toggle,
.category-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-size: 0.98rem;
}

.category-sublist {
  display: none;
  padding-left: 0.8rem;
}

.category-group.is-open .category-sublist {
  display: grid;
}

.category-chevron {
  color: var(--muted);
  font-size: 0.9rem;
}

.category-link {
  justify-content: flex-start;
}

.category-link.is-active {
  color: var(--accent-deep);
  font-weight: 700;
}

.category-overlay {
  position: fixed;
  inset: 0;
  z-index: 27;
  background: rgba(32, 26, 22, 0.42);
}

.checkout-header {
  grid-template-columns: 1fr auto auto;
  gap: 0.8rem;
}

.header-side {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.header-side-right {
  justify-content: flex-end;
}

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: #5b504c;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 1.55rem;
}

.icon-button svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-count {
  position: absolute;
  top: 0.2rem;
  right: 0.1rem;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.2rem;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--accent-deep);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-self: center;
  white-space: nowrap;
}

.brand-en,
.brand-zh {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.45rem;
  letter-spacing: 0.12rem;
}

.brand-divider {
  color: #8e847f;
  font-size: 0.95rem;
}

.back-link {
  color: var(--muted);
  font-size: 0.92rem;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 1.35rem;
  height: 2px;
  background: #5b504c;
  border-radius: 999px;
  content: "";
}

.hamburger {
  position: relative;
}

.hamburger::before {
  position: absolute;
  top: -0.38rem;
  left: 0;
}

.hamburger::after {
  position: absolute;
  top: 0.38rem;
  left: 0;
}

.site-nav {
  display: none;
  padding: 0.85rem 1.25rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.site-nav.is-open {
  display: grid;
  gap: 0.85rem;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.96rem;
}

.catalog-page {
  padding: 1.6rem 1.35rem 3rem;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.95rem;
}

.category-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.view-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.view-button {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  padding: 0;
  color: #7c716d;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.view-button span {
  display: block;
  width: 1rem;
  height: 2px;
  margin: 0.1rem 0;
  background: currentColor;
}

.view-button i {
  display: block;
  width: 0.25rem;
  height: 0.9rem;
  background: currentColor;
  border-radius: 999px;
}

.view-button[data-view="grid"] {
  grid-template-columns: repeat(2, auto);
  gap: 0.16rem;
}

.view-button.is-active {
  color: #514742;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 0.95rem;
}

.product-card {
  min-width: 0;
}

.product-card[hidden] {
  display: none !important;
}

.product-link {
  display: block;
}

.product-image {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(180deg, #fbfaf7 0%, #f3eee7 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.product-image.has-photo::before,
.product-image.has-photo::after {
  display: none;
}

.product-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.product-info {
  padding-top: 0.75rem;
  text-align: center;
}

.product-info h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.product-info p {
  margin: 0.35rem 0 0;
  color: #5f5550;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.add-cart-button,
.primary-action,
.submit-order {
  width: 100%;
  margin-top: 0.8rem;
  min-height: 2.8rem;
  padding: 0.8rem 1rem;
  color: #fff;
  background: var(--accent-deep);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
}

.add-cart-button {
  margin-top: 0.8rem;
  min-height: 2.35rem;
  padding: 0.55rem 0.85rem;
  background: #5f7460;
  font-size: 0.9rem;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(34, 26, 21, 0.38);
}

.cart-overlay[hidden],
.image-lightbox[hidden],
.category-overlay[hidden] {
  display: none !important;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(22, 18, 16, 0.82);
  cursor: pointer;
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(calc(100vw - 2rem), 46rem);
  max-height: calc(100vh - 2rem);
  display: grid;
  gap: 0.75rem;
}

.lightbox-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.38);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox-image {
  display: block;
  width: 100%;
  max-height: calc(100vh - 7rem);
  object-fit: contain;
  border-radius: 1rem;
  background: #fff;
}

.lightbox-caption {
  color: #fff;
}

.lightbox-caption h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  text-align: center;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(92vw, 25rem);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.2rem;
  background: #fff;
  box-shadow: -12px 0 36px rgba(28, 22, 18, 0.14);
  transform: translateX(100%);
  transition: transform 220ms ease;
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.cart-drawer-header,
.cart-summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.drawer-eyebrow {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cart-drawer-header h2,
.section-head h1,
.section-head h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
}

.cart-drawer-body,
.checkout-items {
  display: grid;
  align-content: start;
  gap: 0.9rem;
  padding: 1rem 0;
  overflow: auto;
}

.cart-drawer-body {
  flex: 0 1 auto;
  max-height: calc(100vh - 15.5rem);
}

.cart-item,
.checkout-item {
  display: grid;
  grid-template-columns: 4.6rem 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.cart-item-image,
.checkout-item-image {
  width: 4.6rem;
  height: 4.6rem;
  object-fit: cover;
  border-radius: 0.8rem;
}

.cart-item-info h3,
.checkout-item-info h3 {
  margin: 0 0 0.2rem;
  font-size: 0.96rem;
}

.cart-item-info p,
.checkout-item-info p,
.cart-note,
.empty-state,
.checkout-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.cart-item-actions {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.qty-control button {
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.qty-control span {
  min-width: 2rem;
  text-align: center;
  font-size: 0.92rem;
}

.remove-button {
  color: #9a6a64;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 0.88rem;
}

.cart-drawer-footer,
.summary-card {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.checkout-page {
  display: grid;
  gap: 1.4rem;
  padding: 1.4rem 1.35rem 3rem;
}

.checkout-section,
.checkout-summary {
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
}

.section-head {
  margin-bottom: 1rem;
}

.checkout-form {
  display: grid;
  gap: 0.95rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field span {
  font-size: 0.92rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #ddd5cc;
  border-radius: 1rem;
}

.total-line {
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
}

.empty-state {
  padding: 1rem 0;
}

.category-empty {
  padding-top: 1.25rem;
  text-align: center;
}

.site-footer {
  padding: 1.2rem 1.35rem 2rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.footer-title {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.footer-copy {
  margin: 0.55rem 0;
  line-height: 1.7;
}

.footer-link {
  color: var(--ink);
  font-weight: 700;
}

.is-list .product-grid {
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.is-list .product-link {
  display: grid;
  grid-template-columns: 7.4rem 1fr;
  align-items: center;
  gap: 0.9rem;
}

.is-list .product-info {
  padding-top: 0;
  text-align: left;
}

.is-list .product-image {
  aspect-ratio: 1 / 1;
}

@media (min-width: 721px) {
  .site-frame {
    margin-top: 1.2rem;
    border-radius: 1.5rem;
    overflow: hidden;
  }

  .site-header {
    top: 1.2rem;
  }

  .checkout-page {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }
}

@media (max-width: 420px) {
  .catalog-page,
  .checkout-page {
    padding-inline: 1rem;
  }

  .category-drawer {
    width: min(82vw, 24rem);
  }

  .site-footer {
    padding-inline: 1rem;
  }

  .category-title {
    font-size: 1.55rem;
  }

  .brand-en,
  .brand-zh {
    font-size: 1.28rem;
    letter-spacing: 0.08rem;
  }

  .product-grid {
    gap: 1.6rem 0.75rem;
  }

  .product-info h2,
  .product-info p {
    font-size: 0.98rem;
  }

  .cart-item,
  .checkout-item {
    grid-template-columns: 4.2rem 1fr;
  }

  .cart-item-actions {
    grid-column: 2;
    justify-items: start;
  }
}
