:root {
  --container: 1560px;
  --brand: #e24d2f;
  --brand-dark: #b93623;
  --ink: #252525;
  --muted: #737373;
  --page: #f5f5f5;
  --card: #ffffff;
  --line: #e6e6e6;
  --soft: #fff4ef;
  --success: #16734f;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.mall-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 260px minmax(260px, 680px) 150px;
  gap: 18px;
  align-items: center;
  padding: 14px max(24px, calc((100vw - var(--container)) / 2));
  background: linear-gradient(180deg, var(--brand) 0%, #f05b35 100%);
  color: #fff;
  box-shadow: 0 2px 14px rgba(173, 54, 32, 0.28);
}

.mall-logo {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.logo-box {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  font-weight: 900;
}

.search-bar {
  display: grid;
  grid-template-columns: 1fr 92px;
  overflow: hidden;
  border-radius: 3px;
  background: #fff;
}

.search-bar input {
  min-width: 0;
  border: 0;
  padding: 12px 14px;
  color: var(--ink);
  outline: none;
}

.search-bar button {
  border: 0;
  color: #fff;
  background: var(--brand-dark);
  font-weight: 800;
}

.header-order {
  justify-self: end;
  border: 1px solid rgba(255, 255, 255, 0.72);
  padding: 10px 18px;
  border-radius: 3px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}

.header-order span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  place-items: center;
  border-radius: 999px;
  color: var(--brand);
  background: #fff;
  font-size: 12px;
}

.store-page {
  display: grid;
  max-width: calc(var(--container) + 340px);
  grid-template-columns: 300px minmax(0, var(--container));
  column-gap: 24px;
  row-gap: 14px;
  align-items: start;
  margin: 0 auto;
  padding: 18px 0 32px;
}

.store-page > :not(.contact-rail) {
  grid-column: 2;
}

.store-hero,
.category-showcase,
.store-tabs,
.store-layout,
.order-dock {
  margin-inline: 16px;
}

.store-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.store-cover {
  position: relative;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 18px;
  min-height: 230px;
  align-items: end;
  padding: 26px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(31, 28, 26, 0.88), rgba(31, 28, 26, 0.52)),
    var(--hero-image, url("https://images.unsplash.com/photo-1512436991641-6745cdb1723f?auto=format&fit=crop&w=1300&q=82")) center / cover;
}

.store-avatar {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  font-size: 28px;
  font-weight: 900;
}

.store-main {
  min-width: 0;
}

.store-badge,
.section-kicker {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.store-main .store-badge {
  color: #ffd3c7;
}

.store-main h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
}

.store-main p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
}

.store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.contact-menu {
  position: relative;
}

.action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 3px;
  color: #fff;
  font-weight: 800;
}

.contact-trigger {
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.action.primary {
  border-color: #fff;
  color: var(--brand);
  background: #fff;
}

.contact-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 12px);
  z-index: 30;
  width: 360px;
  max-width: min(88vw, 360px);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.contact-menu:hover .contact-popover,
.contact-menu:focus-within .contact-popover,
.contact-menu.is-open .contact-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.contact-popover::before {
  position: absolute;
  left: 30px;
  top: -8px;
  width: 16px;
  height: 16px;
  content: "";
  background: #fff;
  transform: rotate(45deg);
}

.contact-popover-head {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
}

.contact-popover-head strong {
  font-size: 18px;
}

.contact-popover-head span,
.contact-method span {
  color: var(--muted);
  font-size: 13px;
}

.contact-method {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.contact-method + .contact-method {
  margin-top: 10px;
}

.contact-method strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--brand);
  font-size: 18px;
}

.qr-box,
.qr-box img,
.qr-placeholder {
  width: 92px;
  height: 92px;
}

.qr-box img {
  border-radius: 6px;
  object-fit: cover;
}

