@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700;800;900&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #20242a;
  --muted: #69707a;
  --line: #dce1e7;
  --brand: #06c755;
  --brand-dark: #04a847;
  --accent: #e24d42;
  --navy: #172033;
  --soft: #eef6f1;
  --shadow: 0 14px 34px rgba(25, 32, 44, 0.09);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  min-height: 42px;
  padding: 0 16px;
  transition: transform 0.15s ease, background 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 56px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  background: #000;
  border-radius: 8px;
  display: block;
  height: 46px;
  object-fit: cover;
  outline: 2px solid #000;
  outline-offset: -1px;
  width: 46px;
}

.brand strong {
  font-size: clamp(18px, 2.4vw, 28px);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.guest-actions,
.member-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.seller-center-label {
  color: var(--ink);
  font-weight: 700;
  line-height: 42px;
  white-space: nowrap;
}

.cart-header-btn {
  align-items: center;
  background: #111827;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  padding: 0;
  position: relative;
  width: 52px;
}

.cart-header-btn.has-items {
  background: var(--brand);
}

#cartBadge {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  height: 22px;
  justify-content: center;
  min-width: 22px;
  padding: 0 6px;
  position: absolute;
  right: -7px;
  top: -7px;
}

.cart-header-btn svg {
  fill: none;
  height: 24px;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 24px;
}

.cart-bounce {
  animation: cartBounce 0.42s ease;
}

.cart-fly-dot {
  animation: cartFly 0.62s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  background: var(--brand);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(6, 199, 85, 0.35);
  height: 14px;
  pointer-events: none;
  position: fixed;
  width: 14px;
  z-index: 100;
}

.topbar h1,
.section-heading h2,
.member-copy h2 {
  margin: 0;
}

