/* 颶風金流平台 — 風暴感商務 UI */

:root {
  --store-primary: #2558d8;
  --store-primary-strong: #173ea8;
  --store-accent: #f59e0b;
  --store-bg: #eef3fb;
  --store-surface: rgba(255, 255, 255, 0.9);
  --store-surface-strong: #ffffff;
  --store-border: rgba(148, 163, 184, 0.24);
  --store-border-strong: rgba(37, 99, 235, 0.18);
  --store-text: #0f172a;
  --store-muted: #5b667b;
  --store-soft: #e8eefb;
  --store-price: #e4393c;
  --store-footer-bg: #0f172a;
  --store-footer-text: #8fa3c8;
  --store-shadow: 0 20px 45px rgba(15, 23, 42, 0.10);
  --store-shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.08);
  --store-radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 88, 216, 0.14), transparent 34%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.14), transparent 28%),
    linear-gradient(180deg, #f6f9ff 0%, var(--store-bg) 100%);
  color: var(--store-text);
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: var(--store-primary);
}

a:hover {
  color: var(--store-primary-strong);
}

/* ── Navbar ─────────────────────────────────── */
.store-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 72px;
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 2px 24px rgba(15, 23, 42, 0.05);
}

.store-nav .brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--store-text);
  line-height: 1.1;
  flex-shrink: 0;
}

.store-nav .brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.store-brand-primary {
  display: flex;
  align-items: baseline;
  gap: .55rem;
}

.store-brand-primary strong {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.015em;
}

.store-brand-endorsement {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--store-muted);
  font-size: .62rem;
  font-weight: 700;
  white-space: nowrap;
}

.store-nav .brand-sub {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--store-muted);
  text-transform: uppercase;
}

