/* ============================================
   安內咖啡 Design Tokens
   色彩取自品牌 logo:墨綠底 + 橘黃線條
   ============================================ */
:root {
  /* 色彩 */
  --forest: #1B4A42;
  --forest-deep: #0F2E29;
  --forest-mid: #23594F;
  --cream: #F6F1E7;
  --paper: #FBF8F2;
  --gold: #E8A33D;
  --gold-deep: #C67F1F;
  --ink: #201B15;
  --ink-soft: #4A4238;
  --line: rgba(32, 27, 21, 0.12);
  --line-on-dark: rgba(246, 241, 231, 0.18);

  /* 字體 */
  --font-display: 'Noto Serif TC', serif;
  --font-body: 'Noto Sans TC', sans-serif;

  /* 間距節奏 */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --radius: 2px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 var(--space-2);
  color: var(--ink);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 var(--space-2); color: var(--ink-soft); }

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

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

button { font-family: var(--font-body); cursor: pointer; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* ---- 手繪線條裝飾 (呼應 logo 的三角形線條) ---- */
.brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.brand-mark path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.divider-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-5) 0 var(--space-4);
  color: var(--gold);
}
.divider-mark::before,
.divider-mark::after {
  content: '';
  height: 1px;
  width: 56px;
  background: currentColor;
  opacity: 0.5;
}
.divider-mark svg { width: 22px; height: 22px; }

/* ---- Eyebrow 標籤 ---- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
  margin-bottom: var(--space-2);
  display: inline-block;
}
.eyebrow.on-dark { color: var(--gold); }

/* ---- 按鈕 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gold);
  color: var(--forest-deep);
}
.btn-primary:hover { background: var(--gold-deep); transform: translateY(-1px); }

.btn-outline-light {
  border-color: var(--line-on-dark);
  color: var(--cream);
  background: transparent;
}
.btn-outline-light:hover { border-color: var(--gold); color: var(--gold); }

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

.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Header / Nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--forest);
  color: var(--cream);
  border-bottom: 1px solid var(--line-on-dark);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: auto;
  min-height: 68px;
  padding: 8px 0;
}
.logo-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.logo-link span { color: var(--cream); }
.brand-logo-img { display: none; height: 38px; width: auto; }

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: auto;
  margin-right: var(--space-4);
  flex-wrap: nowrap;
}
.main-nav a {
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: var(--cream);
  opacity: 0.85;
  position: relative;
  padding: 0.3rem 0;
}
.main-nav a:hover, .main-nav a.active { opacity: 1; color: var(--gold); }

.nav-actions { display: flex; align-items: center; gap: var(--space-3); }
.cart-link { position: relative; display: flex; align-items: center; color: var(--cream); }
.cart-link svg { width: 22px; height: 22px; }
.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--gold);
  color: var(--forest-deep);
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--cream);
  padding: 0.5rem;
}
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 860px) {
  .site-header .container { flex-wrap: nowrap; }
  .nav-actions { flex-shrink: 0; }
  .logo-link { margin-left: 0.6rem; }
  .main-nav {
    display: none;
    position: fixed;
    top: 68px; right: 0;
    width: min(52vw, 210px);
    max-height: 80vh;
    background: var(--forest);
    flex-direction: column;
    align-items: flex-end;
    padding: var(--space-3) 1rem var(--space-3) var(--space-3);
    gap: var(--space-3);
    transform: translateY(-120%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    border-radius: 0 0 0 var(--radius);
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    z-index: 50;
  }
  .main-nav.open { display: flex; transform: translateY(0); }
  .nav-toggle { display: block; }
  .main-nav a { font-size: 1.1rem; text-align: right; }
}

/* ---- Footer ---- */
.site-footer {
  background: var(--forest-deep);
  color: var(--cream);
  padding: var(--space-5) 0 var(--space-3);
  margin-top: var(--space-6);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line-on-dark);
}
.footer-grid h4 {
  font-family: var(--font-body);
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.footer-grid p, .footer-grid a {
  color: rgba(246, 241, 231, 0.75);
  font-size: 0.92rem;
  display: block;
  margin-bottom: 0.5rem;
}
.footer-grid a:hover { color: var(--gold); }
.footer-bottom {
  padding-top: var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(246, 241, 231, 0.5);
  flex-wrap: wrap;
  gap: var(--space-2);
}
.footer-social { display: flex; gap: 0.9rem; }
.footer-social a { color: rgba(246, 241, 231, 0.6); transition: color 0.2s ease; }
.footer-social a:hover { color: var(--gold); }
.footer-social svg { width: 18px; height: 18px; }

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
  .footer-desc { display: none; }
}