.eyebrow {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.admin-nav {
  display: flex;
  gap: 8px;
}

.nav-btn,
.ghost-btn {
  background: #eef1f5;
  color: var(--ink);
}

.nav-btn.active {
  background: var(--brand);
  color: #fff;
}

main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px clamp(16px, 4vw, 40px) 56px;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.login-gate,
.member-panel,
.section-heading,
.admin-shell,
.profile-form,
.orders-list,
.admin-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-gate {
  align-items: center;
  background: #10131a;
  color: #fff;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 280px;
  margin-bottom: 22px;
  overflow: hidden;
  padding: clamp(26px, 5vw, 54px);
  position: relative;
}

.login-gate::after {
  background: radial-gradient(circle at center, rgba(6, 199, 85, 0.2), transparent 58%);
  content: "";
  height: 280px;
  position: absolute;
  right: -70px;
  top: -90px;
  width: 360px;
}

.login-gate h1 {
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.12;
  margin: 0;
  max-width: 760px;
}

.login-gate p:last-child {
  color: rgba(255, 255, 255, 0.76);
  font-size: 17px;
  line-height: 1.7;
  margin: 14px 0 0;
  max-width: 620px;
}

.login-gate > * {
  position: relative;
  z-index: 1;
}

.hero-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-link {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  min-height: 42px;
  padding: 0 16px;
  text-decoration: none;
}

.hero-link.primary {
  background: #fff;
  color: #111827;
  font-weight: 700;
}

.login-gate.hero-center {
  justify-items: center;
  text-align: center;
}

.login-gate.hero-center .hero-actions {
  justify-content: center;
}

.home-strip {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.home-strip.layout-1,
.info-grid.layout-1 {
  grid-template-columns: 1fr;
}

.home-strip.layout-2,
.info-grid.layout-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-strip.layout-3,
.info-grid.layout-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-strip article,
.info-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.home-strip strong {
  display: block;
  font-size: 20px;
  margin-bottom: 6px;
}

.home-strip span,
.info-grid p {
  color: var(--muted);
  line-height: 1.7;
}

.info-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.info-grid h3 {
  margin: 0 0 8px;
}

.info-grid p:last-child {
  margin: 0;
}

.floating-contact {
  bottom: 22px;
  display: grid;
  gap: 8px;
  position: fixed;
  right: 18px;
  z-index: 30;
}

.floating-contact a {
  align-items: center;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.18);
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 52px;
  justify-content: center;
  text-decoration: none;
  width: 52px;
}

.floating-contact svg {
  display: block;
  height: 34px;
  width: 34px;
}

.line-contact {
  background: transparent;
  border-radius: 999px !important;
  overflow: hidden;
  padding: 0;
}

.line-contact img {
  display: block;
  height: 52px;
  object-fit: cover;
  width: 52px;
}

.ig-contact {
  background: #111827;
}

.ig-contact svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.member-panel {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 22px;
}

.member-copy p:last-child,
.section-heading p {
  color: var(--muted);
  margin: 6px 0 0;
}

.line-btn {
  background: var(--brand);
  min-width: 164px;
}

.line-btn:hover {
  background: var(--brand-dark);
}

.settings-wrap {
  position: relative;
}

.icon-btn {
  align-items: center;
  background: #111827;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  height: 42px;
  justify-content: center;
  padding: 0;
  width: 42px;
}

.icon-btn span {
  background: #fff;
  border-radius: 999px;
  display: block;
  height: 2px;
  width: 18px;
}

.settings-menu {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  min-width: 210px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 20;
}

.settings-menu button {
  background: transparent;
  color: var(--ink);
  justify-content: start;
  min-height: 38px;
  text-align: left;
}

.settings-menu button:hover {
  background: #f2f5f7;
  transform: none;
}

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

.profile-form {
  margin-bottom: 26px;
  padding: 22px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 14px;
  gap: 7px;
}

label span {
  color: var(--accent);
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(6, 199, 85, 0.15);
}

textarea {
  line-height: 1.6;
  resize: vertical;
}

.wide {
  grid-column: 1 / -1;
}

.form-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-text {
  color: var(--brand-dark);
  font-size: 14px;
  min-height: 20px;
}

.section-heading {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin: 0 0 18px;
  padding: 20px 22px;
}

.product-filters {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 18px;
}

.filter-row-group {
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.filter-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  min-height: 44px;
  padding: 8px 16px;
}

.filter-row:last-child {
  border-bottom: none;
}

.filter-label {
  color: var(--muted);
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  min-width: 36px;
}

.filter-controls {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 1.3fr minmax(160px, 1fr) minmax(150px, 1fr);
  padding: 12px 16px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-tab {
  background: #eef1f5;
  color: var(--ink);
  font-size: 13px;
  min-height: 30px;
  padding: 0 10px;
}

.filter-tab.active {
  background: var(--brand);
  color: #fff;
}

.product-tags-wrap {
  display: grid;
  gap: 8px;
}

.form-label-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.tag-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.shipping-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shipping-pill-label {
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
  padding: 6px 16px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  user-select: none;
}

.shipping-pill-label input[type="checkbox"] {
  display: none;
}

.shipping-pill-label:has(input:checked) {
  background: #111;
  border-color: #111;
  color: #fff;
}

.tag-check {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  gap: 5px;
}

.checkbox-filter {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 42px;
}

.checkbox-filter input {
  min-height: auto;
  width: auto;
}

.product-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.product-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.image-wrap {
  aspect-ratio: 4 / 3;
  background: #e9edf2;
  position: relative;
}

.image-wrap img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.deadline-badge {
  background: rgba(226, 77, 66, 0.94);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  left: 0;
  padding: 9px 12px;
  position: absolute;
  right: 0;
  text-align: center;
  top: 0;
  z-index: 1;
}

.deadline-badge.closed {
  background: rgba(32, 36, 42, 0.88);
}

.sold-out-badge {
  background: rgba(17, 24, 39, 0.9);
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  padding: 8px 12px;
  position: absolute;
  right: 10px;
  top: 48px;
  z-index: 2;
}

.product-body {
  padding: 16px;
}

.card-status-row {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.category-pill,
.stock-pill {
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
}

.category-pill {
  background: #eef6f1;
  color: var(--brand-dark);
}

.stock-pill {
  background: #edf7ff;
  color: #2563eb;
}

.stock-pill.sold-out {
  background: #fef0ef;
  color: #b63128;
}

.product-title-row {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.product-title-row h3 {
  font-size: 20px;
  line-height: 1.35;
  margin: 0;
}

.product-title-row h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  margin: 0;
}

.price {
  color: var(--accent);
  white-space: nowrap;
}

.product-excerpt {
  color: var(--muted);
  display: -webkit-box;
  line-height: 1.6;
  margin: 10px 0 0;
  line-clamp: 2;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
  margin: 16px 0;
}

.meta-list div {
  background: #f2f5f7;
  border-radius: 8px;
  min-width: 0;
  padding: 9px;
}

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

.meta-list dd {
  font-weight: 700;
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.order-form {
  display: grid;
  gap: 12px;
}

.order-form button {
  background: var(--brand);
}

.view-product-btn {
  background: var(--brand);
  width: 100%;
}

.card-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.card-actions .line-inquiry-btn {
  align-items: center;
  background: #eef1f5;
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 42px;
  text-decoration: none;
}

.detail-actions {
  margin-bottom: 14px;
}

.detail-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  padding: 22px;
}

.detail-main-image {
  border-radius: 8px;
  max-height: 420px;
  overflow: hidden;
}

.detail-main-image img {
  max-height: 420px;
}

.detail-gallery-notes {
  display: grid;
  gap: 12px;
}

.detail-info {
  display: grid;
  gap: 16px;
  align-content: start;
}

.product-description {
  color: #3d4652;
  line-height: 1.8;
}

.detail-info-block {
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.detail-info-block h3 {
  font-size: 16px;
  margin: 0 0 6px;
}

.detail-info-block p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.cart-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-top: 18px;
  overflow: hidden;
}

.standalone-cart {
  margin-top: 0;
}

.cart-list {
  display: grid;
}

.cart-table-header {
  background: var(--bg);
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 600;
  gap: 12px;
  grid-template-columns: 1fr 110px 130px 110px;
  padding: 10px 52px 10px 16px;
  text-align: center;
}

.cart-table-header span:first-child {
  text-align: left;
}

.cart-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 110px 130px 110px;
  padding: 16px 52px 16px 16px;
  position: relative;
}

.cart-product-cell {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.cart-item-info {
  min-width: 0;
}

.cart-item-info strong {
  display: block;
  font-size: 14px;
}

.cart-price-cell {
  color: var(--accent);
  font-weight: 600;
  text-align: center;
}

.cart-qty-cell {
  display: flex;
  justify-content: center;
}

.cart-qty-select {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  padding: 6px 10px;
  text-align: center;
  width: 76px;
}

.cart-subtotal-cell {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.cart-remove-btn {
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  min-height: unset;
  padding: 4px 8px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
}

.cart-remove-btn:hover {
  color: var(--accent);
  transform: translateY(-50%);
}

.cart-item-price {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.cart-item-img {
  border-radius: 6px;
  flex-shrink: 0;
  height: 80px;
  object-fit: cover;
  width: 80px;
}

.cart-item-img-link {
  cursor: pointer;
  transition: opacity 0.15s;
}

.cart-item-img-link:hover {
  opacity: 0.8;
}

.cart-item-name-link {
  cursor: pointer;
}

.cart-item-name-link:hover {
  text-decoration: underline;
}

.cart-row p {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.cart-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px;
}

.cart-footer button {
  background: var(--brand);
  flex-shrink: 0;
}

.cart-price-breakdown {
  display: grid;
  gap: 6px;
  flex: 1;
}

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

.price-row > span {
  color: var(--muted);
  font-size: 14px;
}

.price-total {
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 8px;
}

.price-total > span {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.price-total strong {
  color: var(--accent);
  font-size: 18px;
}

.delivery-fee-tag {
  background: #eef1f5;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
}

.delivery-fee-tag.free {
  background: #eef6f1;
  color: var(--brand-dark);
}

.cart-notes-panel {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding: 16px;
}

.cart-notes-panel label {
  font-size: 14px;
}

.cart-notes-panel textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  padding: 10px 12px;
  resize: vertical;
  width: 100%;
}

.cart-notes-panel textarea:focus {
  border-color: var(--brand);
  outline: none;
}

.order-notes-line {
  background: #fffbea;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  color: #78350f;
  font-size: 13px;
  padding: 4px 8px;
}

/* Order confirmation modal */
.order-confirm-overlay {
  align-items: center;
  background: rgba(15, 23, 42, 0.46);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 24px 16px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 60;
}

.order-confirm-overlay[hidden] {
  display: none !important;
}

.order-confirm-dialog {
  background: var(--panel);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - 48px);
  max-width: 480px;
  overflow: auto;
  width: 100%;
}

.order-confirm-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 20px 24px 16px;
}

.order-confirm-header h3 {
  font-size: 18px;
  margin: 0;
}

.order-confirm-dl {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 8px 24px 16px;
}

.order-confirm-dl > div {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 0;
}

.order-confirm-dl > div:last-child {
  border-bottom: none;
}

.order-confirm-dl dt {
  color: var(--muted);
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 400;
}

.order-confirm-dl dd {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  text-align: right;
}

.order-confirm-dl .confirm-total dd {
  color: var(--accent);
  font-size: 16px;
}

.order-confirm-footer {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
}

.order-confirm-footer .ghost-btn {
  flex: 1;
}

.order-confirm-footer #orderConfirmSubmitBtn {
  flex: 2;
}

.delivery-panel {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 16px;
}

.delivery-option {
  align-items: center;
  display: flex;
  gap: 8px;
}

.delivery-option input {
  min-height: auto;
  width: auto;
}

.store-info-label {
  display: grid;
  gap: 6px;
}

.status-select {
  align-self: center;
  min-width: 100px;
}

.dual-status-selects {
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  margin-right: 6px;
  padding: 2px 8px;
}

/* 付款狀態 badge colours */
.order-badge.payment-未付款  { background: #fff3cd; color: #856404; }
.order-badge.payment-已付款  { background: #d1f0da; color: #1a6b34; }
.order-badge.payment-退款中  { background: #fde3d8; color: #ad3820; }
.order-badge.payment-已退款  { background: #e9ecef; color: #495057; }

/* 出貨狀態 badge colours */
.order-badge.shipping-未出貨 { background: #e2e8f0; color: #475569; }
.order-badge.shipping-備貨中 { background: #dbeafe; color: #1e40af; }
.order-badge.shipping-已出貨 { background: #d1f0da; color: #1a6b34; }
.order-badge.shipping-已完成 { background: #d1e8d1; color: #145214; }
.order-badge.shipping-已取消 { background: #fde3d8; color: #ad3820; }

@keyframes cartBounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  45% {
    transform: translateY(-3px) scale(1.05);
  }
}

@keyframes cartFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--fly-x), var(--fly-y)) scale(0.45);
  }
}

.admin-shell {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  margin-bottom: 18px;
  padding: 22px;
}

.admin-product-toolbar {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 16px;
}

.admin-product-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-product-tab {
  background: #eef1f5;
  color: var(--ink);
  min-height: 36px;
  padding: 0 14px;
}

.admin-product-tab.active {
  background: var(--brand);
  color: #fff;
}

.tab-count {
  align-items: center;
  background: rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  margin-left: 7px;
  min-width: 22px;
  padding: 2px 7px;
}

.admin-product-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.product-form-modal {
  bottom: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28), 0 0 0 9999px rgba(15, 23, 42, 0.36);
  left: 50%;
  margin: 0;
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  max-width: min(1120px, calc(100vw - 32px));
  overscroll-behavior: contain;
  overflow: auto;
  position: fixed;
  top: 24px;
  transform: translateX(-50%);
  width: 100%;
  z-index: 50;
}

.product-form-header {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  grid-column: 1 / -1;
  justify-content: space-between;
  margin: -22px -22px 2px;
  padding: 18px 22px 14px;
  position: sticky;
  top: 0;
  z-index: 3;
}

.product-form-header h3 {
  font-size: 24px;
  margin: 0;
}

body.modal-open {
  overflow: hidden;
}

.admin-settings-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  padding: 22px;
}

.admin-settings-panel .section-heading {
  box-shadow: none;
  margin: 0 0 18px;
  padding: 0;
}

.upload-panel {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-column: 1 / -1;
  grid-template-columns: 180px minmax(0, 1fr);
  height: 276px;
  min-height: 264px;
  overflow: visible;
  padding: 2px 0 12px;
}

.image-upload {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: var(--soft);
  border: 1px dashed var(--brand-dark);
  border-radius: 8px;
  box-sizing: border-box;
  color: var(--brand-dark);
  display: flex;
  flex: none;
  font-size: 15px;
  font-weight: 700;
  height: 180px;
  justify-content: center;
  min-height: 180px;
  padding: 14px;
  text-align: center;
  width: 180px;
}

.image-upload span {
  display: block;
  line-height: 1.5;
  max-width: 120px;
}

.image-upload input {
  display: none;
}

.image-preview-list {
  align-items: start;
  display: flex;
  gap: 12px;
  height: 264px;
  min-height: 264px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
}

.image-preview-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  flex: 0 0 180px;
  grid-template-rows: 180px minmax(74px, auto);
  min-height: 254px;
  overflow: hidden;
}

.image-preview-frame {
  aspect-ratio: 1 / 1;
  background: #e9edf2;
  position: relative;
}

.image-preview-frame img {
  aspect-ratio: 1 / 1;
  background: #e9edf2;
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.cover-badge {
  background: var(--brand);
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  left: 5px;
  padding: 3px 6px;
  position: absolute;
  top: 5px;
}

.image-preview-actions {
  background: #fff;
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 74px;
  padding: 6px;
}

.image-preview-actions button {
  font-size: 12px;
  min-height: 30px;
  padding: 0 6px;
}

.image-empty {
  grid-column: 1 / -1;
  padding: 18px;
}

.thumb-strip {
  display: flex;
  gap: 8px;
  margin: 12px 0 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.thumb {
  background: #fff;
  border: 2px solid transparent;
  border-radius: 8px;
  flex: 0 0 54px;
  height: 54px;
  min-height: 54px;
  overflow: hidden;
  padding: 0;
}

.thumb.active {
  border-color: var(--brand);
}

.thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.variant-tools {
  align-items: end;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(110px, 1fr) auto minmax(110px, 1fr) auto;
  padding: 12px;
}

.variant-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.variant-panel-title {
  align-items: center;
  background: #f7f8fa;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 12px;
}

.variant-panel-title span {
  color: var(--muted);
  font-size: 13px;
}

.variant-matrix {
  display: grid;
  max-height: 420px;
  overflow: auto;
}

.variant-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr minmax(80px, 110px) minmax(80px, 110px) 36px 36px;
  padding: 10px 12px;
}

.variant-row--disabled {
  opacity: 0.4;
}

.variant-row--disabled strong {
  text-decoration: line-through;
}

.variant-delete {
  font-size: 14px;
  padding: 4px 6px;
}

.variant-row:last-child {
  border-bottom: 0;
}

.variant-head {
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}

.variant-row input {
  min-height: 36px;
  padding: 7px 9px;
}

.payment-note {
  align-items: center;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  padding: 12px;
}

.payment-note span {
  color: var(--muted);
}

.dashboard-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.dashboard-stats article,
.dashboard-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dashboard-stats article {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 16px;
}

.dashboard-stats span,
.dashboard-panel li span,
.dashboard-empty {
  color: var(--muted);
}

.dashboard-stats strong {
  font-size: 28px;
}

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

.dashboard-panel {
  overflow: hidden;
}

.dashboard-panel h3 {
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  margin: 0;
  padding: 14px 16px;
}

.dashboard-panel ul {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dashboard-panel li {
  display: grid;
  gap: 4px;
  padding: 13px 16px;
}

.dashboard-panel li + li {
  border-top: 1px solid var(--line);
}

.dashboard-panel li strong,
.dashboard-panel li span {
  overflow-wrap: anywhere;
}

.dashboard-empty {
  margin: 0;
  padding: 16px;
}

.admin-order-heading {
  margin-top: 22px;
}

.admin-order-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

/* orderStatus badge colours */
.order-badge.order-status-待結帳 { background: #f1f5f9; color: #475569; }
.order-badge.order-status-已成立 { background: #dbeafe; color: #1d4ed8; }
.order-badge.order-status-已完成 { background: #d1f0da; color: #145214; }
.order-badge.order-status-退貨中 { background: #fde3d8; color: #9a3412; }
.order-badge.order-status-退款中 { background: #fde3d8; color: #9a3412; }
.order-badge.order-status-已取消 { background: #f3f4f6; color: #6b7280; }

.admin-order-filters {
  align-items: end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1.4fr) minmax(140px, 0.8fr) minmax(170px, 1fr) minmax(135px, 0.7fr) minmax(135px, 0.7fr) auto;
  margin: 0 0 12px;
  padding: 16px;
}

.admin-order-filters button {
  white-space: nowrap;
}

.admin-list,
.orders-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.list-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  padding: 14px;
}

.list-row p {
  color: var(--muted);
  margin: 4px 0 0;
}

.admin-product-row {
  grid-template-columns: 74px 1fr auto;
  overflow: hidden;
  padding-top: 0;
}

.admin-product-deadline {
  background: rgba(226, 77, 66, 0.96);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  grid-column: 1 / -1;
  margin: 0 -14px 2px;
  padding: 9px 14px;
  text-align: center;
}

.admin-product-cover {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  object-fit: cover;
  width: 74px;
}

.order-row-with-photo {
  grid-template-columns: 74px 1fr auto;
}

.order-admin-row {
  grid-template-columns: 74px 1fr auto auto;
}

.order-photo {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  object-fit: cover;
  width: 74px;
}

.deleted-order-text {
  color: #b63128 !important;
  font-weight: 700;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.customer-row {
  align-items: start;
  grid-template-columns: 1fr minmax(200px, auto) minmax(200px, auto);
}

.customer-blacklisted {
  background: #fff5f5;
  border-color: #fca5a5;
}

.customer-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
  padding: 2px 8px;
  vertical-align: middle;
}

.blacklist-badge {
  background: #fee2e2;
  color: #b91c1c;
}

.customer-stats {
  display: grid;
  gap: 8px;
}

.customer-stat-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr 1fr;
}

.customer-stat {
  background: var(--bg);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
}

.customer-stat span {
  color: var(--muted);
  font-size: 12px;
}

.customer-stat strong {
  font-size: 16px;
}

.stat-warn {
  color: #dc2626;
}

.stat-last-order {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.customer-meta {
  display: grid;
  gap: 8px;
}

.customer-notes-label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 600;
  gap: 4px;
}

.customer-notes-input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  resize: vertical;
  width: 100%;
}

.customer-meta-actions {
  display: flex;
  gap: 8px;
}

.customer-meta-actions .ghost-btn {
  flex: 1;
  font-size: 13px;
  padding: 6px 10px;
}

.role-info-note {
  margin-bottom: 20px;
}

.role-info-note ul {
  margin: 8px 0 8px 18px;
}

.role-info-note li {
  margin-bottom: 4px;
}

.role-info-note p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.role-manager-form {
  margin-bottom: 24px;
}

.role-list-heading {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
}

.role-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.danger {
  color: #b63128;
}

.empty-state {
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

@media (max-width: 760px) {
  .topbar,
  .member-panel,
  .login-gate,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    align-items: center;
  }

  .admin-nav,
  .guest-actions,
  .member-actions,
  .form-actions,
  .admin-product-toolbar,
  .payment-note,
  .variant-tools,
  .variant-panel-title {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-product-tabs {
    flex-direction: column;
  }

  .variant-tools {
    display: flex;
  }

  .variant-row {
    grid-template-columns: 1fr 1fr minmax(72px, 1fr) minmax(72px, 1fr) 36px 36px;
  }

  .variant-head {
    display: none;
  }

  .detail-shell {
    grid-template-columns: 1fr;
  }

  .detail-main-image,
  .detail-main-image img {
    max-height: 340px;
  }

  .cart-table-header {
    display: none;
  }

  .cart-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    padding: 14px 44px 14px 14px;
  }

  .cart-product-cell {
    grid-column: 1 / -1;
  }

  .cart-price-cell {
    text-align: left;
  }

  .cart-subtotal-cell {
    text-align: right;
  }

  .cart-item-img {
    height: 60px;
    width: 60px;
  }

  .cart-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .cart-price-breakdown {
    width: 100%;
  }

  .settings-menu {
    left: 0;
    right: auto;
    width: 100%;
  }

  .home-strip,
  .info-grid,
  .admin-order-filters {
    grid-template-columns: 1fr;
  }

  .filter-controls {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .product-form-modal {
    bottom: 10px;
    max-height: calc(100vh - 20px);
    max-width: calc(100vw - 20px);
    top: 10px;
  }

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

  .upload-panel {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }

  .image-preview-list {
    height: 226px;
    min-height: 226px;
  }

  .image-preview-card {
    flex-basis: 152px;
    grid-template-rows: 152px minmax(74px, auto);
    min-height: 226px;
  }

  .image-upload {
    height: 152px;
    min-height: 152px;
    width: 152px;
  }

  .wide {
    grid-column: auto;
  }

  .list-row {
    grid-template-columns: 1fr;
  }

  .admin-product-row {
    grid-template-columns: 64px 1fr;
  }

  .admin-product-row .row-actions {
    grid-column: 1 / -1;
  }

  .admin-product-cover {
    width: 64px;
  }

  .customer-row {
    grid-template-columns: 1fr;
  }

  .customer-stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .order-row-with-photo,
  .order-admin-row {
    grid-template-columns: 64px 1fr;
  }

  .order-row-with-photo .dual-status-selects,
  .order-row-with-photo .status-select,
  .order-admin-row .dual-status-selects,
  .order-admin-row .status-select,
  .order-admin-row [data-delete-order] {
    grid-column: 1 / -1;
  }

  .order-photo {
    width: 64px;
  }
}

/* ── Checkout page ── */
.checkout-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr minmax(280px, 340px);
  align-items: start;
}

.checkout-main {
  display: grid;
  gap: 14px;
}

.checkout-aside {
  position: sticky;
  top: 80px;
}

.checkout-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  padding: 20px;
}

.checkout-panel-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.checkout-items {
  display: grid;
  gap: 10px;
}

.checkout-item-row {
  align-items: center;
  display: flex;
  gap: 12px;
}

.checkout-item-row img {
  border-radius: 6px;
  flex-shrink: 0;
  height: 52px;
  object-fit: cover;
  width: 52px;
}

.checkout-item-row > div {
  flex: 1;
}

.checkout-item-row > div strong {
  display: block;
  font-size: 14px;
}

.checkout-item-row > div p {
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 0;
}

.checkout-item-row > span {
  font-weight: 700;
  white-space: nowrap;
}

.checkout-recipient-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.checkout-recipient-grid label {
  display: grid;
  font-size: 13px;
  font-weight: 600;
  gap: 4px;
}

.checkout-recipient-grid .wide-field {
  grid-column: 1 / -1;
}

.checkout-recipient-grid input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
}

/* Method options (shipping & payment) */
.checkout-method-list {
  display: grid;
  gap: 8px;
}

.method-option {
  align-items: center;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}

.method-option input[type="radio"] {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.method-option::before {
  border: 2px solid var(--line);
  border-radius: 50%;
  content: '';
  flex-shrink: 0;
  height: 20px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  width: 20px;
}

.method-option.selected {
  background: var(--soft);
  border-color: var(--brand);
}

.method-option.selected::before {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: inset 0 0 0 5px #fff;
}

.method-label {
  color: var(--ink);
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}

.method-fee {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.payment-method-note {
  background: #fffbea;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  color: #78350f;
  font-size: 13px;
  margin: 0;
  padding: 6px 10px;
}

/* Coupon */
.coupon-row {
  display: flex;
  gap: 8px;
}

.coupon-row input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  flex: 1;
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
}

.coupon-status {
  font-size: 13px;
  min-height: 18px;
}

.coupon-ok { color: var(--brand-dark); font-weight: 600; }
.coupon-err { color: var(--accent); }

/* Checkout notes */
.checkout-notes-label {
  display: grid;
  font-size: 14px;
  gap: 6px;
}

.checkout-notes-label textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  resize: vertical;
}

/* ─── Buyer Order Tabs — pill style ─────────────────────── */
#buyerOrderTabs {
  margin-bottom: 4px;
  padding: 0 16px;
}

#buyerOrderTabs .admin-product-tab {
  border-radius: 999px;
  font-size: 13px;
  min-height: 32px;
  padding: 0 14px;
}

/* ─── Buyer Order Cards ──────────────────────────────────── */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px 24px;
}

.buyer-order-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(25, 32, 44, 0.06);
  overflow: hidden;
}

.boc-header {
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 10px 16px;
}

.boc-id {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.boc-time {
  color: var(--muted);
  flex: 1;
  font-size: 12px;
  min-width: 0;
}

.boc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-left: auto;
}

.boc-body {
  align-items: flex-start;
  display: grid;
  gap: 16px;
  grid-template-columns: 90px 1fr auto;
  padding: 16px;
}

.boc-img {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  object-fit: cover;
  width: 90px;
}

.boc-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.boc-product-name {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.boc-spec,
.boc-qty {
  color: var(--muted);
  font-size: 13px;
}

.boc-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 0 16px;
  margin-top: 4px;
}

.boc-recipient {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  margin-top: 6px;
}

.boc-address {
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
}

.boc-price-panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 6px;
  min-width: 164px;
  padding: 12px 14px;
}