.store-nav .nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.store-nav .nav-links a {
  position: relative;
  padding: 0.5rem 0.9rem;
  text-decoration: none;
  color: var(--store-muted);
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 999px;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.store-nav .nav-links a:hover {
  color: var(--store-primary-strong);
  background: rgba(37, 88, 216, 0.08);
  transform: translateY(-1px);
}

.store-nav .nav-links a[aria-current="page"] {
  color: var(--store-primary-strong);
  background: rgba(37, 88, 216, 0.1);
}

.store-portal-role {
  padding: 0.28rem 0.65rem;
  color: #174ebd;
  background: #e8f0ff;
  border: 1px solid rgba(37, 88, 216, 0.16);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

/* ── Language switcher ──────────────────────── */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.5rem;
  font-size: 0.85rem;
}

.lang-switch a {
  padding: 0.25rem 0.5rem;
  color: var(--store-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 160ms ease, color 160ms ease;
}

.lang-switch a:hover {
  background: rgba(37, 88, 216, 0.08);
  color: var(--store-primary-strong);
}

.lang-switch a.active {
  color: #fff;
  background: var(--store-primary);
  font-weight: 700;
}

.lang-sep {
  color: var(--store-muted);
  opacity: 0.5;
}

/* ── 漢堡選單按鈕（手機專用） ─────────────────── */
.nav-toggle {
  display: none; /* 桌面隱藏，640px 以下顯示 */
}

/* ── Footer 語言切換器（深色底白字版） ─────────── */
.footer-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.8rem;
  font-size: 0.85rem;
}

.footer-lang a {
  padding: 0.28rem 0.7rem;
  color: var(--store-footer-text);
  text-decoration: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  transition: background-color 160ms ease, color 160ms ease;
}

.footer-lang a:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.footer-lang a.active {
  color: #fff;
  background: var(--store-primary);
  font-weight: 700;
}

.footer-lang .lang-sep {
  color: rgba(255, 255, 255, 0.3);
  opacity: 1;
}

/* ── Shared Layout ──────────────────────────── */
.store-hero,
.store-featured,
.store-main,
.product-detail,
.policy-page {
  width: min(1180px, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}

.store-hero {
  position: relative;
  overflow: hidden;
  margin-top: 1.2rem;
  padding: 2.3rem 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(37, 88, 216, 0.96) 56%, rgba(245, 158, 11, 0.95) 120%);
  color: #fff;
  box-shadow: var(--store-shadow);
}

.store-hero::before {
  content: "";
  position: absolute;
  inset: auto -120px -130px auto;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.store-hero::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 24px;
  pointer-events: none;
}

.store-hero h1 {
  position: relative;
  margin: 0 0 0.55rem;
  font-size: clamp(2rem, 4vw, 3.55rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.store-hero p {
  position: relative;
  max-width: 760px;
  margin: 0;
  font-size: clamp(0.96rem, 1.4vw, 1.05rem);
  color: rgba(255, 255, 255, 0.88);
}

.store-main,
.store-featured {
  padding-top: 1.3rem;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 1.4rem 0 1rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.section-header p {
  margin: 0;
  color: var(--store-muted);
  font-size: 0.95rem;
}

/* ── Product Grid ────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.product-card {
  grid-column: span 4;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  padding: 1.4rem;
  border-radius: var(--store-radius);
  border: 1px solid var(--store-border);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.92) 100%);
  box-shadow: var(--store-shadow-soft);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  overflow: hidden;
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(37,88,216,0.05), transparent 42%);
  pointer-events: none;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.14);
  border-color: rgba(37, 88, 216, 0.24);
}

.product-card h3 {
  position: relative;
  margin: 0 0 0.45rem;
  font-size: 1.14rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.product-card .desc {
  position: relative;
  margin: 0 0 1rem;
  color: var(--store-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  min-height: 3.4em;
}

.product-card .price {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  margin: 0 0 0.9rem;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--store-price);
}

.product-card .price .currency {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--store-muted);
  letter-spacing: 0.08em;
}

.purchase-hint {
  position: relative;
  margin: 0.65rem 0 0;
  color: var(--store-muted);
  font-size: 0.82rem;
}

.btn-buy,
.btn,
.btn-secondary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 48px;
  padding: 0.78rem 1rem;
  border: 0;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn-buy,
.btn-primary {
  margin-top: auto;
  width: 100%;
  background: linear-gradient(135deg, var(--store-primary) 0%, var(--store-primary-strong) 100%);
  color: #fff;
  box-shadow: 0 14px 24px rgba(37, 88, 216, 0.22);
}

.btn-buy:hover,
.btn-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(37, 88, 216, 0.28);
}

.btn-buy.btn-buy--secondary {
  margin-top: 0.75rem;
  width: 100%;
  background: rgba(37, 88, 216, 0.08);
  color: var(--store-primary-strong);
}

.btn-buy.btn-buy--secondary:hover {
  background: rgba(37, 88, 216, 0.14);
}

.btn-secondary,
.btn-outline {
  min-height: 46px;
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
}

.btn-secondary:hover {
  color: #fff;
}

.btn-outline {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(37, 88, 216, 0.22);
  color: var(--store-primary-strong);
}

.btn-outline:hover {
  background: #fff;
  color: var(--store-primary-strong);
}

.btn-buy.disabled,
.btn-buy[disabled] {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-checkout:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Product Detail ───────────────────────────── */
.product-detail {
  padding-top: 1.3rem;
  max-width: 860px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--store-muted);
}

.breadcrumb a {
  color: var(--store-primary);
  text-decoration: none;
  font-weight: 700;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.detail-card {
  position: relative;
  padding: 1.8rem;
  border-radius: 28px;
  border: 1px solid rgba(37, 88, 216, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.92));
  box-shadow: var(--store-shadow);
}

.detail-card h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.detail-price {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 1rem;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--store-price);
}

.detail-price .currency {
  font-size: 0.88rem;
  color: var(--store-muted);
  letter-spacing: 0.08em;
}

.detail-desc {
  margin-bottom: 1rem;
  color: var(--store-text);
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.features-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(37, 88, 216, 0.08);
  color: var(--store-primary-strong);
  font-size: 0.88rem;
  font-weight: 700;
}

.features-list li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--store-accent);
}

/* ── Checkout ─────────────────────────────────── */

/* 三步結帳提示（HC-1 #310，標準結帳與 Hosted Checkout 共用） */
.checkout-steps {
  margin: 0 0 1.25rem;
}

.checkout-steps-list {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0.85rem 1rem;
  list-style: none;
  border-radius: 18px;
  border: 1px solid rgba(37, 88, 216, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--store-shadow);
}

.checkout-step {
  position: relative;
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.2rem 0.85rem;
  min-height: 44px;
  color: var(--store-muted);
  font-weight: 700;
  font-size: 0.9rem;
}

/* 步驟間連接線（不含最後一步） */
.checkout-step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -0.5rem;
  top: 50%;
  width: 1rem;
  height: 2px;
  background: rgba(148, 163, 184, 0.4);
  transform: translateY(-50%);
}

.checkout-step-marker {
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.5);
  background: #fff;
  color: var(--store-muted);
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1;
}

.checkout-step-check {
  font-size: 0.85rem;
}

.checkout-step-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.2;
}

.checkout-step-name {
  font-weight: 800;
  color: var(--store-muted);
}

/* 狀態文字（不只靠色彩傳達狀態，無障礙要求） */
.checkout-step-state {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--store-muted);
  letter-spacing: 0.02em;
}

