/* 團購訂購頁（tuangou.html）— 唔影響首頁／討論區 */
.page-tuangou .tg-hero {
  padding-bottom: 2.5rem;
  text-align: left;
}
.tg-hook {
  margin: 0 0 0.6rem;
  font-size: clamp(2rem, 8vw, 3.15rem);
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--brand);
}
.tg-tagline {
  margin: 0 0 1.1rem;
  font-size: clamp(1.05rem, 3.2vw, 1.35rem);
  font-weight: 600;
  color: var(--brand-2);
}
.tg-lead { max-width: 40rem; }
.tg-benefits { margin-bottom: 0; }
.tuangou-note { margin: 0 0 1.5rem !important; }
.tuangou-contact { margin-top: 2rem; }

.tg-stats {
  display: grid;
  gap: 0.75rem;
}
.tg-stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.tg-stat-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.tg-stat-title { font-weight: 700; color: var(--brand); }
.tg-stat-price { font-weight: 700; color: var(--accent); white-space: nowrap; }
.tg-stat-meta {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
}
.tg-bar {
  height: 8px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
}
.tg-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand-2), var(--accent));
  border-radius: inherit;
  transition: width 0.4s ease;
}
.tg-stat-card.is-full .tg-bar > span { background: var(--brand); }

.tg-tier-fieldset,
.tg-color-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.tg-tier-fieldset legend,
.tg-color-fieldset legend,
.tg-measure-heading {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.tg-fieldset-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-muted);
}
.tg-tiers {
  display: grid;
  gap: 0.65rem;
}
.tg-tier {
  display: block;
  cursor: pointer;
}
.tg-tier input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tg-tier-body {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.35rem 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.tg-tier-title { font-weight: 600; }
.tg-tier-price { font-weight: 700; color: var(--brand); }
.tg-tier-progress {
  flex-basis: 100%;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ink-muted);
}
.tg-tier:hover .tg-tier-body {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
}
.tg-tier input:focus-visible + .tg-tier-body {
  outline: 2px solid color-mix(in srgb, var(--brand) 35%, white);
  border-color: var(--brand-2);
}
.tg-tier input:checked + .tg-tier-body {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--accent-soft) 70%, white);
  box-shadow: 0 0 0 1px var(--brand);
}
.tg-tier.is-invalid .tg-tier-body { border-color: var(--danger); }

.tg-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.tg-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem 0.45rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-weight: 500;
}
.tg-swatch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tg-swatch:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.tg-swatch input:checked + .tg-chip { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand); }
.tg-swatch:has(input:checked) {
  border-color: var(--brand);
  background: var(--accent-soft);
}
.tg-swatch.is-invalid { border-color: var(--danger); }
.tg-chip {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}
.tg-chip-black { background: #1A1A1A; }
.tg-chip-ivory { background: #F3EBDD; }
.tg-chip-navy { background: #121820; }


.tg-pickup-locked {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-soft) 55%, white);
}
.tg-pickup-locked strong {
  font-size: 1.05rem;
  color: var(--brand);
}
.tg-pickup-locked span {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--ink-muted);
}

.tg-measure-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}

.tg-modal[hidden] { display: none !important; }
.tg-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: end center;
  padding: 0;
}
.tg-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 61, 58, 0.45);
}
.tg-modal-panel {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  padding: 1.35rem 1.2rem calc(1.35rem + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(15, 61, 58, 0.2);
}
.tg-modal-panel h2 { margin: 0 0 0.5rem; }
.tg-modal-blurb { margin: 0 0 1rem; color: var(--ink-muted); }
.tg-stats-modal { margin-bottom: 1rem; }
.tg-paste-box { margin-bottom: 1rem; }
.tg-paste-label {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
}
.tg-modal-note {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

@media (min-width: 768px) {
  .tg-stats { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .tg-tiers { grid-template-columns: 1fr 1fr; }
  
.tg-pickup-locked {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-soft) 55%, white);
}
.tg-pickup-locked strong {
  font-size: 1.05rem;
  color: var(--brand);
}
.tg-pickup-locked span {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--ink-muted);
}

.tg-measure-grid { grid-template-columns: repeat(4, 1fr); }
  .tg-modal { place-items: center; padding: 1.5rem; }
  .tg-modal-panel {
    border-radius: var(--radius);
    padding: 1.75rem;
  }
}

/* Size reference chart + selectable baselines */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.tg-chart-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.tg-chart {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 760px;
}
.tg-chart th,
.tg-chart td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tg-chart thead th {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  position: sticky;
  top: 0;
}
.tg-chart th:first-child,
.tg-chart td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 6.5rem;
}
.tg-chart thead th:first-child { z-index: 2; }
.tg-chart tbody th {
  background: #fff;
  color: var(--brand);
  font-weight: 700;
}
.tg-chart tbody tr:nth-child(even) td,
.tg-chart tbody tr:nth-child(even) th { background: var(--bg-alt); }
.tg-chart .tg-derived {
  color: var(--ink-muted);
}
.tg-chart-notes {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ink-muted);
  line-height: 1.55;
}
.tg-chart-notes p { margin: 0 0 0.35rem; }
.tg-measure-custom {
  margin-top: 0.45rem;
}
.tg-measure-custom[hidden] { display: none !important; }

.tg-measure-guide {
  margin: 0 0 1.5rem;
  max-width: 100%;
  min-width: 0;
  grid-column: 1 / -1;
}
.tg-measure-guide-cap {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}
.tg-measure-guide-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.tg-measure-guide-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 35%, white);
  outline-offset: 3px;
  border-radius: var(--radius);
}
.tg-measure-guide picture {
  display: block;
  max-width: 100%;
  min-width: 0;
  line-height: 0;
}
.tg-measure-guide img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(70vh, 34rem);
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}
.tg-measure-guide-zoom {
  display: block;
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-muted);
}
@media (max-width: 735px) {
  .tg-measure-guide img {
    max-height: min(62vh, 16.5rem);
  }
}

.tg-measure-lightbox[hidden] { display: none !important; }
.tg-measure-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 0;
}
.tg-measure-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 61, 58, 0.72);
}
.tg-measure-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(1200px, 100%);
  max-height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 3rem 0.75rem 0.75rem;
  box-sizing: border-box;
}
.tg-measure-lightbox-panel img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
}
.tg-measure-lightbox-close {
  position: absolute;
  top: 0.45rem;
  right: 0.75rem;
  z-index: 2;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: rgba(15, 61, 58, 0.92);
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
}
.tg-measure-lightbox-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