.boc-price-row {
  align-items: baseline;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 12px;
  justify-content: space-between;
  white-space: nowrap;
}

.boc-total {
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  margin-top: 4px;
  padding-top: 8px;
}

.boc-total span:last-child {
  color: var(--accent);
}

.boc-footer {
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 16px;
}

.boc-notes {
  color: var(--ink);
  font-size: 13px;
  margin: 0;
}

.boc-meta-line {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.boc-admin-selects {
  margin-top: 6px;
}

.boc-badge-cancelled {
  background: #fff0f0;
  border: 1.5px solid #e24d42;
  color: #c0392b;
  font-weight: 700;
}

.boc-pay-btn {
  background: var(--brand);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin-top: 6px;
  padding: 9px 0;
  text-align: center;
  width: 100%;
}

.boc-pay-btn:hover {
  background: var(--brand-dark);
}

.pi-note-row dd {
  text-align: left;
  white-space: pre-line;
}

.pi-note-text {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.6;
}

@media (max-width: 680px) {
  .boc-body {
    grid-template-columns: 72px 1fr;
  }

  .boc-price-panel {
    border-radius: 8px;
    grid-column: 1 / -1;
    min-width: 0;
  }
}

/* Checkout summary */
.checkout-summary-sticky {
  gap: 14px;
}

.checkout-summary-sticky #checkoutSubmitBtn {
  width: 100%;
}