/* 已完成 */
.checkout-step.is-done .checkout-step-marker {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}

.checkout-step.is-done .checkout-step-name {
  color: var(--store-text);
}

.checkout-step.is-done .checkout-step-state {
  color: #16a34a;
}

/* 進行中（目前步驟） */
.checkout-step.is-current .checkout-step-marker {
  border-color: var(--store-accent);
  background: var(--store-accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(37, 88, 216, 0.16);
}

.checkout-step.is-current .checkout-step-name {
  color: var(--store-text);
}

.checkout-step.is-current .checkout-step-state {
  color: var(--store-accent);
  font-weight: 800;
}

.checkout-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 1rem;
  align-items: start;
}

/* Hosted Checkout 摘要尾註與次標題（HC-1：取代 inline style，共用視覺語彙） */
.checkout-summary-merchant {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
  color: var(--store-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Hosted Checkout 頁面主標題與導言（跨欄頂部，heading outline h1 在最前） */
.checkout-page-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 900;
  color: var(--store-text);
}

.checkout-page-intro {
  margin: 0 0 1.25rem;
}

.checkout-pay-title {
  font-size: 1.1rem;
  margin-top: 1.5rem;
}

.workspace-legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card,
.checkout-summary,
.checkout-form-wrap,
.not-found-wrap,
.success-wrap,
.empty-notice {
  position: relative;
  border-radius: 28px;
  border: 1px solid rgba(37, 88, 216, 0.12);
  background: rgba(255,255,255,0.96);
  box-shadow: var(--store-shadow);
}

.checkout-summary,
.checkout-form-wrap,
.success-wrap,
.not-found-wrap {
  padding: 1.6rem;
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.product-summary-row,
.price-total-row,
.order-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.product-summary-row {
  margin-bottom: 0.65rem;
}

.product-summary-name {
  font-weight: 800;
}

.product-summary-price,
.price-total,
.order-info-value {
  font-weight: 900;
  color: var(--store-price);
}

.product-summary-desc {
  margin: 0.85rem 0 0;
  color: var(--store-muted);
}

/* HC-2 #311：結帳摘要商品圖 + placeholder + 點數/workspace 摘要 */
.summary-product {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.75rem;
}

.summary-product-img {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: contain;
  background: rgba(241, 245, 249, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 4px;
  box-sizing: border-box;
}

.summary-product-img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0e7ff 0%, #f1f5f9 100%);
}

.summary-product-img-initial {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--store-price);
  line-height: 1;
}

.summary-product-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.summary-product-meta .product-summary-name {
  /* 長名稱不破版：允許換行、截斷 */
  overflow-wrap: anywhere;
  word-break: break-word;
}

.summary-product-meta .product-summary-price {
  font-weight: 900;
  color: var(--store-price);
}

.summary-credits {
  margin: 0.5rem 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.summary-credit-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.92rem;
  padding: 0.15rem 0;
}

.summary-credit-row dt {
  color: var(--store-muted);
  font-weight: 600;
  margin: 0;
}

.summary-credit-row dd {
  margin: 0;
  font-weight: 700;
  color: var(--store-text);
}

.summary-credit-total {
  margin-top: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
}

.summary-credit-total dt,
.summary-credit-total dd {
  color: var(--store-price);
  font-weight: 900;
}

.summary-workspace {
  margin: 0.6rem 0 0;
  font-size: 0.92rem;
  color: var(--store-muted);
}

.summary-workspace strong {
  color: var(--store-text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.price-total-row {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
  font-size: 0.98rem;
}

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

.form-hint {
  margin: 0 0 1rem;
  color: var(--store-muted);
  font-size: 0.95rem;
}

.form-group {
  display: grid;
  gap: 0.45rem;
}

.form-group label {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--store-text);
}

.required {
  color: #dc2626;
}

.form-group input[type="text"],
.form-group input[type="email"] {
  width: 100%;
  min-height: 48px;
  padding: 0.82rem 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.98);
  color: var(--store-text);
  font-size: 0.98rem;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.form-group input::placeholder {
  color: #94a3b8;
}

.form-group input:focus {
  border-color: rgba(37, 88, 216, 0.62);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 88, 216, 0.12);
}

.payment-method .payment-option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(37, 88, 216, 0.16);
  background: linear-gradient(135deg, rgba(37, 88, 216, 0.08), rgba(245, 158, 11, 0.06));
  font-weight: 800;
  color: var(--store-text);
}

.payment-option-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  flex-wrap: wrap;
}

.payment-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 108px;
  width: 108px;
  height: 38px;
}

