/* ============================================
   XXPay - 三方支付前端樣式 v2
   品牌色暫定，CSS Variables 一改全站換
   ============================================ */

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

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-darker: #1E40AF;
  --primary-light: #DBEAFE;
  --primary-50: #EFF6FF;
  --accent: #10B981;
  --accent-dark: #059669;
  --accent-light: #D1FAE5;
  --orange: #F59E0B;
  --orange-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --purple: #8B5CF6;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  --white: #FFFFFF;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-800);
  background: linear-gradient(135deg, #f0f4ff 0%, #fafbff 50%, #f0fdf4 100%);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* Container */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   Header
   ============================================ */
.header {
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
}
.header-brand:hover { color: var(--white); opacity: 0.9; }

.header-brand .logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: none;
  background: rgba(255,255,255,0.1);
  cursor: pointer;
  color: var(--gray-300);
  font-size: 1.25rem;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}

.btn-icon:hover {
  background: rgba(255,255,255,0.2);
  color: var(--white);
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: var(--white);
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--gray-900);
}

/* ============================================
   Hero Banner (首頁)
   ============================================ */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 50%, #8B5CF6 100%);
  padding: 40px 0 50px;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-banner::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 1;
  color: var(--white);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.2);
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.hero-desc {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 500px;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 24px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.hero-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
}

.hero-stat-label {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ============================================
   Shop Description
   ============================================ */
.shop-description {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}

.shop-description h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-description h2::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, var(--primary), var(--purple));
  border-radius: 2px;
}

.shop-description p {
  color: var(--gray-500);
  font-size: 0.9rem;
}

/* ============================================
   Section Header
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header h2 .icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.section-header h2 .icon-circle.blue {
  background: var(--primary-light);
  color: var(--primary);
}

.section-header h2 .icon-circle.green {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.section-header .count-badge {
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* ============================================
   Product Grid
   ============================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  transition: var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary-light);
}

.product-img {
  position: relative;
  width: 100%;
  padding-top: 80%;
  background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
  overflow: hidden;
}

.product-img img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.product-card:hover .product-img img {
  transform: scale(1.08);
}

.product-img .product-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, var(--danger), #DC2626);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(239,68,68,0.3);
}

.product-info {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--gray-800);
}

.product-spec {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-spec::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--gray-300);
  border-radius: 50%;
}

.product-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.product-price .currency {
  font-size: 0.85rem;
  font-weight: 600;
}

.product-price .old-price {
  font-size: 0.8rem;
  color: var(--gray-400);
  text-decoration: line-through;
  margin-left: 8px;
  font-weight: 400;
}

.product-stock {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-stock .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.product-stock .dot.low {
  background: var(--danger);
}

.product-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.4;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #4F46E5 100%);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #4338CA 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #059669 100%);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.btn-accent:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--white);
  color: var(--primary);
  border-color: var(--gray-200);
}
.btn-outline:hover {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.3);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
  color: var(--white);
}

.btn-sm { padding: 8px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================
   Step Progress Bar
   ============================================ */
.step-progress-wrapper {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}

.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  border: 2px solid var(--gray-200);
  color: var(--gray-400);
  background: var(--white);
  transition: var(--transition);
}

.step-name {
  font-size: 0.85rem;
  color: var(--gray-400);
  font-weight: 500;
  white-space: nowrap;
}

.step-line {
  width: 60px;
  height: 3px;
  background: var(--gray-200);
  margin: 0 12px;
  border-radius: 2px;
  transition: var(--transition);
}

.step-item.done .step-num {
  background: linear-gradient(135deg, var(--accent), #059669);
  border-color: var(--accent);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}
.step-item.done .step-name { color: var(--accent-dark); font-weight: 600; }
.step-line.done { background: linear-gradient(90deg, var(--accent), var(--primary)); }

.step-item.active .step-num {
  background: linear-gradient(135deg, var(--primary), #4F46E5);
  border-color: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.step-item.active .step-name { color: var(--primary); font-weight: 700; }

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--gray-100);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-100);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-50);
}

.card-header .icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-body {
  padding: 24px;
}