.qr-placeholder {
  display: grid;
  place-items: center;
  border: 6px solid #111;
  border-radius: 6px;
  color: #111;
  background:
    linear-gradient(90deg, #111 10px, transparent 10px) 0 0 / 20px 20px,
    linear-gradient(#111 10px, transparent 10px) 0 0 / 20px 20px,
    #fff;
  text-align: center;
}

.qr-placeholder span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 4px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.qr-placeholder small {
  max-width: 70px;
  overflow: hidden;
  padding: 2px 4px;
  border-radius: 3px;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-rail {
  display: grid;
  position: sticky;
  top: 86px;
  grid-column: 1;
  grid-row: 1 / span 4;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  margin: 0 0 0 16px;
}

.contact-rail-head,
.rail-contact-card {
  border: 1px solid rgba(226, 77, 47, 0.18);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(226, 77, 47, 0.07);
}

.contact-rail-head {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 16px;
  background: linear-gradient(135deg, #fff, #fff4ef);
}

.contact-rail-head span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-rail-head strong {
  font-size: 18px;
}

.rail-contact-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px;
}

.rail-qr,
.rail-qr img,
.rail-qr .qr-placeholder {
  width: 160px;
  height: 160px;
  justify-self: center;
}

.rail-account {
  min-width: 0;
}

.rail-account span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.rail-account strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: var(--brand);
  font-size: 20px;
}

.store-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at 90% 12%, rgba(226, 77, 47, 0.12), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #fff7f4 100%);
}

.metric-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 150px;
  padding: 16px;
  border: 1px solid rgba(226, 77, 47, 0.14);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(226, 77, 47, 0.08);
}

.metric-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #ff8a66);
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(226, 77, 47, 0.24);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 2px;
  color: var(--brand);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.12;
}