@media (max-width: 520px) {
  .site-footer { padding: var(--space-4) 0 var(--space-3); margin-top: var(--space-5); }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-3); }
  .footer-grid h4 { margin-bottom: 0.6rem; }
  .footer-grid p, .footer-grid a { font-size: 0.88rem; margin-bottom: 0.4rem; }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); }
}

/* ---- 卡片 / 商品 ---- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover { box-shadow: 0 12px 32px rgba(15, 46, 41, 0.12); transform: translateY(-3px); }

.product-image {
  aspect-ratio: 1/1;
  background: linear-gradient(135deg, var(--forest-mid), var(--forest));
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(246, 241, 231, 0.35);
  position: relative;
  overflow: hidden;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-image svg { width: 40px; height: 40px; }

.badge-soldout {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--ink);
  color: var(--cream);
  font-size: 0.72rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.section { padding: var(--space-6) 0; }
.section-cream { background: var(--cream); }
.section-dark { background: var(--forest); color: var(--cream); }
.section-dark h2, .section-dark h3 { color: var(--cream); }
.section-dark p { color: rgba(246, 241, 231, 0.78); }

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-5);
}

.grid {
  display: grid;
  gap: var(--space-3);
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
}

/* ---- 各式飲品介紹(首頁) ---- */
.drink-item { text-align: center; }
.drink-photo {
  aspect-ratio: 1/1; overflow: hidden; margin-bottom: var(--space-2); border-radius: var(--radius);
  background: var(--forest); display: flex; align-items: center; justify-content: center;
  color: rgba(246,241,231,0.35);
}
.drink-photo img { width: 100%; height: 100%; object-fit: cover; }
.drink-photo svg { width: 32px; height: 32px; }
.drink-item h4 { font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; margin: 0; }

/* ---- 表單 ---- */
.field { margin-bottom: var(--space-3); }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--ink);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--paper);
  color: var(--ink);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--gold);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

.radio-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 0.7rem;
  cursor: pointer;
}
.radio-card input { width: auto; margin: 0; }
.radio-card.selected { border-color: var(--gold); background: rgba(232, 163, 61, 0.06); }

/* ---- 狀態文字 ---- */
.loading-state, .empty-state, .error-state {
  text-align: center;
  padding: var(--space-5) var(--space-2);
  color: var(--ink-soft);
}
.error-state { color: #B3402A; }
.section-dark .loading-state, .section-dark .empty-state { color: rgba(246,241,231,0.7); }
.section-dark .card, .section-dark .card h3 { color: var(--ink); }
.section-dark .card p { color: var(--ink-soft); }

/* ---- 麵包屑/次頁 header ---- */
.page-hero {
  background: var(--forest);
  color: var(--cream);
  padding: var(--space-5) 0 var(--space-4);
  text-align: center;
}
.page-hero h1 { color: var(--cream); margin-bottom: var(--space-1); }
.page-hero p { color: rgba(246,241,231,0.75); }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.tab-btn {
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  transition: all 0.2s ease;
}
.tab-btn.active {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--cream);
}

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }

/* ============================================
   可替換圖片區塊(後台上傳前顯示品牌色佔位圖示)
   ============================================ */