/* ============================================
   Forms
   ============================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.form-label .required {
  color: var(--danger);
  font-size: 0.7rem;
  margin-left: 4px;
  font-weight: 700;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder { color: var(--gray-400); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 6px;
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 6px;
  font-weight: 600;
  display: none;
}

.form-error.show {
  display: block;
}

.form-control.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-control.valid {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* ============================================
   Trust Bar
   ============================================ */
.trust-bar {
  text-align: center;
  padding: 20px 0 36px;
}

.trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
}

.trust-badge svg {
  color: var(--accent);
}

/* ============================================
   Payment Method Selection
   ============================================ */
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
}

.payment-option:hover {
  border-color: var(--primary-light);
  background: var(--primary-50);
}

.payment-option.selected {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.payment-option input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

.payment-option-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.payment-option-icon.bank-icon {
  background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
  color: var(--primary);
}
.payment-option-icon.card-icon {
  background: linear-gradient(135deg, #E0E7FF, #C7D2FE);
  color: #4F46E5;
}
.payment-option-icon.cvs-icon {
  background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
  color: var(--accent-dark);
}

.payment-option-info { flex: 1; }
.payment-option-name { font-weight: 700; font-size: 0.95rem; }
.payment-option-desc { font-size: 0.8rem; color: var(--gray-500); margin-top: 2px; }

.payment-detail {
  display: none;
  padding: 20px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  margin-top: 16px;
  border: 1px solid var(--gray-200);
}
.payment-detail.active { display: block; }

.bank-info { display: grid; gap: 4px; }

.bank-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--white);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.bank-info-label { font-size: 0.85rem; color: var(--gray-500); }
.bank-info-value { font-weight: 700; font-size: 0.95rem; }

/* ============================================
   Order Table
   ============================================ */
.order-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.order-table thead {
  background: var(--gray-50);
}

.order-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--gray-200);
}

.order-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.order-table .product-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--gray-100);
}

.order-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  padding-top: 20px;
  border-top: 2px solid var(--gray-200);
}

.order-summary-row {
  display: flex;
  gap: 32px;
  font-size: 0.9rem;
}

.order-summary-row .label {
  color: var(--gray-500);
  min-width: 60px;
  text-align: right;
}

.order-summary-row .value {
  font-weight: 700;
  min-width: 120px;
  text-align: right;
}

.order-summary-row.total {
  font-size: 1.1rem;
  padding-top: 10px;
  border-top: 1px solid var(--gray-200);
}

.order-summary-row.total .value {
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 800;
}

/* ============================================
   Cart Dropdown
   ============================================ */
.cart-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 340px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-100);
  z-index: 1001;
  display: none;
  overflow: hidden;
}

.cart-dropdown.open { display: block; }

.cart-dropdown-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--gray-50);
}

.cart-dropdown-body {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px 0;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  transition: var(--transition);
}

.cart-item:hover { background: var(--gray-50); }

.cart-item-img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--gray-100);
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-price { font-size: 0.85rem; color: var(--primary); font-weight: 700; }
.cart-item-qty { font-size: 0.75rem; color: var(--gray-400); }

.cart-item-remove {
  background: none;
  border: none;
  color: var(--gray-300);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.cart-item-remove:hover { color: var(--danger); background: var(--danger-light); }

.cart-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.85rem;
}

.cart-dropdown-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--gray-50);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1rem;
}

/* ============================================
   Search Bar
   ============================================ */
.search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
}
.search-overlay.open { display: block; }

.search-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--white);
  padding: 14px 20px;
  z-index: 1100;
  display: none;
  box-shadow: var(--shadow-lg);
}
.search-bar.open {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-bar input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
}
.search-bar input:focus { outline: none; border-color: var(--primary); }

/* ============================================
   Floating Customer Service
   ============================================ */
.floating-cs {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.floating-cs-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  transition: var(--transition-slow);
}
.floating-cs-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.45);
}

.floating-cs-menu {
  display: none;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.floating-cs-menu.open { display: flex; }

.floating-cs-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--white);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-800);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  border: 1px solid var(--gray-100);
}
.floating-cs-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  color: var(--gray-800);
}