.payment-brand img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.payment-brand-paypal {
  justify-content: flex-start;
  gap: 0.35rem;
  color: #003087;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.payment-brand-paypal img {
  width: 30px;
  height: 30px;
}

.payment-brand-ecpay img {
  width: 108px;
  height: auto;
}

.payment-brand-linepay img {
  width: 108px;
  height: 108px;
  max-width: none;
  max-height: none;
  transform: translateY(-35px);
}

.payment-brand-linepay {
  overflow: hidden;
}

.payment-name {
  font-weight: 800;
}

/* ── HC-3 #312：provider 選項 a11y / fieldset / 視覺回歸 ───────────────────────
   - fieldset 預設邊框/padding 歸零（payment-method 與 workspace-fieldset 共用）
   - radio focus-visible 顯式可見焦點環（鍵盤可近用，不只靠滑鼠）
   - 選中狀態以容器邊框/底色強化（狀態可見，不只靠 radio 圓點）
   - .sr-only：視覺隱藏但螢幕閱讀器可讀（provider fieldset legend 用） */

/* 視覺隱藏（screen-reader only）—— 共用 utility，勿與 display:none 混用 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* fieldset 重置：移除瀏覽器預設邊框/min-width，讓 .form-group 樣式接管 */
form .payment-method,
form .workspace-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
  min-width: 0;
}

/* provider / workspace 選項卡片化：點擊區夠大（min-height 44px 已在 base），
   這裡補 padding + 邊框 + 選中態，讓「目前選哪個」一目了然（狀態可見） */
.payment-method .payment-option-label,
.workspace-fieldset .workspace-option {
  padding: 0.7rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(37, 88, 216, 0.16);
  background: rgba(255, 255, 255, 0.7);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
  margin-top: 0.5rem;
}

.payment-method .payment-option-label:first-of-type,
.workspace-fieldset .workspace-option:first-of-type {
  margin-top: 0.25rem;
}

/* 選中態：邊框加重 + 底色微染（:has 現代瀏覽器支援；不支援者退回原樣不壞） */
.payment-option-label:has(input[type="radio"]:checked) {
  border-color: rgba(37, 88, 216, 0.55);
  background: rgba(37, 88, 216, 0.06);
  box-shadow: 0 0 0 3px rgba(37, 88, 216, 0.08);
}

/* radio 本身縮小並用 accent-color 對齊品牌色；游標指向 */
.payment-option-label input[type="radio"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: var(--store-primary);
  cursor: pointer;
}

/* 鍵盤焦點顯式可見（:focus-visible 僅鍵盤觸發，滑鼠點擊不干擾） */
.payment-option-label input[type="radio"]:focus-visible {
  outline: 2px solid var(--store-primary, #2558d8);
  outline-offset: 2px;
}

/* 點擊 label 內任意處皆可聚焦對應 radio（label 可近用） */
.payment-option-label:has(input[type="radio"]:focus-visible) {
  border-color: rgba(37, 88, 216, 0.62);
  box-shadow: 0 0 0 4px rgba(37, 88, 216, 0.12);
}

.consent-group {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: rgba(255, 251, 235, 0.75);
}

.consent-label {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.consent-label input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  accent-color: var(--store-primary);
  flex: 0 0 auto;
}

.consent-text {
  color: var(--store-text);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* 信任標章：SSL 提示 + 付款方式徽章 */
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  background: var(--store-soft);
  border: 1px solid var(--store-border);
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--store-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.trust-payment-icons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--store-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.checkout-form .btn-checkout {
  width: 100%;
  margin-top: 0.25rem;
}

/* Hosted Checkout 的安全離開入口：視覺層級低於 primary 付款動作。 */
.checkout-return-link {
  width: 100%;
  margin-top: 0.75rem;
  background: transparent;
  box-shadow: none;
}

.checkout-return-link:focus-visible {
  outline: 3px solid rgba(37, 88, 216, 0.45);
  outline-offset: 3px;
}

/* 送出 loading 狀態（防連點）*/
.btn-checkout.is-loading {
  cursor: wait;
  opacity: 0.85;
}

.btn-checkout.is-loading .btn-checkout-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-checkout.is-loading .btn-checkout-label::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

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

.checkout-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-top: 0.15rem;
  color: var(--store-primary-strong);
  text-decoration: none;
  font-weight: 800;
}

.checkout-back-link:hover {
  text-decoration: underline;
}

.not-found-wrap,
.success-wrap,
.empty-notice {
  text-align: center;
}

.not-found-wrap {
  padding: 2rem 1.5rem;
}

.not-found-wrap h2,
.success-title {
  margin: 0 0 0.55rem;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.not-found-wrap p,
.success-subtitle,
.empty-notice p {
  color: var(--store-muted);
}

.success-icon {
  display: inline-grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 0.9rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(37, 88, 216, 0.12));
  color: #15803d;
  font-size: 2rem;
  font-weight: 900;
}

.success-subtitle {
  margin: 0 auto 1.25rem;
  max-width: 520px;
}

.success-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.success-contact {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--store-muted);
}