.checkout-back-btn {
  text-align: center;
  width: 100%;
}

.discount-line {
  color: var(--brand-dark);
}

/* Admin settings sub-headings & method rows */
.settings-sub-heading {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 16px;
}

.settings-sub-heading h3 {
  font-size: 15px;
  margin: 0 0 2px;
}

.settings-sub-heading p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.method-setting-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 12px 4px;
}

.method-setting-row:last-child {
  border-bottom: none;
}

.method-setting-name {
  align-items: center;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 10px;
  min-width: 100px;
  width: 100px;
}

.method-setting-name input[type="checkbox"] {
  accent-color: var(--brand);
  height: 16px;
  width: 16px;
  flex-shrink: 0;
}

.method-setting-row > label {
  align-items: center;
  display: flex;
  font-size: 12px;
  gap: 6px;
  color: #888;
  white-space: nowrap;
}

.method-setting-row > label input[type="number"] {
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  min-height: 32px;
  padding: 0 8px;
  width: 72px;
}

.method-setting-row > label.wide {
  flex: 1;
}

.method-setting-row > label.wide input[type="text"],
.method-setting-row > label.wide input:not([type]) {
  border: 1px solid var(--line);
  border-radius: 4px;
  flex: 1;
  font-size: 13px;
  min-height: 32px;
  padding: 0 10px;
  width: 100%;
}

/* Cart hover dropdown */
.cart-hover-wrap {
  position: relative;
}

.cart-hover-dropdown {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(25, 32, 44, 0.16);
  min-width: 360px;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 300;
}

.cart-hover-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 8px 0;
}

.cart-hover-item {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  padding: 14px 14px 12px;
  position: relative;
}

.cart-hover-item:last-child {
  border-bottom: none;
}

.cart-hover-img {
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  height: 80px;
  object-fit: cover;
  transition: opacity 0.15s;
  width: 80px;
}

.cart-hover-img:hover {
  opacity: 0.8;
}

.cart-hover-item-info {
  flex: 1;
  min-width: 0;
}

.cart-hover-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 24px 4px 0;
}

.cart-hover-price {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 2px;
}

.cart-hover-spec {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 8px;
}