.photo-slot {
  background: linear-gradient(135deg, var(--forest-mid), var(--forest-deep));
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(246, 241, 231, 0.3);
  position: relative;
}
.photo-slot svg { width: 32px; height: 32px; }
.photo-slot.has-image { color: transparent; }
.photo-slot.has-image svg { display: none; }

/* ---- 兩張並排的文件/照片(例如檢驗報告) ---- */
.doc-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  max-width: 820px;
  margin: 0 auto;
}
/* 文件要完整看到,不能像照片那樣裁切,所以用 contain */
.doc-pair .doc-photo {
  aspect-ratio: 3 / 4;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: var(--radius);
}
.doc-pair .doc-photo.has-image {
  background-color: var(--paper);
  border: 1px solid var(--line);
}
.doc-caption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: var(--space-2);
}
@media (max-width: 640px) {
  .doc-pair { gap: var(--space-2); }
}

/* ---- 豆單頁橫幅(全幅疊字版,與首頁 hero-split 不同) ---- */
.hero-full {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--cream);
  overflow: hidden;
}
.hero-full::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,46,41,0.55) 0%, rgba(15,46,41,0.75) 100%);
  z-index: 1;
}
.hero-full-content { position: relative; z-index: 2; max-width: 640px; padding: 0 var(--space-3); }
.hero-full-content h1 { color: var(--cream); margin: 0 0 var(--space-2); }
.hero-full-content p { color: rgba(246,241,231,0.85); }
.hero-full-sm { min-height: 320px; }

/* ---- 全幅主視覺 (首頁 Hero) - 左右分割不對稱版面 ---- */
.hero-split {
  display: grid;
  grid-template-columns: 0.95fr 1.15fr;
  min-height: 640px;
  position: relative;
}
.hero-split-text {
  background: var(--forest);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-5) var(--space-4);
  position: relative;
  z-index: 2;
}
.hero-split-text h1 { color: var(--cream); }
.hero-split-text p { color: rgba(246,241,231,0.85); max-width: 460px; }
.hero-split-photo { position: relative; overflow: hidden; }
.hero-split-mark {
  position: absolute; z-index: 3;
  width: 130px; height: 130px;
  color: var(--gold);
  opacity: 0.9;
  top: 50%; left: 0; transform: translate(-50%, -50%) rotate(-8deg);
}
.hero-split-mark path { fill:none; stroke:currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 800px) {
  .hero-split { grid-template-columns: 1fr; min-height: unset; }
  .hero-split-photo { min-height: 320px; order: -1; }
  .hero-split-mark { display: none; }
}

/* ---- 圖文並排(品牌故事 / About)- 不對稱比例 + 疊框裝飾 ---- */
.split-block {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: var(--space-5);
  align-items: center;
}
.split-block.reverse { direction: rtl; grid-template-columns: 1.15fr 0.85fr; }
.split-block.reverse > * { direction: ltr; }
.split-photo-wrap { position: relative; }
.split-photo { aspect-ratio: 4/5; overflow: hidden; box-shadow: 0 24px 48px rgba(15,46,41,0.14); }
@media (max-width: 800px) {
  .split-block, .split-block.reverse { grid-template-columns: 1fr; direction: ltr; }
  .split-photo { aspect-ratio: 16/10; }
}

/* ---- 產地圓形徽章 ---- */
.origin-circles { display: flex; justify-content: center; gap: var(--space-5); flex-wrap: wrap; }
.origin-circle { text-align: center; width: 200px; }
.origin-circle-photo {
  width: 190px; height: 190px; border-radius: 50%; overflow: hidden;
  margin: 0 auto var(--space-2); background: var(--forest);
  display: flex; align-items: center; justify-content: center; color: rgba(246,241,231,0.35);
  box-shadow: 0 12px 28px rgba(15,46,41,0.14);
  background-size: contain; background-position: center; background-repeat: no-repeat;
}
.origin-circle-photo svg { width: 42px; height: 42px; }
.origin-circle h4 { font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; color: var(--ink); margin: 0; }