.metric-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.category-showcase {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
  margin-top: 14px;
  padding: 22px 18px 24px;
  border: 1px solid rgba(226, 77, 47, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
}

.category-tile {
  display: grid;
  gap: 0;
  justify-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.category-image {
  display: block;
  width: min(100%, 178px);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 3px solid #2f2f2f;
  border-radius: 2px;
  background: #f2f2f2;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.category-tile strong {
  display: grid;
  width: min(100%, 210px);
  min-height: 54px;
  place-items: center;
  margin-top: -2px;
  border: 3px solid #2f2f2f;
  border-radius: 999px;
  padding: 8px 16px;
  background: #fff;
  color: #111;
  font-size: clamp(16px, 1.2vw, 22px);
  font-weight: 900;
  line-height: 1.2;
}

.category-tile:hover .category-image img,
.category-tile.active .category-image img {
  transform: scale(1.05);
  filter: saturate(1.08);
}

.category-tile:hover strong,
.category-tile.active strong {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 8px 20px rgba(226, 77, 47, 0.14);
}

.store-tabs {
  display: flex;
  overflow-x: auto;
  margin-top: 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.store-tabs a {
  min-width: max-content;
  padding: 16px 24px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 800;
}

.store-tabs a.active {
  border-color: var(--brand);
  color: var(--brand);
}

.store-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  margin-top: 14px;
}

.store-sidebar {
  display: grid;
  gap: 14px;
  align-content: start;
}

.side-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.side-panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.side-link {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  border-left: 3px solid transparent;
  padding: 10px 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.side-link.active {
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 900;
}

.order-flow {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.9;
}

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

.market-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.market-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.market-toolbar strong {
  display: block;
  margin-top: 2px;
}

.sort-tabs {
  display: flex;
  gap: 8px;
}

.sort-tabs button {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px 14px;
  background: #fff;
  cursor: pointer;
}

.sort-tabs button.active {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(226, 77, 47, 0.14);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f1f1f1;
}

.product-card-link {
  display: block;
}

.product-card-body {
  display: grid;
  flex: 1;
  gap: 8px;
  padding: 10px;
}

.product-kicker {
  width: max-content;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #ffd4c8;
  border-radius: 3px;
  padding: 2px 6px;
  color: var(--brand);
  background: var(--soft);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card h3 {
  display: -webkit-box;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 15px;
  line-height: 1.4;
}

.product-card h3 a {
  display: block;
}

.product-card p {
  display: -webkit-box;
  min-height: 38px;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.product-price {
  display: grid;
  gap: 3px;
  color: var(--brand);
  font-weight: 900;
}

.product-price span,
.detail-price span,
.cart-price span,
.admin-price-block span,
.price-convert-preview span {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.product-price b,
.detail-price b,
.cart-price b,
.admin-price-block b,
.price-convert-preview b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.product-price strong,
.detail-price strong,
.cart-price strong,
.admin-price-block strong,
.price-convert-preview strong {
  color: var(--brand);
  font-weight: 900;
}

.product-meta {
  color: var(--muted);
  font-size: 12px;
}

.product-actions {
  margin-top: auto;
}

.product-link {
  width: 100%;
  border: 0;
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
  cursor: pointer;
}

.empty-products {
  grid-column: 1 / -1;
  padding: 36px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: #fff;
  text-align: center;
}

.product-page {
  padding-top: 22px;
}

.product-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 16px 14px;
  color: var(--muted);
  font-size: 13px;
}

.product-breadcrumb a {
  color: var(--brand);
  font-weight: 800;
}

.product-detail-shell,
.product-detail-empty {
  margin-inline: 16px;
  padding: 22px;
  border: 1px solid rgba(226, 77, 47, 0.16);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.product-detail-shell {
  display: grid;
  grid-template-columns: minmax(320px, 560px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.product-detail-media {
  overflow: hidden;
  border-radius: 8px;
  background: #f2f2f2;
}

.product-detail-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.product-detail-info {
  display: grid;
  gap: 14px;
}

.product-detail-info h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.2;
}

.detail-price {
  display: grid;
  gap: 4px;
  color: var(--brand);
  font-weight: 900;
}

.detail-price strong {
  font-size: 26px;
}

.detail-description {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.detail-badges,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-badges span {
  padding: 7px 10px;
  border: 1px solid #ffd4c8;
  border-radius: 999px;
  color: var(--brand);
  background: var(--soft);
  font-size: 13px;
  font-weight: 900;
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-buy {
  min-height: 42px;
  border: 1px solid var(--brand);
  border-radius: 3px;
  color: var(--brand);
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

.product-share-box {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 100px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafafa;
}

.product-share-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.product-share-box input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px;
  color: var(--muted);
  background: #fff;
}

.product-share-box button {
  min-height: 40px;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.detail-note {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 4px;
  background: #f7f7f7;
  color: var(--muted);
  line-height: 1.7;
}

.detail-note strong {
  color: var(--ink);
}

.product-message {
  margin: 14px 16px 0;
}

.checkout-page[hidden],
.checkout-section[hidden] {
  display: none;
}

.checkout-page {
  max-width: var(--container);
  margin: 18px auto 0;
  padding-inline: 16px;
}

.checkout-standalone {
  padding-top: 28px;
}

.checkout-page-inner {
  display: grid;
  gap: 14px;
  padding: 22px;
  background: #fff;
  border: 1px solid rgba(226, 77, 47, 0.2);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.checkout-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.cart-heading,
.checkout-title {
  margin-bottom: 14px;
}

.cart-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.cart-heading h2,
.cart-heading h1,
.checkout-title h2,
.order-summary h3 {
  margin: 0;
  font-size: 26px;
}

.cart-heading h1 {
  font-size: clamp(28px, 3vw, 38px);
}

.checkout-title span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.8;
}

.keep-shopping {
  min-width: max-content;
  padding: 8px 12px;
  border: 1px solid var(--brand);
  border-radius: 3px;
  color: var(--brand);
  font-weight: 900;
}

.cart-list {
  display: grid;
  gap: 10px;
}

.empty-cart {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: #fafafa;
  text-align: center;
}

.cart-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.cart-item img {
  width: 64px;
  height: 64px;
  border-radius: 3px;
  object-fit: cover;
}

.cart-item-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.cart-item-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-main span {
  color: var(--brand);
  font-weight: 900;
}

.cart-qty {
  display: grid;
  grid-template-columns: 30px 34px 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.cart-qty button,
.remove-cart {
  border: 0;
  background: #fff;
  cursor: pointer;
}

.cart-qty span {
  display: grid;
  place-items: center;
  border-inline: 1px solid var(--line);
}

.remove-cart {
  color: var(--muted);
  font-size: 13px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cart-total strong {
  color: var(--brand);
}

.checkout-button {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
  cursor: pointer;
}

.checkout-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.checkout-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.checkout-form input,
.checkout-form select,
.checkout-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 11px 12px;
  outline: none;
}

.checkout-form input:focus,
.checkout-form select:focus,
.checkout-form textarea:focus {
  border-color: var(--brand);
}

.checkout-form textarea {
  resize: vertical;
}

.full-line {
  grid-column: 1 / -1;
}

.order-policy,
.form-message {
  padding: 12px;
  border-radius: 3px;
  background: #f7f7f7;
  color: var(--muted);
  line-height: 1.6;
}

.order-policy strong {
  display: block;
  color: var(--ink);
}

.submit-order,
.copy-button {
  min-height: 42px;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
  cursor: pointer;
}

.form-message {
  min-height: 44px;
  margin: 0;
  color: var(--success);
  font-weight: 900;
}

.form-message.is-error {
  color: var(--brand-dark);
}

.order-summary {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fafafa;
}

.order-summary pre {
  overflow: auto;
  margin: 12px 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
  font: 13px/1.7 "Consolas", "Microsoft JhengHei", sans-serif;
}

.copy-button {
  width: 100%;
  background: var(--ink);
}

.site-footer {
  display: flex;
  max-width: var(--container);
  justify-content: space-between;
  gap: 14px;
  margin: 0 auto;
  padding: 22px 16px 30px;
  color: var(--muted);
  font-size: 13px;
}

.mobile-bar {
  display: none;
}

.admin-body {
  background: #f4f4f4;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px max(18px, calc((100vw - var(--container)) / 2));
  color: #fff;
  background: linear-gradient(180deg, var(--brand) 0%, #f05b35 100%);
  box-shadow: 0 2px 14px rgba(173, 54, 32, 0.24);
}

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-header-actions button,
.admin-login button {
  min-height: 40px;
  border: 0;
  border-radius: 3px;
  padding: 8px 14px;
  color: var(--brand);
  background: #fff;
  font-weight: 900;
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 120ms ease, background 120ms ease, color 120ms ease, opacity 120ms ease;
  touch-action: manipulation;
  user-select: none;
}

.admin-header-actions button:hover,
.admin-login button:hover {
  box-shadow: 0 6px 14px rgba(137, 42, 25, 0.18);
}

.admin-header-actions button:active,
.admin-login button:active,
.admin-quick-actions button:active,
.logistics-actions button:active,
.copy-order-button:active,
.order-row:active {
  transform: translateY(1px);
}

.admin-header-actions button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.admin-shell {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px 16px 46px;
}

.admin-login,
.admin-panel {
  border: 1px solid rgba(226, 77, 47, 0.16);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-login {
  display: grid;
  max-width: 460px;
  gap: 14px;
  margin: 42px auto;
  padding: 24px;
}

.admin-login h1,
.admin-titlebar h1 {
  margin: 0;
}

.admin-login label,
.admin-filters label,
.logistics-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.admin-login input,
.admin-filters input,
.admin-filters select,
.logistics-form input,
.logistics-form select,
.logistics-form textarea {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px 12px;
  background: #fff;
}

.admin-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.admin-titlebar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
}

.admin-titlebar > span {
  color: var(--muted);
  font-size: 13px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.admin-mode-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.admin-mode-tabs button {
  min-height: 40px;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 9px 16px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.admin-mode-tabs button.active {
  border-color: var(--brand);
  color: var(--brand);
}

.admin-stats div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafafa;
}

.admin-stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-stats strong {
  color: var(--brand);
  font-size: 26px;
}

.admin-order-list {
  display: grid;
  gap: 12px;
  align-content: start;
  max-height: calc(100vh - 250px);
  overflow: auto;
}

.admin-workbench {
  display: grid;
  grid-template-columns: 220px minmax(280px, 0.95fr) minmax(420px, 1.35fr);
  gap: 14px;
  align-items: start;
}

.admin-filters,
.admin-detail {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.admin-quick-actions {
  display: grid;
  gap: 8px;
}

.admin-quick-actions button,
.logistics-actions button {
  min-height: 36px;
  border: 1px solid rgba(226, 77, 47, 0.28);
  border-radius: 3px;
  color: var(--brand);
  background: #fff4ef;
  font-weight: 900;
  cursor: pointer;
  transition: transform 80ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease;
  touch-action: manipulation;
  user-select: none;
}

.admin-quick-actions button:hover,
.logistics-actions button:hover,
.admin-quick-actions button.active {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
  box-shadow: 0 6px 14px rgba(226, 77, 47, 0.16);
}

.order-row {
  display: grid;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 80ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
  touch-action: manipulation;
  user-select: none;
}

.order-row:hover {
  border-color: rgba(226, 77, 47, 0.45);
  background: #fffaf7;
}

.order-row.active {
  border-color: var(--brand);
  background: #fff7f3;
  box-shadow: 0 8px 18px rgba(226, 77, 47, 0.12);
}

.order-row-top,
.order-row-bottom {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.order-row strong {
  color: var(--brand);
  font-size: 13px;
}

.order-no-line,
.detail-order-no {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
}

.order-no-line strong,
.detail-order-no h2 {
  overflow-wrap: anywhere;
}

.copy-order-button {
  min-height: 26px;
  flex: 0 0 auto;
  border: 1px solid rgba(226, 77, 47, 0.34);
  border-radius: 3px;
  padding: 3px 8px;
  color: var(--brand);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 80ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease;
  touch-action: manipulation;
  user-select: none;
}

.copy-order-button:hover {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
  box-shadow: 0 5px 12px rgba(226, 77, 47, 0.16);
}

.order-row em,
.order-row i {
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--brand);
  background: #fff4ef;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.order-row > span:not(.order-row-top):not(.order-row-bottom) {
  color: var(--muted);
  font-size: 13px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.detail-header h2 {
  margin: 0;
  font-size: 22px;
}

.detail-header > span {
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff;
  background: var(--brand);
  font-size: 13px;
  font-weight: 900;
}

.detail-block,
.logistics-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fafafa;
}

.detail-block h3,
.logistics-form h3 {
  margin: 0;
  font-size: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.detail-grid dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-items {
  display: grid;
  gap: 8px;
}

.detail-items div,
.detail-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.detail-total {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--brand);
  font-weight: 900;
}

.logistics-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.logistics-actions button[type="submit"] {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.timeline {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.timeline li {
  color: var(--muted);
}

.timeline strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
}

.admin-empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  color: var(--muted);
  text-align: center;
}

.admin-products-view {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.admin-product-form,
.admin-settings-form,
.admin-product-list {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.admin-product-form,
.admin-settings-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-form-head {
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.product-form-head h2 {
  margin: 0;
  font-size: 22px;
}

.product-form-head button,
.product-form-actions button,
.admin-product-actions button {
  min-height: 36px;
  border: 1px solid rgba(226, 77, 47, 0.28);
  border-radius: 3px;
  padding: 8px 12px;
  color: var(--brand);
  background: #fff4ef;
  font-weight: 900;
  cursor: pointer;
}

.admin-product-form label,
.admin-settings-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.admin-product-form input,
.admin-product-form select,
.admin-product-form textarea,
.admin-settings-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px 12px;
  background: #fff;
}

.product-active-toggle {
  display: flex !important;
  flex-direction: row;
  align-items: center;
}

.product-active-toggle input {
  width: auto;
}

.product-form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.product-form-actions button:first-child {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.admin-product-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 160px;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
}

.admin-product-card.is-hidden {
  opacity: 0.62;
}

.admin-product-card img {
  width: 96px;
  height: 96px;
  border-radius: 4px;
  background: #f3f3f3;
  object-fit: cover;
}

.admin-product-card h3 {
  margin: 4px 0 6px;
  font-size: 17px;
}

.admin-product-card span,
.admin-product-card p {
  color: var(--muted);
  font-size: 13px;
}

.admin-product-card p {
  margin: 7px 0 0;
}

.admin-product-card strong {
  color: var(--brand);
}

.admin-price-block,
.price-convert-preview {
  display: grid;
  gap: 4px;
}

.price-convert-preview {
  align-self: end;
  border: 1px solid rgba(226, 77, 47, 0.14);
  border-radius: 5px;
  padding: 10px 12px;
  background: #fff8f5;
}

.cart-price {
  display: grid;
  gap: 2px;
}

.admin-product-actions {
  display: grid;
  gap: 8px;
}

.admin-settings-view {
  display: grid;
}

.admin-preview-link {
  display: grid;
  min-height: 36px;
  place-items: center;
  border: 1px solid rgba(226, 77, 47, 0.28);
  border-radius: 3px;
  padding: 8px 12px;
  color: var(--brand);
  background: #fff4ef;
  font-weight: 900;
}

.inline-clear-filter {
  min-height: 32px;
  margin-top: 12px;
  border: 1px solid var(--brand);
  border-radius: 3px;
  padding: 6px 12px;
  color: var(--brand);
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

.inline-clear-filter:hover {
  color: #fff;
  background: var(--brand);
}

@media (max-width: 980px) {
  .mall-header {
    grid-template-columns: 1fr auto;
    padding-inline: 14px;
  }

  .search-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .store-page {
    display: flex;
    flex-direction: column;
    max-width: var(--container);
  }

  .store-page > * {
    order: 3;
  }

  .store-page > :not(.contact-rail) {
    grid-column: auto;
  }

  .store-hero {
    order: 1;
  }

  .contact-rail {
    order: 2;
  }

  .store-hero,
  .store-layout,
  .product-detail-shell {
    grid-template-columns: 1fr;
  }

  .contact-rail {
    position: static;
    grid-row: auto;
    margin: 14px 16px 0;
  }

  .category-showcase,
  .contact-rail,
  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-rail-head {
    grid-column: 1 / -1;
  }

  .store-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-workbench {
    grid-template-columns: 1fr;
  }

  .admin-products-view {
    grid-template-columns: 1fr;
  }

  .admin-order-list {
    max-height: none;
    overflow: visible;
  }

  .admin-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-quick-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  body {
    padding-bottom: 70px;
  }

  .store-page {
    padding-top: 10px;
  }

  .store-hero,
  .contact-rail,
  .category-showcase,
  .store-tabs,
  .store-layout,
  .checkout-page,
  .product-detail-shell,
  .product-detail-empty {
    margin-inline: 10px;
    padding-inline: 0;
  }

  .product-detail-shell,
  .product-detail-empty {
    padding: 14px;
  }

  .mall-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .header-order {
    justify-self: stretch;
    text-align: center;
  }

  .store-cover {
    grid-template-columns: 1fr;
    min-height: 260px;
    padding: 18px;
  }

  .store-avatar {
    width: 76px;
    height: 76px;
    font-size: 22px;
  }

  .store-metrics,
  .contact-rail,
  .category-showcase,
  .store-sidebar,
  .checkout-form,
  .admin-filters,
  .admin-quick-actions,
  .logistics-form,
  .logistics-actions {
    grid-template-columns: 1fr;
  }

  .admin-titlebar,
  .admin-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-stats {
    grid-template-columns: 1fr 1fr;
  }

  .store-sidebar {
    display: none;
  }

  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-card-body {
    gap: 6px;
    padding: 8px;
  }

  .product-card h3 {
    min-height: 38px;
    font-size: 13px;
  }

  .product-card p {
    display: none;
  }

  .product-price {
    font-size: 16px;
  }

  .product-link {
    min-height: 34px;
    font-size: 13px;
  }

  .product-breadcrumb,
  .product-message {
    margin-inline: 10px;
  }

  .detail-actions,
  .product-share-box {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .cart-qty,
  .remove-cart {
    grid-column: 2;
    justify-self: start;
  }

  .market-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .sort-tabs {
    width: 100%;
  }

  .sort-tabs button {
    flex: 1;
  }

  .site-footer {
    flex-direction: column;
  }

  .mobile-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(12px);
  }

  .mobile-bar a,
  .mobile-bar button {
    display: grid;
    min-height: 58px;
    place-items: center;
    border: 0;
    color: var(--muted);
    background: transparent;
    font-size: 13px;
    font-weight: 900;
  }

  .mobile-bar a:nth-child(3),
  .mobile-bar a:nth-child(4),
  .mobile-bar button:nth-child(3),
  .mobile-bar button:nth-child(4) {
    color: var(--brand);
  }

  .mobile-bar span {
    display: inline-grid;
    min-width: 18px;
    height: 18px;
    margin-left: 2px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--brand);
    font-size: 11px;
  }

  .admin-header,
  .admin-toolbar,
  .admin-order-head,
  .admin-order-items div {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-header-actions {
    width: 100%;
  }

  .admin-header-actions button {
    flex: 1;
  }

  .admin-panel {
    padding: 14px;
  }

  .admin-stats,
  .admin-order-grid {
    grid-template-columns: 1fr;
  }

  .admin-product-form,
  .admin-settings-form,
  .admin-product-card,
  .product-form-actions {
    grid-template-columns: 1fr;
  }

  .admin-product-card img {
    width: 100%;
    height: 180px;
  }
}