.cart-hover-item-bottom {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.cart-hover-qty {
  align-items: center;
  display: flex;
  gap: 0;
}

.cart-hover-qty-btn {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  height: 26px;
  line-height: 1;
  min-height: unset;
  padding: 0;
  transition: background 0.1s;
  width: 26px;
}

.cart-hover-qty-btn:hover:not(:disabled) {
  background: var(--line);
  transform: none;
}

.cart-hover-qty-btn:disabled {
  opacity: 0.35;
}

.cart-hover-qty-num {
  font-size: 13px;
  font-weight: 600;
  min-width: 28px;
  text-align: center;
}

.cart-hover-subtotal {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.cart-hover-remove {
  background: transparent;
  color: var(--muted);
  line-height: 1;
  min-height: unset;
  padding: 2px;
  position: absolute;
  right: 10px;
  top: 12px;
  width: auto;
}

.cart-hover-remove:hover {
  color: var(--accent);
  transform: none;
}

.cart-hover-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 24px;
  text-align: center;
}

.cart-hover-footer {
  border-top: 1px solid var(--line);
  padding: 14px;
}

.cart-hover-total {
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cart-hover-total strong {
  color: var(--accent);
  font-size: 15px;
}

.cart-hover-footer button {
  background: var(--navy);
  color: #fff;
  width: 100%;
}

/* Cart preview popup */
.cart-preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(25, 32, 44, 0.18);
  padding: 16px;
  position: fixed;
  right: clamp(12px, 3vw, 24px);
  top: 72px;
  width: 300px;
  z-index: 200;
  animation: cart-preview-in 0.2s ease;
}

@keyframes cart-preview-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cart-preview-item {
  align-items: flex-start;
  display: flex;
  gap: 12px;
}

.cart-preview-img {
  border-radius: 8px;
  flex-shrink: 0;
  height: 68px;
  object-fit: cover;
  width: 68px;
}

.cart-preview-info {
  flex: 1;
  min-width: 0;
}

.cart-preview-name {
  display: -webkit-box;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  line-clamp: 2;
  margin: 0 0 4px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cart-preview-spec {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 6px;
}

.cart-preview-price {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.cart-preview-divider {
  border-top: 1px solid var(--line);
  margin: 12px 0;
}

.cart-preview-footer {
  align-items: center;
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cart-preview-footer strong {
  color: var(--accent);
  font-size: 15px;
}

.cart-preview #cartPreviewBtn {
  background: var(--navy);
  color: #fff;
  width: 100%;
}

/* Responsive checkout */
@media (max-width: 700px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .checkout-aside {
    position: static;
  }

  .checkout-recipient-grid {
    grid-template-columns: 1fr;
  }
}

/* ════════════════════════════════════════════════════
   TERRENCESTUDIO — PREMIUM FRONTEND REDESIGN
   ════════════════════════════════════════════════════ */

/* ─── Global tokens override ─────────────────────── */
:root {
  --bg: #f5f5f5;
  --panel: #ffffff;
  --ink: #0a0a0a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --shadow: 0 2px 16px rgba(0,0,0,0.06);
  --shadow-hover: 0 16px 48px rgba(0,0,0,0.14);
}

body {
  background: var(--bg);
}

/* ─── Topbar ─────────────────────────────────────── */
.topbar {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  position: sticky;
  top: 0;
  z-index: 200;
}

.brand strong {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─── Marquee Bar ───────────────────────────────── */
.marquee-bar {
  background: var(--ink);
  overflow: hidden;
  padding: 11px 0;
  user-select: none;
}

.marquee-bar[hidden] { display: none !important; }

.marquee-track {
  animation: marqueeScroll 28s linear infinite;
  display: flex;
  width: max-content;
}

.marquee-track span {
  color: rgba(255,255,255,0.9);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.marquee-bar:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─── Hero ──────────────────────────────────────── */
.login-gate {
  align-items: center;
  background-color: #0a0a0a !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #fff !important;
  display: grid !important;
  gap: 0;
  grid-template-columns: 1fr 1fr;
  justify-content: initial;
  margin: 0 !important;
  min-height: 540px;
  overflow: hidden;
  padding: 80px 5% !important;
  text-align: left !important;
  width: 100%;
}

.login-gate::after { display: none !important; }

/* Hero with banner image */
.login-gate.has-banner {
  background-size: contain !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

.login-gate.has-banner::before {
  background: linear-gradient(135deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.5) 55%, rgba(0,0,0,0.25) 100%);
  content: "";
  inset: 0;
  position: absolute;
  z-index: 0;
}

.login-gate.has-banner .hero-text,
.login-gate.has-banner .hero-visual {
  position: relative;
  z-index: 1;
}

/* Admin banner settings */
.banner-setting-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.banner-preview-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 80px;
  overflow: hidden;
}

.banner-preview-img {
  display: block;
  max-height: 200px;
  object-fit: cover;
  width: 100%;
}

.banner-preview-empty {
  align-items: center;
  background: var(--bg);
  color: var(--muted);
  display: flex;
  font-size: 13px;
  justify-content: center;
  min-height: 80px;
  padding: 16px;
}

.banner-setting-btns {
  display: flex;
  gap: 10px;
}

.upload-btn-label {
  align-items: center;
  background: var(--brand);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  min-height: 36px;
  padding: 0 16px;
  transition: background 0.15s;
}

.upload-btn-label:hover { background: var(--brand-dark); }

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 1;
}

.hero-label {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  margin: 0;
  text-transform: uppercase;
}

.login-gate h1 {
  color: #ffffff !important;
  font-size: clamp(38px, 4.5vw, 68px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.03;
  margin: 0;
  max-width: none;
  text-align: left !important;
}

.hero-desc {
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
  max-width: 400px;
}

.hero-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.hero-cta-primary {
  background: #ffffff;
  border-radius: 8px;
  color: #0a0a0a;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  min-height: 46px;
  padding: 0 28px;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.hero-cta-primary:hover {
  background: #e8e8e8;
  box-shadow: 0 4px 16px rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

.hero-cta-line {
  background: var(--brand);
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  min-height: 46px;
  padding: 0 28px;
  transition: background 0.15s, transform 0.15s;
}

.hero-cta-line:hover {
  background: var(--brand-dark);
  transform: translateY(-2px);
}

/* Hero right — decorative panel */
.hero-visual {
  align-items: center;
  display: flex;
  justify-content: center;
  position: relative;
  min-height: 320px;
  z-index: 1;
}

.hero-glow-1 {
  background: radial-gradient(circle, rgba(6,199,85,0.28) 0%, transparent 65%);
  border-radius: 50%;
  height: 460px;
  pointer-events: none;
  position: absolute;
  right: -60px;
  top: -120px;
  width: 460px;
}

.hero-glow-2 {
  background: radial-gradient(circle, rgba(6,199,85,0.12) 0%, transparent 70%);
  border-radius: 50%;
  bottom: -120px;
  height: 340px;
  left: 0;
  pointer-events: none;
  position: absolute;
  width: 340px;
}

.hero-badge-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.hb {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 14px 32px;
  text-align: center;
  text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s;
}

.hb:hover {
  background: rgba(6,199,85,0.12);
  border-color: rgba(6,199,85,0.4);
}

/* ─── Home Strip ─────────────────────────────────── */
.home-strip {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
}

.home-strip article {
  align-items: flex-start;
  border-right: 1px solid var(--line);
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 28px 36px;
  transition: background 0.15s;
}

.home-strip article:last-child { border-right: none; }

.home-strip article:hover { background: #fafafa; }

.home-strip-icon {
  color: var(--brand);
  height: 22px;
  margin-bottom: 6px;
  width: 22px;
}

.home-strip-icon svg {
  height: 100%;
  width: 100%;
}

.home-strip strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.home-strip span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

/* ─── Info Grid ──────────────────────────────────── */
.info-grid {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
}

.info-grid article {
  border-right: 1px solid var(--line);
  padding: 36px;
  transition: background 0.15s;
}

.info-grid article:last-child { border-right: none; }

.info-grid article:hover { background: #fafafa; }

.info-grid .eyebrow {
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.info-grid h3 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 10px;
}

.info-grid p:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
}

/* ─── Section heading (shop) ──────────────────────── */
#shopContent > .section-heading {
  align-items: flex-end;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 24px 5% 20px;
}

#shopContent > .section-heading .eyebrow {
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  margin: 0;
  text-transform: uppercase;
}

#shopContent > .section-heading h2 {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 4px 0 0;
}

#shopContent > .section-heading > p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* ─── Product Filters ─────────────────────────────── */
.product-filters {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 18px 5%;
}

.filter-row-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-label {
  color: #9ca3af;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  min-width: 28px;
  text-transform: uppercase;
}

.product-filters .filter-tabs button,
.product-filters .admin-product-tab {
  background: #f3f4f6;
  border-radius: 999px !important;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  min-height: 28px !important;
  padding: 0 14px !important;
  transition: background 0.12s, color 0.12s;
}

.product-filters .filter-tabs button:hover:not(.active),
.product-filters .admin-product-tab:hover:not(.active) {
  background: #e5e7eb;
}

.product-filters .filter-tabs button.active,
.product-filters .admin-product-tab.active {
  background: var(--ink) !important;
  color: #ffffff !important;
}

.product-filters .admin-product-tab.active .tab-count {
  background: rgba(255,255,255,0.2) !important;
  color: #fff !important;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.filter-controls label {
  color: #9ca3af;
  display: flex;
  flex-direction: column;
  font-size: 10px;
  font-weight: 800;
  gap: 5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#productSearch {
  appearance: none;
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  min-height: 36px;
  min-width: 200px;
  padding: 0 14px;
  transition: outline 0.1s;
}

#productSearch:focus {
  outline: 2px solid var(--brand);
  outline-offset: 0;
}

#priceSort, #stockFilter {
  appearance: none;
  background: #f3f4f6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center;
  border: none;
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  min-height: 36px;
  padding: 0 36px 0 14px;
  transition: outline 0.1s;
}

#priceSort:focus, #stockFilter:focus {
  outline: 2px solid var(--brand);
  outline-offset: 0;
}

/* ─── Product Grid ──────────────────────────────── */
.product-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 auto;
  max-width: 1400px;
  padding: 28px 5% 48px;
}

/* ─── Product Card ──────────────────────────────── */
.product-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s ease, border-color 0.2s;
}

.product-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-hover);
  transform: translateY(-5px);
}

.image-wrap {
  aspect-ratio: 1 / 1;
  background: #f5f5f5;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.image-wrap img {
  display: block;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  width: 100%;
}

.product-card:hover .image-wrap img {
  transform: scale(1.07);
}

.deadline-badge {
  background: rgba(10,10,10,0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 6px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  left: 10px;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  position: absolute;
  top: 10px;
  z-index: 2;
}

.sold-out-badge {
  background: rgba(226,77,66,0.88);
  backdrop-filter: blur(6px);
  border-radius: 6px;
  bottom: 10px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  position: absolute;
  right: 10px;
  z-index: 2;
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
}

.card-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.category-pill {
  background: #f0f0f0;
  border-radius: 999px;
  color: #6b7280;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  text-transform: uppercase;
}

.stock-pill {
  background: #f0fdf4;
  border-radius: 999px;
  color: #16a34a;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
}

.product-title-row {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.product-title-row h3 {
  color: var(--ink);
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
}

.product-title-row .price {
  color: var(--accent);
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 800;
}

.product-excerpt {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  color: var(--muted);
  display: -webkit-box;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  overflow: hidden;
}

.meta-list {
  display: none;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.view-product-btn {
  background: var(--ink);
  border-radius: 8px;
  color: #ffffff;
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  min-height: 38px;
  transition: background 0.14s, transform 0.12s;
}

.view-product-btn:hover:not(:disabled) {
  background: #1f1f1f;
  transform: translateY(-1px);
}

.view-product-btn:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

.line-inquiry-btn {
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  min-height: 38px;
  padding: 0 12px;
  transition: border-color 0.14s, color 0.14s;
}

.line-inquiry-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ─── Empty state ─────────────────────────────────── */
.empty-state {
  background: #ffffff;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  grid-column: 1/-1;
  padding: 48px;
  text-align: center;
}

/* ─── Premium redesign — Responsive ─────────────── */
@media (max-width: 860px) {
  .topbar {
    padding: 0 20px;
  }

  .login-gate {
    grid-template-columns: 1fr;
    min-height: 420px;
    padding: 60px 6%;
  }

  .hero-visual { display: none; }

  .login-gate h1 {
    font-size: 42px;
  }

  .home-strip,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .home-strip article {
    border-bottom: 1px solid var(--line);
    border-right: none;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
  }

  .home-strip article:last-child {
    border-bottom: none;
  }

  .home-strip-icon {
    flex-shrink: 0;
  }

  .info-grid article {
    border-bottom: 1px solid var(--line);
    border-right: none;
    padding: 24px;
  }

  .info-grid article:last-child {
    border-bottom: none;
  }

  .product-grid {
    gap: 12px;
    grid-template-columns: repeat(2, 1fr);
    padding: 16px 4% 32px;
  }

  #shopContent > .section-heading {
    padding: 20px 4% 16px;
  }

  .product-filters {
    padding: 14px 4%;
  }
}

@media (max-width: 480px) {
  .login-gate {
    min-height: 360px;
    padding: 48px 5%;
  }

  .login-gate h1 {
    font-size: 34px;
  }

  .product-grid {
    gap: 10px;
    padding: 14px 3% 24px;
  }
}

/* TERRENCESTUDIO layout refresh: CHRONIC-inspired, function-safe overrides */
:root {
  --brand: #06c755;
  --brand-dark: #04a847;
  --accent: #e5483f;
  --bg: #f4f4f2;
  --panel: #ffffff;
  --ink: #0a0a0a;
  --muted: #6f7175;
  --line: #e4e4e0;
  --navy: #0a0a0a;
  --soft: #f7f7f5;
  --shadow: none;
  --shadow-hover: 0 18px 50px rgba(0, 0, 0, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans TC", "Helvetica Neue", Arial, "Microsoft JhengHei", system-ui, sans-serif;
}

button,
.hero-cta-primary,
.hero-cta-line,
.view-product-btn,
.line-inquiry-btn {
  border-radius: 0 !important;
  letter-spacing: 0.03em;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  min-height: 44px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ink);
  outline: 1px solid var(--ink);
}

.topbar {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
  height: 76px;
  padding: 0 clamp(18px, 4vw, 54px);
}

.brand {
  gap: 14px;
}

.brand img {
  border-radius: 0;
  height: 44px;
  width: 44px;
}

.brand strong {
  font-size: clamp(16px, 2.4vw, 28px);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.top-actions button,
.cart-header-btn,
.icon-btn {
  min-height: 44px;
}

.ghost-btn {
  background: #f1f1ef;
  color: var(--ink);
}

.seller-center-label {
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 44px;
  padding: 0 14px;
  text-transform: uppercase;
}

.settings-menu,
.cart-hover-dropdown,
.cart-preview {
  border-radius: 0;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
}

main {
  max-width: none;
  padding: 0;
}

.view:not(#shop) {
  margin: 0 auto;
  max-width: 1240px;
  padding: 32px clamp(16px, 4vw, 48px) 72px;
}

#shop {
  max-width: none;
}

.login-gate {
  background-color: #050505 !important;
  border-bottom: 1px solid #171717 !important;
  display: grid !important;
  grid-template-columns: 1fr;
  min-height: calc(100vh - 76px);
  padding: clamp(54px, 8vw, 112px) clamp(22px, 6vw, 92px) !important;
}

.login-gate.has-banner::before {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.56) 48%, rgba(0, 0, 0, 0.2));
}