.floating-cs-link .cs-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.floating-cs-link .cs-icon.line { background: #06C755; color: var(--white); }
.floating-cs-link .cs-icon.email { background: linear-gradient(135deg, var(--primary), #6366F1); color: var(--white); }

/* ============================================
   Footer
   ============================================ */
.footer {
  margin-top: auto;
  background: linear-gradient(135deg, var(--gray-900) 0%, #0F172A 100%);
  color: var(--gray-400);
  padding: 32px 0 20px;
}

.footer .container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links a { color: var(--gray-400); font-size: 0.85rem; font-weight: 500; }
.footer-links a:hover { color: var(--white); }

.footer-info {
  font-size: 0.8rem;
  line-height: 1.8;
  margin-top: 8px;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 0.9rem;
  font-weight: 700;
  transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.06);
}
.footer-social a:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.footer-security {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.footer-security .lock-icon {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.75rem;
  text-align: center;
  color: var(--gray-500);
}

/* ============================================
   Order Complete Page
   ============================================ */
.complete-box {
  text-align: center;
  padding: 48px 24px;
}

.complete-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #059669);
  color: var(--white);
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
  animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.complete-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.complete-desc {
  color: var(--gray-500);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.order-number {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary-50), var(--primary-light));
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
  border: 1px solid var(--primary-light);
}

/* ============================================
   Notice / Info boxes
   ============================================ */
.notice-box {
  background: var(--orange-light);
  border-left: 4px solid var(--orange);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0;
}

.notice-box.info {
  background: var(--primary-50);
  border-left-color: var(--primary);
}

.notice-box h4 {
  font-size: 0.9rem;
  margin-bottom: 6px;
  font-weight: 700;
}

.notice-box p {
  font-size: 0.8rem;
  color: var(--gray-600);
  line-height: 1.7;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
  0% { transform: scale(0.9) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-box h3 { margin-bottom: 12px; font-weight: 700; font-size: 1.1rem; }
.modal-box p { color: var(--gray-500); margin-bottom: 24px; font-size: 0.9rem; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ============================================
   Responsive - Mobile First (< 768px)
   9成用戶為手機，全面強化觸控體驗
   ============================================ */
@media (max-width: 768px) {
  /* -- 防止 iOS input zoom -- */
  input, select, textarea { font-size: 16px !important; }

  .container { padding: 0 14px; }

  /* -- Header 壓縮 -- */
  .header .container { height: 56px; }
  .header-brand { font-size: 1.1rem; gap: 8px; }
  .header-brand .logo-placeholder,
  .header-brand .logo-img { width: 32px; height: 32px; }
  .header-brand .logo-placeholder { font-size: 0.5rem; border-radius: 8px; }
  .btn-icon { width: 38px; height: 38px; }

  /* -- Hero Banner 精簡 -- */
  .hero-banner { padding: 24px 0 32px; }
  .hero-title { font-size: 1.6rem; }
  .hero-desc { font-size: 0.9rem; }
  .hero-badge { font-size: 0.7rem; padding: 5px 12px; }
  .hero-stats { gap: 24px; margin-top: 20px; }
  .hero-stat-value { font-size: 1.3rem; }
  .hero-stat-label { font-size: 0.7rem; }

  /* -- Shop Description -- */
  .shop-description { padding: 16px; margin-bottom: 16px; }
  .shop-description h2 { font-size: 1rem; }
  .shop-description p { font-size: 0.85rem; }

  /* -- Help Strip 手機版 -- */
  .help-strip {
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
  }
  .help-strip-text { font-size: 0.8rem; text-align: center; }

  /* -- Section Header -- */
  .section-header { margin-bottom: 14px; }
  .section-header h2 { font-size: 1.05rem; }
  .section-header h2 .icon-circle { width: 30px; height: 30px; border-radius: 8px; }

  /* ---- 商品卡片：手機版水平列表式 ---- */
  .product-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .product-card {
    flex-direction: row;
    border-radius: var(--radius-md);
  }

  .product-img {
    width: 120px;
    min-width: 120px;
    padding-top: 0;
    height: 120px;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
  }

  .product-img .product-tag {
    top: 8px;
    left: 8px;
    font-size: 0.6rem;
    padding: 3px 8px;
  }

  .product-info {
    padding: 12px 14px;
    justify-content: center;
  }

  .product-name { font-size: 0.95rem; margin-bottom: 2px; -webkit-line-clamp: 1; }
  .product-spec { font-size: 0.75rem; margin-bottom: 6px; }
  .product-price { font-size: 1.15rem; margin-bottom: 2px; }
  .product-price .currency { font-size: 0.8rem; }
  .product-stock { font-size: 0.7rem; margin-bottom: 8px; }

  .product-actions {
    flex-direction: row;
    gap: 6px;
  }

  .product-actions .btn {
    padding: 8px 12px;
    font-size: 0.75rem;
    min-height: 36px;
    border-radius: var(--radius-full);
  }

  /* -- Buttons 全域觸控強化 -- */
  .btn {
    min-height: 44px;
    font-size: 0.85rem;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
  }

  .btn-lg {
    min-height: 52px;
    font-size: 1rem;
    padding: 14px 24px;
    width: 100%;
    border-radius: var(--radius-md);
  }

  .btn-sm {
    min-height: 38px;
    font-size: 0.8rem;
    padding: 8px 14px;
  }

  /* -- Step Progress 手機版 -- */
  .step-progress-wrapper { padding: 18px 12px; margin-bottom: 16px; }
  .step-progress { padding: 0; }
  .step-line { width: 20px; margin: 0 4px; }
  .step-name { font-size: 0.7rem; }
  .step-num { width: 28px; height: 28px; font-size: 0.7rem; }

  /* -- Cards -- */
  .card { border-radius: var(--radius-md); margin-bottom: 14px; }
  .card-header { padding: 14px 16px; font-size: 0.9rem; }
  .card-header .icon { width: 28px; height: 28px; border-radius: 6px; }
  .card-body { padding: 16px; }

  /* -- Forms 觸控強化 -- */
  .form-group { margin-bottom: 14px; }
  .form-label { font-size: 0.85rem; margin-bottom: 6px; }

  .form-control {
    padding: 14px 16px;
    font-size: 16px !important;
    border-radius: var(--radius-md);
    min-height: 48px;
  }

  textarea.form-control { min-height: 80px; }

  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-hint { font-size: 0.7rem; }
  .form-error { font-size: 0.7rem; }

  /* -- Payment Options 觸控強化 -- */
  .payment-options { gap: 10px; }
  .payment-option {
    padding: 14px 16px;
    gap: 12px;
    border-radius: var(--radius-md);
    min-height: 64px;
  }
  .payment-option-icon { width: 40px; height: 40px; }
  .payment-option-name { font-size: 0.9rem; }
  .payment-option-desc { font-size: 0.75rem; }
  .payment-detail { padding: 14px; margin-top: 12px; }

  /* -- Bank Info 手機版 -- */
  .bank-info-row { padding: 10px 12px; flex-direction: column; align-items: flex-start; gap: 2px; }
  .bank-info-label { font-size: 0.75rem; }
  .bank-info-value { font-size: 0.9rem; }

  /* -- Order Table 手機版卡片式 -- */
  .order-table { border-spacing: 0; }
  .order-table thead { display: none; }
  .order-table tbody { display: flex; flex-direction: column; gap: 10px; }
  .order-table tr {
    display: grid;
    grid-template-columns: 52px 1fr;
    grid-template-rows: auto auto;
    gap: 4px 12px;
    padding: 14px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
  }
  .order-table td { border: none; padding: 0; }
  .order-table td:before { display: none; }

  /* 序號隱藏 */
  .order-table td:first-child { display: none; }
  /* 圖片 */
  .order-table td:nth-child(2) { grid-row: 1 / 3; }
  .order-table .product-thumb { width: 52px; height: 52px; }
  /* 名稱 */
  .order-table td:nth-child(3) { font-weight: 700; font-size: 0.9rem; }
  /* 單價+數量+小計 */
  .order-table td:nth-child(4),
  .order-table td:nth-child(5),
  .order-table td:nth-child(6) { font-size: 0.8rem; color: var(--gray-500); }

  .order-summary { gap: 8px; padding-top: 14px; }
  .order-summary-row { gap: 16px; font-size: 0.85rem; }
  .order-summary-row .value { min-width: 90px; }
  .order-summary-row.total .value { font-size: 1.15rem; }

  /* -- Trust Bar -- */
  .trust-bar { padding: 16px 0 24px; }
  .trust-badges { gap: 12px; }
  .trust-badge { font-size: 0.65rem; }

  /* -- Complete Page -- */
  .complete-box { padding: 32px 16px; }
  .complete-icon { width: 72px; height: 72px; }
  .complete-title { font-size: 1.3rem; }
  .complete-desc { font-size: 0.85rem; }
  .order-number { font-size: 0.85rem; padding: 10px 20px; }

  /* -- Notice Box -- */
  .notice-box { padding: 12px 14px; }
  .notice-box h4 { font-size: 0.85rem; }
  .notice-box p { font-size: 0.75rem; }

  /* -- Cart Dropdown 全螢幕 -- */
  .cart-dropdown {
    width: 100%;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    max-height: 70vh;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-xl);
  }
  .cart-dropdown-body { max-height: 50vh; }

  /* -- Search Bar -- */
  .search-bar { padding: 10px 14px; }
  .search-bar input { min-height: 44px; }

  /* -- Modal -- */
  .modal-box { padding: 28px 20px; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; }

  /* -- Footer -- */
  .footer { padding: 24px 0 16px; }
  .footer-top { flex-direction: column; gap: 16px; }
  .footer-brand { font-size: 1.1rem; }
  .footer-info { font-size: 0.75rem; }
  .footer-links { gap: 16px; }
  .footer-links a { font-size: 0.8rem; }
  .footer-bottom { font-size: 0.7rem; }

  /* -- Floating CS 調整避免擋底部 bar -- */
  .floating-cs { bottom: 80px; right: 16px; }
  .floating-cs-btn { width: 52px; height: 52px; font-size: 1.2rem; }

  /* -- Mobile CS Bar 強化 -- */
  .mobile-cs-bar { display: block; padding: 8px 12px; }
  .mobile-cs-bar a {
    min-height: 44px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
  }

  /* -- Body padding for bottom bar -- */
  body { padding-bottom: 68px; }

  /* -- Header CS link 手機版只顯示 icon -- */
  .header-cs-link span.cs-label { display: none; }
  .header-cs-link { padding: 6px 8px; }
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* ============================================
   Logo Placeholder
   ============================================ */
.header-brand .logo-img {
  height: 36px;
  width: auto;
  border-radius: 8px;
  object-fit: contain;
}

.header-brand .logo-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 0.6rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
  border: 2px dashed rgba(255,255,255,0.4);
  letter-spacing: -0.3px;
}

/* ============================================
   Header CS Link
   ============================================ */
.header-cs-link {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--gray-300);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.08);
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.header-cs-link:hover {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}

/* ============================================
   Inline Help Banner (結帳頁 / 各區塊間)
   ============================================ */
.help-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--gray-100);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.help-strip-text {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.help-strip-text strong {
  color: var(--gray-700);
}

.help-strip-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--primary-50);
  transition: var(--transition);
  white-space: nowrap;
}
.help-strip-link:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.help-strip-link.line {
  color: #06C755;
  background: #E8FBF0;
}
.help-strip-link.line:hover {
  background: #D1FAE5;
}

/* ============================================
   Mobile Bottom CS Bar
   ============================================ */
.mobile-cs-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 10px 16px;
  z-index: 800;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}

.mobile-cs-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}

.mobile-cs-bar a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.mobile-cs-bar .cs-line {
  background: #06C755;
  color: var(--white);
}
.mobile-cs-bar .cs-line:hover { background: #05B04A; }

.mobile-cs-bar .cs-email {
  background: var(--primary);
  color: var(--white);
}
.mobile-cs-bar .cs-email:hover { background: var(--primary-dark); }

@media (max-width: 768px) {
  .mobile-cs-bar { display: block; }
  .floating-cs { bottom: 76px; }
  body { padding-bottom: 64px; }
  .header-cs-link span.cs-label { display: none; }
}