.success-contact a {
  font-weight: 800;
}

.order-info {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.92));
  border: 1px solid rgba(37, 88, 216, 0.12);
}

.order-info-row {
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

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

.order-info-label {
  color: var(--store-muted);
  font-size: 0.92rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(37, 88, 216, 0.08);
  color: var(--store-primary-strong);
  font-size: 0.85rem;
}

/* ── Policy Pages ─────────────────────────────── */
.policy-page {
  max-width: 860px;
  padding-top: 1.4rem;
  padding-bottom: 3rem;
}

.policy-page h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.1;
}

.policy-page .updated {
  margin: 0 0 1.5rem;
  color: var(--store-muted);
  font-size: 0.88rem;
}

.policy-page h2 {
  margin: 1.8rem 0 0.8rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 1.1rem;
  line-height: 1.3;
}

.policy-page p,
.policy-page li {
  color: var(--store-text);
  line-height: 1.85;
}

.policy-page ul,
.policy-page ol {
  padding-left: 1.35rem;
}

.policy-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--store-shadow-soft);
}

.policy-page th,
.policy-page td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  vertical-align: top;
}

.policy-page th {
  background: rgba(37, 88, 216, 0.06);
  font-weight: 900;
}

.legal-notice {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(37, 88, 216, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #8a4b00;
}

/* ── Empty / Alert ───────────────────────────── */
.empty-notice {
  padding: 2.2rem 1rem;
}

.alert {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  margin: 0 0 1rem;
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(254, 226, 226, 0.9);
  border-color: rgba(248, 113, 113, 0.35);
  color: #991b1b;
}

.alert-info {
  background: rgba(239, 246, 255, 0.96);
  border-color: rgba(96, 165, 250, 0.36);
  color: #1d4ed8;
}

/* ── Footer ───────────────────────────────────── */
.store-footer {
  margin-top: 3rem;
  padding: 2.4rem 1.5rem;
  background: linear-gradient(180deg, #111b31 0%, var(--store-footer-bg) 100%);
  color: var(--store-footer-text);
}

.store-footer .footer-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  text-align: center;
}

.store-footer .company-info {
  margin-bottom: 1rem;
  line-height: 1.9;
  font-size: 0.88rem;
}

.store-footer .policy-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.store-footer .policy-links a {
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  text-decoration: none;
  color: #c8d6f2;
  font-size: 0.84rem;
  background: rgba(255,255,255,0.04);
  transition: background-color 160ms ease, color 160ms ease;
}

.store-footer .policy-links a:hover {
  background: rgba(255,255,255,0.10);
  color: #fff;
}

.store-footer .copyright {
  font-size: 0.8rem;
  opacity: 0.72;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 960px) {
  .product-card {
    grid-column: span 6;
  }

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

/* 手機：三步提示精簡（隱藏狀態文字，保留數字+名稱，避免擠行） */
@media (max-width: 768px) {
  .checkout-steps-list {
    padding: 0.65rem 0.5rem;
  }

  .checkout-step {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.35rem;
    text-align: center;
    font-size: 0.78rem;
  }

  .checkout-step:not(:last-child)::after {
    width: 0.5rem;
    right: -0.25rem;
  }

  .checkout-step-marker {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    font-size: 0.78rem;
  }

  .checkout-step-state {
    display: none;
  }

  .checkout-step-name {
    font-size: 0.74rem;
  }
}
@media (min-width: 641px) and (max-width: 1100px) {
  .store-nav {
    padding: 0 1rem;
    min-height: 68px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--store-text);
    background: rgba(37, 88, 216, 0.08);
    border: 1px solid var(--store-border);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 160ms ease;
  }

  .nav-toggle:hover {
    background: rgba(37, 88, 216, 0.16);
  }

  .nav-toggle-active {
    background: var(--store-primary);
    color: #fff;
    border-color: var(--store-primary);
  }

  .store-nav .nav-links {
    position: absolute;
    top: 100%;
    right: 0.6rem;
    left: 0.6rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0 0.75rem;
    background: var(--store-surface-strong);
    border: 1px solid var(--store-border);
    border-radius: 16px;
    box-shadow: var(--store-shadow);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 220ms ease, opacity 180ms ease, padding 220ms ease;
  }

  .store-nav .nav-links.nav-open {
    max-height: 420px;
    opacity: 1;
    pointer-events: auto;
    padding: 0.75rem;
  }

  .store-nav .nav-links a {
    display: block;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    font-size: 0.95rem;
  }
}

@media (max-width: 640px) {
  .store-nav {
    padding: 0 1rem;
    min-height: 68px;
  }

  /* 漢堡按鈕：640px 以下顯示 */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--store-text);
    background: rgba(37, 88, 216, 0.08);
    border: 1px solid var(--store-border);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 160ms ease;
  }

  .nav-toggle:hover {
    background: rgba(37, 88, 216, 0.16);
  }

  .nav-toggle-active {
    background: var(--store-primary);
    color: #fff;
    border-color: var(--store-primary);
  }

  /* 導覽面板：改為下拉 overlay（不再 display:none） */
  .store-nav .nav-links {
    position: absolute;
    top: 100%;
    right: 0.6rem;
    left: 0.6rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--store-surface-strong);
    border: 1px solid var(--store-border);
    border-radius: 16px;
    box-shadow: var(--store-shadow);
    /* 預設收合：無高度、不可互動 */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 220ms ease, opacity 180ms ease, padding 220ms ease;
    padding-top: 0;
    padding-bottom: 0;
  }

  /* 展開狀態 */
  .store-nav .nav-links.nav-open {
    max-height: 420px;
    opacity: 1;
    pointer-events: auto;
    padding: 0.75rem;
  }

  .store-nav .nav-links a {
    display: block;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    font-size: 0.95rem;
  }

  .store-hero,
  .checkout-summary,
  .checkout-form-wrap,
  .detail-card,
  .policy-page,
  .success-wrap,
  .not-found-wrap,
  .empty-notice,
  .product-card {
    border-radius: 20px;
  }

  .store-hero {
    padding: 1.75rem 1.2rem;
  }

  .store-main,
  .store-featured,
  .product-detail,
  .policy-page {
    width: min(100%, calc(100% - 1rem));
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-column: auto;
    min-height: auto;
  }

  .section-header {
    align-items: start;
  }

  .store-footer {
    padding: 2rem 1rem;
  }
}