.hero-text {
  gap: 20px;
  max-width: 680px;
}

.hero-label,
.eyebrow,
.filter-label {
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-gate h1 {
  font-size: clamp(44px, 7vw, 92px);
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.hero-desc {
  color: rgba(255, 255, 255, 0.68);
  font-size: clamp(14px, 1.5vw, 17px);
  line-height: 1.9;
  max-width: 560px;
}

.hero-actions {
  gap: 12px;
}

.hero-cta-primary,
.hero-cta-line,
.line-btn {
  font-size: 13px;
  font-weight: 900;
  min-height: 48px;
  padding: 0 28px;
}

.hero-cta-primary {
  background: #fff;
  color: #000;
}

.hero-cta-line,
.line-btn {
  background: var(--brand);
  color: #fff;
}

.hero-visual {
  min-height: 420px;
}

.hero-glow-1,
.hero-glow-2 {
  display: none;
}

.hero-badge-stack {
  align-items: stretch;
  max-width: 360px;
  width: 100%;
}

.hb {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  padding: 18px 28px;
}

.marquee-bar {
  background: #000;
  border-bottom: 1px solid #1b1b1b;
  padding: 10px 0;
}

.home-strip,
.info-grid {
  background: #fff;
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-strip article,
.info-grid article {
  border-bottom: 0;
  border-radius: 0;
  border-right: 1px solid var(--line);
  box-shadow: none;
  min-height: 148px;
  padding: clamp(22px, 3vw, 42px);
}

.home-strip article:last-child,
.info-grid article:last-child {
  border-right: 0;
}

.home-strip strong,
.info-grid h3 {
  color: var(--ink);
  font-size: clamp(15px, 1.4vw, 20px);
  font-weight: 900;
}

.home-strip span,
.info-grid p:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

#shopContent > .section-heading {
  align-items: end;
  background: #fff;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: clamp(26px, 4vw, 48px) clamp(20px, 5vw, 72px);
}

#shopContent > .section-heading h2 {
  font-size: clamp(26px, 4vw, 52px);
  font-weight: 950;
  letter-spacing: -0.04em;
}

#shopContent > .section-heading > p {
  max-width: 460px;
}

.product-filters {
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  margin: 0;
  padding: 18px clamp(20px, 5vw, 72px);
}

.filter-row-group {
  gap: 10px;
}

.filter-row {
  align-items: center;
  border: 0;
  min-height: 34px;
  padding: 0;
}

.filter-tabs {
  gap: 8px;
}

.filter-tab,
.admin-product-tab {
  background: #f0f0ee;
  border: 1px solid transparent;
  border-radius: 0 !important;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  min-height: 32px;
  padding: 0 14px;
}

.filter-tab.active,
.admin-product-tab.active {
  background: #000 !important;
  color: #fff !important;
}

.filter-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 240px) minmax(150px, 220px);
  margin-top: 16px;
}

.filter-controls label {
  color: var(--muted);
}

.filter-controls input,
.filter-controls select,
#productSearch,
#priceSort,
#stockFilter {
  background-color: #f4f4f2;
  border: 1px solid transparent;
  border-radius: 0;
}

.product-grid {
  background: var(--bg);
  gap: 1px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  padding: 1px;
}

.product-card {
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.product-card:hover {
  box-shadow: none;
  transform: none;
}

.image-wrap {
  aspect-ratio: 1 / 1.12;
  background: #ececea;
}

.deadline-badge {
  background: rgba(0, 0, 0, 0.84);
  border-radius: 0;
  font-size: 11px;
  left: 0;
  letter-spacing: 0.08em;
  padding: 8px 12px;
  right: auto;
  text-transform: uppercase;
  top: 0;
}

.sold-out-badge {
  background: #000;
  border-radius: 0;
  bottom: auto;
  font-size: 11px;
  letter-spacing: 0.08em;
  right: 0;
  top: 0;
}

.product-body {
  gap: 10px;
  padding: 18px;
}

.category-pill,
.stock-pill {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 4px 8px;
}

.product-title-row {
  align-items: start;
  gap: 14px;
}

.product-title-row h3 {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
}

.product-title-row .price,
.price {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

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

.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
}

.view-product-btn,
.card-actions .line-inquiry-btn {
  border-radius: 0;
  font-size: 12px;
  font-weight: 900;
  min-height: 40px;
}

.view-product-btn {
  background: #000;
}

.card-actions .line-inquiry-btn {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0 14px;
}

.section-heading,
.admin-shell,
.profile-form,
.orders-list,
.admin-list,
.cart-panel,
.dashboard-stats article,
.dashboard-panel,
.checkout-card,
.checkout-aside,
.order-confirm-dialog {
  border-radius: 0 !important;
  box-shadow: none !important;
}

.section-heading {
  border: 1px solid var(--line);
}

.detail-shell {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  gap: clamp(24px, 5vw, 68px);
  grid-template-columns: minmax(320px, 0.86fr) minmax(0, 1fr);
  padding: clamp(20px, 5vw, 64px) 0;
}

.detail-main-image,
.detail-main-image img {
  border-radius: 0;
  max-height: none;
}

.thumb {
  border-radius: 0;
}

.detail-info {
  padding-right: clamp(0px, 4vw, 42px);
}

.detail-info .product-title-row h2 {
  font-size: clamp(30px, 4.4vw, 60px);
  font-weight: 950;
  letter-spacing: -0.045em;
}

.detail-info .product-title-row .price {
  font-size: clamp(22px, 3vw, 32px) !important;
  font-weight: 800 !important;
}

@media (min-width: 761px) {
  .detail-info {
    grid-row: 1 / span 2;
  }
  .detail-gallery-notes {
    grid-column: 1;
    grid-row: 2;
  }
}

.detail-info-block {
  background: #fff;
  border-radius: 0;
}

.order-form button[type="submit"] {
  background: #000;
  color: #fff;
}

.cart-panel,
.checkout-card,
.checkout-aside {
  border: 1px solid var(--line);
}

.cart-table-header,
.cart-row,
.cart-footer {
  border-color: var(--line);
}

.cart-row {
  background: #fff;
}

.cart-item-img,
.cart-qty-select {
  border-radius: 0;
}

.admin-product-toolbar,
.admin-order-filters,
.dashboard-stats article,
.dashboard-panel,
.list-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

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

.dashboard-stats article {
  min-height: 126px;
  padding: 22px;
}

.dashboard-stats strong {
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.04em;
}

.dashboard-panel h3 {
  font-weight: 950;
}

.admin-list,
.orders-list {
  background: transparent;
  border: 0;
  padding: 0;
}

.list-row {
  padding: 16px;
}

.admin-product-deadline {
  background: #000;
  margin: -16px -16px 2px;
}

.admin-product-cover,
.order-photo {
  border-radius: 0;
}

.product-form-modal {
  border-radius: 0;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.42) !important;
}

.upload-panel,
.image-preview-card,
.image-upload {
  border-radius: 0;
}

.floating-contact a,
.floating-contact img {
  border-radius: 0 !important;
}