/* ---- 三張特色照片 - 三等分等高版面 ---- */
.feature-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.feature-trio-item .split-photo { aspect-ratio: 3/2; margin-bottom: var(--space-2); overflow: hidden; }
.feature-trio-item h3 { font-size: 1.05rem; margin-bottom: 0; text-align: center; }
@media (max-width: 760px) {
  .feature-trio { grid-template-columns: 1fr; }
}

/* ---- 客戶好評 - 左對齊 + 巨大引號裝飾 ---- */
.testimonial-block {
  max-width: 620px; margin: 0 auto; text-align: left;
  position: relative; padding-left: var(--space-4);
}
.testimonial-block::before {
  content: '“';
  position: absolute; left: -18px; top: -52px;
  font-size: 9rem; font-family: var(--font-display);
  color: rgba(232,163,61,0.18); line-height: 1; z-index: 0;
}
.testimonial-block .quote-mark { display: none; }
.testimonial-block p.quote { position: relative; z-index: 1; font-size: 1.25rem; font-family: var(--font-display); color: var(--ink); line-height: 1.7; margin-bottom: var(--space-2); }
.testimonial-block .author { position: relative; z-index: 1; font-size: 0.85rem; color: var(--ink-soft); letter-spacing: 0.05em; }
@media (max-width: 600px) { .testimonial-block { padding-left: var(--space-2); } .testimonial-block::before { font-size: 6rem; left: -6px; top: -36px; } }

/* ---- 門市卡片(圖左文右,上下堆疊)---- */
.store-detail-card {
  display: grid; grid-template-columns: 240px 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  color: inherit;
}
.store-detail-image { width: 240px; align-self: stretch; background: var(--forest); display:flex; align-items:center; justify-content:center; }
.store-detail-image img { width: 100%; height: 100%; object-fit: cover; }
.store-detail-body { padding: var(--space-4); display: flex; flex-direction: column; justify-content: center; }
.store-detail-body h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.store-detail-body p { font-size: 1.02rem; }
.store-tag { display:inline-block; background: var(--cream); padding: 0.25rem 0.7rem; border-radius: 999px; font-size: 0.78rem; margin-right: 0.4rem; margin-bottom: 0.4rem; }
.stores-preview-list { display: flex; flex-direction: column; gap: var(--space-3); }
@media (max-width: 700px) {
  .store-detail-card { grid-template-columns: 1fr; }
  .store-detail-image { width: 100%; aspect-ratio: 16/9; }
  .store-detail-body { padding: var(--space-3); }
}

/* ---- CTA 背景大圖 - 底部金線裝飾 ---- */
.cta-photo-banner {
  position: relative; min-height: 340px; display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--cream); overflow: hidden;
}
.cta-photo-banner::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,46,41,0.65), rgba(15,46,41,0.8));
  z-index: 1;
}
.cta-photo-banner::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  z-index: 2;
}
.cta-photo-banner .cta-content { position: relative; z-index: 2; padding: 0 var(--space-3); }
.cta-photo-banner h2 { color: var(--cream); }

/* ---- 豆單頁:編號特色區塊 - 傾斜照片框 + 疊框裝飾 ---- */
.numbered-feature { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: center; margin-bottom: var(--space-6); }
.numbered-feature.reverse { direction: rtl; }
.numbered-feature.reverse > * { direction: ltr; }
.numbered-feature .num { font-family: var(--font-display); font-size: 3rem; color: var(--gold); line-height: 1; margin-bottom: var(--space-1); }
.numbered-feature .eyebrow { display:block; margin-bottom: 0.3rem; }
.numbered-feature .feature-photo-wrap { position: relative; }
.numbered-feature .feature-photo {
  aspect-ratio: 4/3; overflow: hidden;
  box-shadow: 0 20px 44px rgba(15,46,41,0.12);
}
@media (max-width: 800px) {
  .numbered-feature, .numbered-feature.reverse { grid-template-columns: 1fr; direction: ltr; }
}