/* ── My Orders ─────────────────────────────── */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.order-card {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: var(--store-surface-strong);
  border: 1px solid var(--store-border);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.order-id {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--store-muted);
}

.order-card-body {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

.order-amount {
  font-weight: 700;
  color: var(--store-price);
}

.order-provider {
  color: var(--store-muted);
  font-size: 0.82rem;
}

.order-card-footer {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--store-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.order-retry-payment {
  width: auto;
  min-height: 40px;
  padding: 0.55rem 1rem;
}

/* ── PChome 商品圖 / 分類 tab / 規格表 ── */
.product-card .product-image {
  display: block;
  width: calc(100% + 2.8rem);
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: #fff;
  border-radius: 18px 18px 0 0;
  margin: -1.4rem -1.4rem 1rem;
  padding: 0;
}
.product-card .product-image-fallback {
  width: calc(100% + 2.8rem);
  aspect-ratio: 3/2;
  border-radius: 14px 14px 0 0;
  background: var(--store-soft);
  display:flex; align-items:center; justify-content:center;
  margin: -1.4rem -1.4rem 0.9rem;
  color: var(--store-muted); font-size: 2.4rem;
}
.product-card { grid-column: span 3; min-height: auto; }
@media (max-width: 960px) { .product-card { grid-column: span 6; } }
.product-card h3 {
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden; min-height: 2.8em;
}
.product-card .desc { -webkit-line-clamp:1; min-height:auto; }

.category-tabs {
  display:flex; gap:0.4rem; flex-wrap:wrap;
  margin: 0 0 1.1rem; padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--store-border);
}
.category-tab {
  padding: 0.5rem 1rem; border-radius: 999px;
  border: 1px solid var(--store-border);
  background: #fff; color: var(--store-text);
  font-size: 0.9rem; font-weight: 700; cursor: pointer;
  transition: all 160ms ease;
}
.category-tab.active {
  background: var(--store-primary); color:#fff; border-color: var(--store-primary);
}
.category-tab:hover:not(.active) { background: var(--store-soft); }
.group-section { display:block; }
.group-section.hidden { display:none; }

.detail-layout {
  display:grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr);
  gap: 1.6rem; align-items: start;
}
@media (max-width: 960px) { .detail-layout { grid-template-columns: 1fr; } }
.detail-image-wrap img,
.detail-image-wrap .fallback {
  width:100%; aspect-ratio:1/1; object-fit:contain;
  background:#fff; border-radius:20px; border:1px solid var(--store-border);
  padding: 1rem;
}
.spec-table { width:100%; border-collapse:collapse; margin:1rem 0; }
.spec-table th, .spec-table td {
  padding: 0.7rem 0.9rem; border-bottom:1px solid var(--store-border);
  text-align:left; font-size:0.92rem;
}
.spec-table th { width: 32%; color: var(--store-muted); font-weight:700; background: var(--store-soft); }
.detail-buy-box { position:sticky; top: 90px; }