@media (max-width: 960px) {
  .topbar {
    height: 64px;
    padding: 0 16px;
  }

  .brand img {
    height: 38px;
    width: 38px;
  }

  .brand strong {
    font-size: 15px;
  }

  .seller-center-label {
    display: none;
  }

  .view:not(#shop) {
    padding: 18px 14px 54px;
  }

  .login-gate {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 64px);
    padding: 56px 22px !important;
  }

  .hero-visual {
    display: none;
  }

  .login-gate h1 {
    font-size: clamp(38px, 12vw, 64px);
  }

  .home-strip,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .home-strip article,
  .info-grid article {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    min-height: auto;
    padding: 22px;
  }

  #shopContent > .section-heading {
    align-items: start;
    flex-direction: column;
    padding: 28px 18px;
  }

  .product-filters {
    padding: 16px 18px;
  }

  .filter-controls {
    grid-template-columns: 1fr;
  }

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

  .product-body {
    padding: 12px;
  }

  .product-title-row {
    display: grid;
    gap: 6px;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .detail-shell {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .detail-info {
    padding: 0;
  }

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

@media (max-width: 520px) {
  .member-actions {
    gap: 6px;
  }

  .top-actions button,
  .cart-header-btn,
  .icon-btn {
    min-height: 40px;
  }

  .ghost-btn {
    padding: 0 12px;
  }

  .product-grid {
    gap: 1px;
  }

  .image-wrap {
    aspect-ratio: 1 / 1.18;
  }

  .category-pill,
  .stock-pill,
  .product-excerpt,
  .line-inquiry-btn {
    display: none !important;
  }

  .product-title-row h3 {
    font-size: 12px;
  }

  .product-title-row .price {
    font-size: 12px;
  }

  .view-product-btn {
    min-height: 34px;
  }

  .cart-row,
  .cart-table-header,
  .cart-footer {
    grid-template-columns: 1fr;
  }

.floating-contact {
    bottom: 14px;
    right: 12px;
  }
}

/* Header: centered logo + nav-below layout */
.topbar {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0 !important;
  height: auto !important;
  padding: 0 !important;
}

.topbar-main {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 18px 40px 12px;
}

.topbar-left {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 8px;
  justify-content: flex-start;
  min-width: 0;
}

.topbar-right {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.brand {
  flex: 0 0 auto;
  flex-direction: column !important;
  align-items: center !important;
  gap: 6px !important;
}

.brand img {
  border-radius: 50% !important;
  height: 64px !important;
  width: 64px !important;
}

.brand strong {
  font-size: 12px !important;
  letter-spacing: 0.12em !important;
  text-align: center !important;
}

.header-nav {
  border-top: 1px solid var(--line);
  display: flex !important;
  gap: clamp(20px, 4vw, 56px);
  justify-content: center;
  padding: 11px 40px;
  width: 100%;
}

.header-nav button {
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  min-height: auto;
  padding: 2px 0;
  text-transform: none;
}

@media (max-width: 960px) {
  .topbar-main {
    padding: 12px 16px 10px;
  }

  .brand img {
    height: 46px !important;
    width: 46px !important;
  }

  .brand strong {
    font-size: 10px !important;
  }

  .header-preferences {
    display: none !important;
  }

  .header-nav {
    gap: 16px;
    padding: 9px 16px;
  }

  .member-actions:not([hidden]),
  .guest-actions:not([hidden]) {
    align-items: center;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
  }

  /* 手機：我的帳戶只顯示 icon，隱藏文字 */
  #myAccountBtn {
    background: transparent !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 0 !important;
    min-height: 44px !important;
    padding: 0 4px !important;
    width: 44px !important;
  }

  #myAccountBtn svg {
    height: 22px !important;
    margin: 0 !important;
    width: 22px !important;
  }

  #myAccountBtn:hover {
    background: rgba(0,0,0,0.06) !important;
    color: var(--ink) !important;
  }

  #logoutBtn {
    font-size: 11px !important;
    padding: 0 10px !important;
    min-height: 34px !important;
  }

  /* ── 手機商品卡片 chronic.cc 風格 ── */
  .product-grid {
    gap: 2px !important;
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 0 !important;
  }

  .product-card {
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 1px solid #ebebeb !important;
    box-shadow: none !important;
  }

  .product-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  .image-wrap {
    aspect-ratio: 1 / 1 !important;
    background: #f7f7f7 !important;
  }

  .image-wrap img {
    object-fit: contain !important;
    padding: 12px !important;
    transition: none !important;
  }

  .product-card:hover .image-wrap img {
    transform: none !important;
  }

  .product-body {
    background: #fff;
    gap: 4px !important;
    padding: 10px 10px 12px !important;
  }

  .product-title-row {
    flex-direction: column !important;
    gap: 4px !important;
  }

  .product-title-row h3 {
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em !important;
    line-height: 1.4 !important;
    text-transform: uppercase !important;
  }

  .product-title-row .price {
    color: var(--ink) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
  }

  .product-excerpt {
    display: none !important;
  }

  .view-product-btn {
    background: #f0f0f0 !important;
    border-radius: 4px !important;
    color: #1a1a1a !important;
    font-size: 0 !important;
    min-height: 38px !important;
    position: relative;
  }

  .view-product-btn::after {
    content: "";
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.2 6.4h15.1l-1.6 7.7H7.1L5.2 3.8H2.8'/%3E%3Ccircle cx='8.5' cy='19' r='1.4'/%3E%3Ccircle cx='17.2' cy='19' r='1.4'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 20px 20px;
    display: block;
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
  }

  .view-product-btn:disabled {
    background: #f0f0f0 !important;
    color: #9ca3af !important;
  }

  .view-product-btn:disabled::after {
    opacity: 0.35;
  }
}

.guest-actions {
  display: flex;
}

.header-preferences {
  align-items: center;
  display: flex;
  gap: 6px;
}

.header-select-wrap {
  display: block;
  position: relative;
}

.header-select-wrap span {
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.header-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1px solid #d9d9d9;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  min-height: 36px;
  min-width: 96px;
  padding: 0 28px 0 12px;
}

.header-select-wrap::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #777;
  content: "";
  pointer-events: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.header-login-btn {
  background: #f3f3f1;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  min-height: 36px !important;
  padding: 0 14px;
  text-transform: uppercase;
}

.header-login-btn:hover {
  background: #000;
  color: #fff;
}

.login-gate #gateLoginBtn {
  display: none !important;
}

/* ─── Site Footer ────────────────────────────────── */
.site-footer {
  background: #1a1a1a;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  margin-top: 60px;
}
.site-footer-inner {
  display: flex;
  gap: 60px;
  justify-content: center;
  margin: 0 auto;
  max-width: 900px;
  padding: 56px 40px 40px;
}
.footer-col {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 160px;
  text-align: center;
}
.footer-col h4 {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0 0 4px;
  text-transform: uppercase;
}
.footer-col a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-col a:hover { color: #fff; }
.footer-col p {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 0;
}
.footer-col p span:first-child {
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  letter-spacing: 0.06em;
  min-width: 56px;
  text-transform: uppercase;
}
.footer-biz {
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.3);
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
  gap: 8px 24px;
  justify-content: center;
  letter-spacing: 0.06em;
  padding: 20px 40px 12px;
  text-align: center;
}
.footer-copy {
  color: rgba(255,255,255,0.3);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 0 40px 20px;
  text-align: center;
}

@media (max-width: 600px) {
  .site-footer-inner {
    flex-direction: column;
    gap: 36px;
    padding: 40px 28px 32px;
  }
}

#shopContent .section-heading {
  justify-content: center !important;
  text-align: center !important;
}

#shopContent .section-heading h2 {
  font-size: clamp(28px, 4vw, 48px);
}

