/* ShopPage TW — 共用設計系統樣式 (Aligned with .stitch/DESIGN.md) */

:root {
  --bg-canvas: #FAF8F5;
  --bg-card: #FFFFFF;
  --border-hairline: #E8E2D9;
  --text-primary: #1F1D1A;
  --text-secondary: #6B655E;

  --status-open-text: #15803D;
  --status-open-bg: #DCFCE7;
  --status-closed-text: #B91C1C;
  --status-closed-bg: #FEE2E2;
  --line-green: #06C755;

  /* 預設品牌主題（烘焙咖啡棕） */
  --accent: #8C4A27;
  --accent-soft: #FDF4EE;
  --accent-gradient-end: #F5E1D2;

  --shadow-card: 0 4px 20px rgba(31, 29, 26, 0.05);
  --shadow-soft: 0 2px 10px rgba(31, 29, 26, 0.03);
  --radius-card: 18px;
  --radius-hero: 24px;
  --radius-btn: 12px;
  --ease-tactile: cubic-bezier(0.22, 1, 0.36, 1);
}

/* 7 大台灣業種 CSS Variables */
[data-theme="cafe"] {
  --accent: #8C4A27;
  --accent-soft: #FDF4EE;
  --accent-gradient-end: #F5E1D2;
}
[data-theme="restaurant"] {
  --accent: #C2410C;
  --accent-soft: #FFF7ED;
  --accent-gradient-end: #FDE2C8;
}
[data-theme="beauty"] {
  --accent: #4D7C6F;
  --accent-soft: #EFF6F3;
  --accent-gradient-end: #D6EBE3;
}
[data-theme="home_service"] {
  --accent: #1D4ED8;
  --accent-soft: #EFF6FF;
  --accent-gradient-end: #D6E6FF;
}
[data-theme="classes"] {
  --accent: #4338CA;
  --accent-soft: #EEF2FF;
  --accent-gradient-end: #DCE0FF;
}
[data-theme="fitness"] {
  --accent: #0F766E;
  --accent-soft: #F0FDFA;
  --accent-gradient-end: #CCFBF1;
}
[data-theme="shop"] {
  --accent: #B45309;
  --accent-soft: #FFFBEB;
  --accent-gradient-end: #FDECC8;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.font-mono-tw {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* 通用按鈕微互動 */
.btn-tactile {
  min-height: 44px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms var(--ease-tactile), background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.btn-tactile:active {
  transform: translateY(1px);
}

.btn-tactile:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--accent);
  color: #FFFFFF;
  border: 1px solid var(--accent);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.92;
}

.btn-secondary {
  background-color: #FFFFFF;
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-line {
  background-color: var(--line-green);
  color: #FFFFFF;
  border: 1px solid var(--line-green);
}

/* 卡片 */
.surface-card {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

/* 狀態徽章 */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-badge.is-open {
  background: var(--status-open-bg);
  color: var(--status-open-text);
}

.status-badge.is-closed {
  background: var(--status-closed-bg);
  color: var(--status-closed-text);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.status-badge.is-open .status-dot {
  animation: liveStatusPulse 2s ease-in-out infinite;
}

@keyframes liveStatusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

/* 表單輸入元件 */
.tw-input,
.tw-textarea,
.tw-select {
  width: 100%;
  min-height: 44px;
  background: #FFFFFF;
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  padding: 10px 13px;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.tw-textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.6;
}

.tw-input:focus,
.tw-textarea:focus,
.tw-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

/* 即時手機預覽外框（建站頁 & 首頁 Hero 使用） */
.phone-frame {
  width: 100%;
  max-width: 392px;
  margin: 0 auto;
  background: #1F1D1A;
  border-radius: 40px;
  padding: 11px;
  box-shadow: 0 24px 60px rgba(31, 29, 26, 0.16), 0 4px 14px rgba(31, 29, 26, 0.08);
}

.phone-notch {
  width: 108px;
  height: 22px;
  background: #1F1D1A;
  border-radius: 0 0 14px 14px;
  margin: 0 auto -12px;
  position: relative;
  z-index: 10;
}

.phone-screen {
  background: var(--bg-canvas);
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 690px;
}

.phone-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 20px 14px 86px;
  scrollbar-width: thin;
  scrollbar-color: #D6CEC3 transparent;
}

.phone-bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-hairline);
  padding: 9px 12px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 6px;
}

/* 骨架屏微光 */
.skeleton {
  background: linear-gradient(90deg, #EFEAE2 25%, #F7F4EF 50%, #EFEAE2 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 10px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast 通知 */
.tw-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(16px);
  background: #1F1D1A;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(31, 29, 26, 0.22);
  opacity: 0;
  pointer-events: none;
  z-index: 120;
  transition: opacity 200ms ease, transform 200ms var(--ease-tactile);
}

.tw-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 手機底部安全區工具類別 */
.safe-bottom-pad {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}
