/* ============================================================
   DLPY 日貨官網 — 前台 Base CSS
   CSS Variables + Reset + Typography + Utility
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Color */
  --c-ink:        #2c1810;
  --c-muted:      #7a6b5e;
  --c-cream:      #fdf8f2;
  --c-cream-mid:  #f5edd6;
  --c-cream-dark: #e3d5c0;
  --c-navy:       #8b1919;
  --c-navy-deep:  #6e1414;
  --c-brick:      #8b1919;
  --c-brick-dark: #6e1414;
  --c-gold:       #c9a96e;
  --c-gold-light: #e8d5a3;
  --c-sage:       #4a7a5e;
  --c-alert:      #c0392b;
  --c-white:      #ffffff;

  /* Typography */
  --font-serif:   'Noto Serif TC', 'Georgia', serif;
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-ui:      'Inter', system-ui, sans-serif;

  /* Spacing */
  --container:    1200px;
  --gutter:       32px;

  /* Transition */
  --t-fast:   150ms ease;
  --t-normal: 250ms ease;
  --t-slow:   400ms ease;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
}

/* ── Color Themes ──────────────────────────────────────────── */
body[data-theme="a"] {
  --c-cream: #F7F4EF; --c-cream-mid: #EDE9E3; --c-cream-dark: #D8D0C8;
  --c-ink: #1e1a17;   --c-muted: #7a6f66;
  --c-navy: #2d2018;  --c-navy-deep: #1a1208;
  --c-brick: #B85E50; --c-brick-dark: #9a4d40;
  --c-gold: #C4A35A;  --c-gold-light: #dcc48a;
}
body[data-theme="b"] {
  --c-cream: #ffffff;  --c-cream-mid: #F0E8D8; --c-cream-dark: #E8D8C8;
  --c-ink: #2C0D0D;    --c-muted: #7A4040;
  --c-navy: #8B1A1A;   --c-navy-deep: #6d1414;
  --c-brick: #8B1A1A;  --c-brick-dark: #6d1414;
  --c-gold: #C9A050;   --c-gold-light: #E0BE80;
}
body[data-theme="c"] {
  --c-cream: #EFF4F2;  --c-cream-mid: #DDE8E4; --c-cream-dark: #C4D8D0;
  --c-ink: #1C2E2A;    --c-muted: #607B74;
  --c-navy: #2C5F52;   --c-navy-deep: #1E4A3E;
  --c-brick: #8B1A1A;  --c-brick-dark: #6d1414;
  --c-gold: #C9A050;   --c-gold-light: #E0BE80;
}
body[data-theme="d"] {
  --c-cream: #F5E6C0;  --c-cream-mid: #EDD89A; --c-cream-dark: #D4B85A;
  --c-ink: #2C1810;    --c-muted: #7A5C2E;
  --c-navy: #5C3A1A;   --c-navy-deep: #3E2610;
  --c-brick: #8B1A1A;  --c-brick-dark: #6d1414;
  --c-gold: #C9A050;   --c-gold-light: #E0BE80;
}
body[data-theme="e"] {
  --c-cream: #F2F2F0;  --c-cream-mid: #E8E8E6; --c-cream-dark: #CCCCCA;
  --c-ink: #1A1A1A;    --c-muted: #707070;
  --c-navy: #2A2A2A;   --c-navy-deep: #111111;
  --c-brick: #8B1A1A;  --c-brick-dark: #6d1414;
  --c-gold: #C9A050;   --c-gold-light: #E0BE80;
}

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

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

body {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.7;
  color: var(--c-ink);
  background: var(--c-cream);
  -webkit-font-smoothing: antialiased;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
}

ul, ol {
  list-style: none;
}

/* ── Container ─────────────────────────────────────────────── */
.container {
  max-width: none;
  padding-inline: 150px;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 28px;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.12em;
  transition: background var(--t-normal), color var(--t-normal), border-color var(--t-normal);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--c-brick);
  color: var(--c-white);
  border-color: var(--c-brick);
}
.btn-primary:hover {
  background: var(--c-brick-dark);
  border-color: var(--c-brick-dark);
}

.btn-secondary {
  background: var(--c-navy);
  color: var(--c-white);
  border-color: var(--c-navy);
}
.btn-secondary:hover {
  background: var(--c-navy-deep);
  border-color: var(--c-navy-deep);
}

.btn-outline {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-cream-dark);
}
.btn-outline:hover {
  border-color: var(--c-ink);
}

.btn-ghost {
  background: transparent;
  color: var(--c-muted);
  border-color: transparent;
}
.btn-ghost:hover {
  color: var(--c-ink);
}

/* ── Typography ─────────────────────────────────────────────── */
/* 注意：裸元素選擇器僅用於 body 層級的少數情境，
   頁面結構元件一律用元件前綴，保護 .rich-content */

/* ── Utility ────────────────────────────────────────────────── */
.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;
}

.hidden   { display: none !important; }
.flex     { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-8 { gap: 32px; }
.text-center { text-align: center; }
.text-muted  { color: var(--c-muted); }
.text-brick  { color: var(--c-brick); }
.text-gold   { color: var(--c-gold); }
.w-full      { width: 100%; }

/* ── Loading Spinner ─────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--c-cream-dark);
  border-top-color: var(--c-brick);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ───────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  background: var(--c-navy);
  color: var(--c-white);
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.25s ease;
}
.toast.success { background: var(--c-sage); }
.toast.error   { background: var(--c-alert); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