/* ── Product image fallback（漸層底 + 商品首字）── */
.product-card .product-image-fallback {
  background: linear-gradient(135deg, var(--store-primary) 0%, var(--store-primary-strong) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
}
.product-card .product-image-fallback .fallback-text,
.detail-image-wrap .fallback .fallback-text {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ── 2026 consumer storefront refresh ───────── */
.store-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.account-actions {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin-left: .25rem;
  padding-left: .5rem;
  border-left: 1px solid var(--store-border);
}

.store-header .store-nav {
  position: relative;
  width: min(1240px, 100%);
  margin: 0 auto;
  box-shadow: none;
}

.store-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--store-border);
  backdrop-filter: blur(18px);
}

.store-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
  min-height: 430px;
  margin-top: 1.5rem;
  padding: clamp(2rem, 6vw, 4.5rem);
  background:
    radial-gradient(circle at 88% 18%, rgba(105, 154, 255, .35), transparent 25%),
    linear-gradient(132deg, #071c3a 0%, #0a2d58 58%, #164e94 100%);
}

.hero-copy,
.hero-assurance {
  position: relative;
  z-index: 1;
}

.hero-eyebrow,
.detail-eyebrow {
  margin: 0 0 .75rem;
  color: #8bb0ff;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .18em;
}

.store-hero h1 {
  max-width: 720px;
  font-size: clamp(2.5rem, 6vw, 4.8rem);
}

.store-hero p:not(.hero-eyebrow) {
  max-width: 620px;
  font-size: 1.05rem;
}

.hero-action {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-top: 1.75rem;
  padding: .8rem 1.15rem;
  border-radius: 12px;
  color: #08254a;
  background: #fff;
  font-weight: 900;
  text-decoration: none;
}

.hero-assurance {
  display: grid;
  gap: .75rem;
}

.hero-assurance div {
  display: grid;
  gap: .08rem;
  padding: .9rem 1rem;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 14px;
  background: rgba(255,255,255,.07);
}

.hero-assurance strong { color: #fff; }
.hero-assurance span { color: rgba(255,255,255,.68); font-size: .82rem; }

.store-main { padding-top: 2rem; }

.category-tabs {
  position: sticky;
  top: 73px;
  z-index: 20;
  padding: .75rem;
  border: 1px solid var(--store-border);
  border-radius: 16px;
  background: rgba(246,249,255,.94);
  backdrop-filter: blur(12px);
}

.product-card {
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .07);
}

.product-checkout-link {
  display: inline-flex;
  justify-content: center;
  gap: .35rem;
  margin-top: .7rem;
  color: var(--store-primary-strong);
  font-size: .86rem;
  font-weight: 800;
  text-decoration: none;
}

.detail-eyebrow { color: var(--store-primary); }

.footer-brand {
  display: inline-grid;
  justify-items: center;
  gap: .35rem;
  margin-bottom: 1.2rem;
  text-align: left;
}

.footer-brand .store-brand-endorsement {
  color: var(--store-footer-text);
}