/* ─── Topbar search ──────────────────────────────────── */
.topbar-search-wrap {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  display: flex;
  gap: 0;
  overflow: hidden;
  padding: 0 10px 0 6px;
  transition: border-color 0.15s;
}
.topbar-search-wrap:focus-within { border-color: #999; }

.topbar-search-input {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  min-height: 32px;
  outline: none;
  padding: 0;
  width: 120px;
}
.topbar-search-input::placeholder { color: #aaa; }
.topbar-search-input::-webkit-search-cancel-button { cursor: pointer; }

/* ─── Search + Mobile menu buttons ──────────────────── */
.header-search-btn {
  align-items: center;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  height: 32px;
  justify-content: center;
  min-height: auto;
  padding: 0 4px 0 2px;
  width: 28px;
}
.header-search-btn:hover { color: #555; }

.mobile-menu-btn {
  align-items: center;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  display: none;
  height: 36px;
  justify-content: center;
  min-height: auto;
  padding: 0;
  width: 36px;
}
.mobile-menu-btn:hover { background: rgba(0,0,0,0.06); }

/* ─── Mobile category drawer ─────────────────────── */
.mobile-cat-panel {
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 9999;
}
.mobile-cat-overlay {
  background: rgba(0,0,0,0.55);
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}
.mobile-cat-drawer {
  background: #1a1a1a;
  bottom: 0;
  display: flex;
  flex-direction: column;
  left: 0;
  max-width: 80vw;
  overflow-y: auto;
  position: absolute;
  top: 0;
  width: 280px;
}
.mobile-cat-header {
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: space-between;
  letter-spacing: 0.1em;
  padding: 18px 20px;
  text-transform: uppercase;
}
.mobile-cat-header button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  min-height: auto;
  padding: 4px;
}
.mobile-cat-list {
  display: flex;
  flex-direction: column;
}
.mobile-cat-list button {
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  min-height: auto;
  padding: 18px 20px;
  text-align: left;
  text-transform: uppercase;
  width: 100%;
}
.mobile-cat-list button:hover { color: #fff; background: rgba(255,255,255,0.05); }

.mobile-search-panel {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  width: 100%;
}
.mobile-search-panel input {
  background: none;
  border: none;
  color: var(--ink);
  flex: 1;
  font-size: 15px;
  min-height: 36px;
  outline: none;
}
.mobile-search-panel input::placeholder { color: #aaa; }
.mobile-search-panel svg { color: #888; flex-shrink: 0; }

@media (max-width: 960px) {
  .mobile-menu-btn { display: flex; }

  .topbar-search-wrap { display: none !important; }
  .header-search-btn { height: 44px; padding: 0; width: 44px; }

  /* Nav hidden on mobile by default */
  .header-nav { display: none !important; }

  /* Shown when hamburger toggled */
  .topbar.nav-open .header-nav {
    background: #fff;
    border-top: 1px solid var(--line);
    display: flex !important;
    flex-wrap: wrap;
    gap: 0;
    justify-content: flex-start;
    padding: 8px 16px 12px;
  }

  .topbar.nav-open .header-nav button {
    font-size: 13px;
    min-height: 38px;
    padding: 6px 14px;
  }

  /* Banner cover on mobile (no black borders) */
  .login-gate.has-banner {
    background-size: cover !important;
    min-height: 56vw;
  }
}


@media (max-width: 520px) {
  .header-login-btn {
    font-size: 11px;
    min-height: 34px !important;
    padding: 0 10px;
  }

  .header-preferences {
    gap: 4px;
  }

  .header-select-wrap select {
    font-size: 11px;
    min-height: 34px;
    min-width: 74px;
    padding: 0 22px 0 8px;
  }
}

/* ── Scroll-shrink header ── */
.topbar-main,
.topbar-main .brand img,
.topbar-main .brand strong,
.header-nav {
  transition: padding 0.28s ease, height 0.28s ease;
}

.brand img {
  transition: width 0.28s ease, height 0.28s ease !important;
}

.topbar--scrolled .topbar-main {
  padding: 6px 40px !important;
}

.topbar--scrolled .brand img {
  height: 36px !important;
  width: 36px !important;
}

.topbar--scrolled .brand strong {
  font-size: 10px !important;
}

.topbar--scrolled .header-nav {
  padding: 7px 40px !important;
}

@media (max-width: 960px) {
  .topbar--scrolled .topbar-main {
    padding: 4px 16px !important;
  }

  .topbar--scrolled .brand img {
    height: 28px !important;
    width: 28px !important;
  }

  .topbar--scrolled .header-nav {
    padding: 6px 16px !important;
  }
}

/* Login modal */
.login-modal-overlay {
  align-items: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(0, 0, 0, 0.56);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 22px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 90;
}

.login-modal-overlay[hidden] {
  display: none !important;
}

.login-modal-dialog {
  background: #fff;
  border: 0;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.18);
  display: grid;
  font-family: "Noto Sans TC", "Helvetica Neue", Arial, "Microsoft JhengHei", system-ui, sans-serif;
  gap: 18px;
  max-width: 360px;
  padding: 34px 30px 30px;
  position: relative;
  text-align: center;
  width: min(100%, 360px);
}

.login-modal-close {
  background: transparent;
  color: #9ca3af;
  font-size: 20px;
  line-height: 1;
  min-height: 28px;
  padding: 0;
  position: absolute;
  right: 16px;
  top: 14px;
  width: 28px;
}

.login-modal-close:hover {
  color: var(--ink);
  transform: none;
}

.login-modal-dialog h3 {
  color: #111827;
  font-size: 25px;
  font-weight: 950;
  letter-spacing: 0.06em;
  line-height: 1.15;
  margin: 0;
}

.login-modal-dialog p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  margin: -8px auto 4px;
  max-width: 260px;
}

.login-provider-btn {
  align-items: center;
  background: #fff;
  border: 1px solid #dadde3;
  color: var(--ink);
  display: grid;
  gap: 12px;
  grid-template-columns: 58px 1fr;
  justify-items: start;
  min-height: 64px;
  padding: 0 16px;
  text-align: left;
}

.login-provider-btn:hover {
  border-color: #111827;
  box-shadow: inset 0 0 0 1px #111827;
  transform: none;
}

.login-provider-icon {
  align-items: center;
  background: transparent;
  color: #fff;
  display: inline-flex;
  height: 46px;
  justify-content: center;
  overflow: hidden;
  width: 46px;
}

.login-provider-icon img {
  display: block;
  height: 46px;
  object-fit: cover;
  width: 46px;
}

.login-provider-btn strong {
  color: #1f2937;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

/* Rounded UI refresh */
:root {
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

button,
.header-login-btn,
.seller-center-label,
.hero-cta-primary,
.hero-cta-line,
.view-product-btn,
.line-inquiry-btn,
.cart-btn,
.icon-btn,
.tab-btn,
.filter-chip,
.login-provider-btn {
  border-radius: var(--radius-sm) !important;
}

input,
select,
textarea,
.input,
.admin-search input,
.admin-search select,
.quantity-select,
.header-select-wrap select {
  border-radius: var(--radius-sm) !important;
}

.card,
.panel,
.hero,
.info-card,
.product-card,
.product-detail-card,
.cart-page,
.checkout-card,
.admin-card,
.admin-panel,
.admin-product-card,
.order-card,
.customer-card,
.setting-card,
.dashboard-card,
.coupon-card,
.modal,
.order-confirm-dialog,
.payment-info-dialog,
.login-modal-dialog,
.product-form-modal,
.product-form,
.image-uploader,
.product-image-manager,
.filter-panel,
.home-strip,
.section-title-card {
  border-radius: var(--radius-md) !important;
}

.product-cover,
.product-card img,
.product-thumb,
.detail-main-image,
.detail-thumb,
.admin-product-cover,
.image-preview,
.image-tile,
.cart-item-image,
.order-product-image {
  border-radius: var(--radius-sm) !important;
}

.brand img {
  border-radius: 50% !important;
}

.login-modal-dialog {
  border-radius: var(--radius-lg) !important;
}

.login-provider-icon,
.login-provider-icon img,
.floating-contact a,
.cart-badge,
.status-dot {
  border-radius: 999px !important;
}


/* ── Toast 通知 ── */
.site-toast {
  align-items: center;
  background: #1a1a1a;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  color: #fff;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 10px;
  letter-spacing: 0.04em;
  opacity: 0;
  padding: 14px 20px;
  position: fixed;
  right: 20px;
  top: 90px;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 99999;
}
.site-toast--show {
  opacity: 1;
  transform: translateY(0);
}
.site-toast--success svg {
  fill: #22c55e;
  flex-shrink: 0;
  height: 20px;
  width: 20px;
}

/* ── Account Page ── */
.acct-layout {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px clamp(16px, 4vw, 40px) 64px;
}

.acct-layout--admin {
  max-width: 1240px;
}

#account.view {
  padding: 0;
}

.acct-admin-panel {
  padding-top: 8px;
}

.acct-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 28px;
}

.acct-user-card {
  align-items: center;
  display: flex;
  gap: 14px;
}

.acct-avatar-wrap {
  flex-shrink: 0;
  height: 52px;
  width: 52px;
}

#acctAvatarImg {
  border-radius: 999px;
  height: 52px;
  object-fit: cover;
  width: 52px;
}

.acct-avatar-placeholder {
  align-items: center;
  background: #f0f0ee;
  border-radius: 999px;
  display: flex;
  height: 52px;
  justify-content: center;
  width: 52px;
}

.acct-avatar-placeholder svg {
  fill: #aaa;
  height: 26px;
  width: 26px;
}

.acct-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.acct-user-meta strong {
  font-size: 16px;
  font-weight: 800;
}

.acct-user-meta span {
  color: #888;
  font-size: 12px;
}

.acct-logout-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px !important;
  color: #666;
  font-size: 12px;
  font-weight: 700;
  min-height: 34px !important;
  padding: 0 14px;
}

.acct-logout-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.acct-tabs-bar {
  border-bottom: 2px solid var(--line);
  display: flex;
  gap: 0;
  margin-bottom: 28px;
}

.acct-tab {
  background: transparent;
  border-bottom: 2px solid transparent;
  border-radius: 0 !important;
  color: #888;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: -2px;
  min-height: 42px !important;
  padding: 0 20px;
}

.acct-tab.active {
  border-bottom-color: var(--ink);
  color: var(--ink);
}

.acct-tab:hover:not(.active) {
  color: var(--ink);
}

.acct-panels {
  min-height: 300px;
}

.acct-panel {
  animation: acctFadeIn 0.18s ease;
}

@keyframes acctFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Product detail alignment */
.detail-shell {
  gap: clamp(28px, 4vw, 56px) !important;
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr) !important;
  padding: clamp(22px, 3vw, 38px) !important;
}

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

.detail-main-image {
  width: 100%;
}

.detail-gallery-notes {
  margin-top: 10px;
  width: 100%;
}

.detail-info {
  padding-right: 0 !important;
}

@media (max-width: 760px) {
  .detail-shell {
    grid-template-columns: 1fr !important;
    padding: 16px !important;
  }
}