.footer-brand-primary { display: grid; }
.footer-brand strong { color: #fff; }
.footer-brand span { font-size: .66rem; letter-spacing: .14em; }

@media (max-width: 780px) {
  .store-brand { gap: .4rem; }
  .store-brand-primary strong { font-size: 1.02rem; }
  .store-nav .brand-sub { font-size: .56rem; letter-spacing: .11em; }
  .store-nav .store-brand-endorsement { font-size: .56rem; }
  .store-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-assurance {
    grid-template-columns: 1fr;
  }

  .category-tabs { top: 68px; }

  .account-actions {
    display: grid;
    margin-left: 0;
    padding: .25rem 0 0;
    border-top: 1px solid var(--store-border);
    border-left: 0;
  }
}

@media (max-width: 430px) {
  .store-nav .brand-sub { display: none; }
  .footer-brand { text-align: center; }
}

/* HC-3 #312：極小螢幕（≤360px，含 320px）provider/workspace 選項不溢出、不重疊。
   品牌圖縮放、選項垂直堆疊、名稱可折行。 */
@media (max-width: 360px) {
  .payment-method .payment-option-label,
  .workspace-fieldset .workspace-option {
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.6rem 0.7rem;
  }
  .payment-brand {
    flex: 0 0 88px;
    width: 88px;
    height: 30px;
  }
  .payment-brand-paypal img {
    width: 24px;
    height: 24px;
  }
  .payment-brand-ecpay img {
    width: 84px;
  }
  .payment-name {
    font-size: 0.92rem;
    word-break: break-word;
  }
}
.detail-image-wrap .fallback {
  background: linear-gradient(135deg, var(--store-primary) 0%, var(--store-primary-strong) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-image-wrap .fallback .fallback-text {
  font-size: 4rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
}

/* ── Merchant application ─────────────────── */
.merchant-page {
  width: min(920px, calc(100% - 2rem));
  margin: 2rem auto 4rem;
}

.merchant-heading {
  margin-bottom: 1.4rem;
}

.merchant-heading .eyebrow {
  margin: 0 0 0.35rem;
  color: var(--store-primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.merchant-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.08;
}

.merchant-heading > p:last-child {
  margin: 0.7rem 0 0;
  color: var(--store-muted);
}

.merchant-card {
  padding: clamp(1.2rem, 4vw, 2.2rem);
  border: 1px solid var(--store-border);
  border-radius: var(--store-radius);
  background: var(--store-surface-strong);
  box-shadow: var(--store-shadow-soft);
}

.merchant-account-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.6rem;
  padding: 1rem;
  border-radius: 16px;
  background: var(--store-soft);
}

.merchant-account-summary div,
.merchant-details div {
  min-width: 0;
}

.merchant-account-summary span,
.merchant-label,
.merchant-details dt {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--store-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.merchant-account-summary strong {
  overflow-wrap: anywhere;
}

.merchant-form {
  display: grid;
  gap: 0.65rem;
}

.merchant-form > label,
.merchant-form legend {
  margin-top: 0.55rem;
  font-weight: 800;
}

.merchant-form input[type="text"],
.merchant-form input[type="url"] {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--store-border);
  border-radius: 12px;
  background: #fff;
  color: var(--store-text);
  font: inherit;
}

.merchant-form input:focus {
  outline: 3px solid rgba(37, 88, 216, 0.15);
  border-color: var(--store-primary);
}

.merchant-form small {
  color: var(--store-muted);
}

.merchant-form fieldset {
  display: flex;
  gap: 1rem;
  margin: 0.8rem 0 0;
  padding: 0;
  border: 0;
}

.merchant-form legend {
  width: 100%;
  margin-bottom: 0.45rem;
}

.merchant-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--store-border);
  border-radius: 12px;
}

.merchant-check input {
  width: 20px;
  height: 20px;
}

.merchant-submit,
.merchant-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.15rem;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
}

.merchant-submit {
  margin-top: 0.8rem;
  border: 0;
  background: var(--store-primary);
  color: #fff;
  cursor: pointer;
}

.merchant-submit:hover {
  background: var(--store-primary-strong);
}

.merchant-secondary {
  border: 1px solid var(--store-border-strong);
  background: #fff;
  color: var(--store-primary);
}

.merchant-alert,
.merchant-boundary-note,
.merchant-review-note {
  display: grid;
  gap: 0.2rem;
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--store-border);
  border-radius: 14px;
  background: rgba(37, 88, 216, 0.06);
}

.merchant-alert-error {
  border-color: rgba(220, 38, 38, 0.24);
  background: rgba(254, 226, 226, 0.8);
  color: #991b1b;
}

.merchant-alert-success,
.merchant-approved-note {
  border-color: rgba(22, 163, 74, 0.24);
  background: rgba(220, 252, 231, 0.8);
  color: #166534;
}

.merchant-boundary-note {
  margin-top: 0.8rem;
}

.merchant-boundary-note p,
.merchant-review-note p,
.merchant-locked p {
  margin: 0;
}

.merchant-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--store-border);
}

.merchant-status-row h2 {
  margin: 0;
}

.merchant-status {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--store-soft);
  color: var(--store-primary-strong);
  font-size: 0.85rem;
  font-weight: 800;
  white-space: nowrap;
}

.merchant-status-approved {
  background: #dcfce7;
  color: #166534;
}

.merchant-status-rejected,
.merchant-status-withdrawn {
  background: #fee2e2;
  color: #991b1b;
}

.merchant-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.4rem 0;
}

.merchant-details dd {
  margin: 0;
  font-weight: 700;
}

.merchant-break {
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .merchant-account-summary,
  .merchant-details {
    grid-template-columns: 1fr;
  }

  .merchant-form fieldset,
  .merchant-status-row {
    align-items: stretch;
    flex-direction: column;
  }
}
