/* Shared UI styles extracted from repeated inline <style> blocks
   - Header/Nav + Mobile hamburger menu
   - Floating WhatsApp CTA
   - Common scrollbar styling + text shadow
   NOTE: Page-specific CSS can still live in each page's own <style> block and will override these if needed.
*/

.custom-scrollbar::-webkit-scrollbar { width: 8px; height: 8px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #f0e9e1; border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #DEAA6E; border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #c89a63; }
.custom-scrollbar { scrollbar-width: thin; scrollbar-color: #DEAA6E #f0e9e1; }

.text-shadow { text-shadow: 1px 1px 3px rgba(0,0,0,0.5); }
.text-shadow-lg { text-shadow: 2px 2px 8px rgba(0,0,0,0.7); }

.header { background: rgba(255,255,255,0.94); backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid rgba(139, 0, 0, 0.08); box-shadow: 0 8px 24px rgba(58,31,18,0.06); position: sticky; top: 0; z-index: 50; width: 100%; }
.navbar { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 0.9rem 5%; max-width: 1400px; margin: 0 auto; min-height: 76px; }
.nav-logo { flex: 0 0 auto; }
.nav-logo a { display: inline-flex; align-items: center; gap: 0.75rem; font-size: 1.35rem; font-weight: 800; letter-spacing: 0.01em; color: #8B0000; text-decoration: none; }
.nav-logo span { color: #DEAA6E; }
.logo-img { height: 42px; width: 42px; margin-right: 0; border-radius: 999px; object-fit: contain; }

.nav-links { display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; list-style: none; gap: 0.2rem; margin: 0 0 0 auto; padding: 0.35rem 0.5rem; border: 1px solid rgba(58,31,18,0.08); border-radius: 999px; background: rgba(255,255,255,0.92); box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 10px 24px rgba(58,31,18,0.05); }
.nav-links li { margin: 0; }
.nav-links a { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 0.7rem 0.95rem; color: #3a1f12; font-weight: 600; text-decoration: none; white-space: nowrap; line-height: 1.2; border-radius: 999px; transition: color 0.25s ease, transform 0.25s ease; }
.nav-links a::after { content: ""; position: absolute; left: 0.95rem; right: 0.95rem; bottom: 0.42rem; height: 2px; border-radius: 999px; background: #8B0000; opacity: 0; transform: scaleX(0.3); transform-origin: center; transition: opacity 0.25s ease, transform 0.25s ease; }
.nav-links a:hover, .nav-links a:focus-visible { color: #8B0000; outline: none; }
.nav-links a:hover::after, .nav-links a:focus-visible::after, .nav-links a.active::after, .nav-links a.text-secondary::after { opacity: 1; transform: scaleX(1); }
.nav-links a.active, .nav-links a.text-secondary { color: #8B0000; font-weight: 700; }

.hamburger { display: none; position: relative; z-index: 60; width: 46px; height: 46px; border-radius: 14px; border: 1px solid rgba(58,31,18,0.12); background: rgba(255,255,255,0.96); box-shadow: 0 10px 24px rgba(58,31,18,0.08); cursor: pointer; align-items: center; justify-content: center; flex-direction: column; gap: 5px; transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.hamburger:hover, .hamburger:focus-visible { transform: translateY(-1px); border-color: rgba(139,0,0,0.2); box-shadow: 0 12px 28px rgba(58,31,18,0.12); outline: none; }
.bar { width: 20px; height: 2px; border-radius: 999px; background-color: #3a1f12; transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease; }

@media (max-width: 1100px) {
  .navbar { gap: 1rem; }
  .nav-links { gap: 0; padding: 0.32rem 0.45rem; }
  .nav-links a { padding: 0.68rem 0.8rem; font-size: 0.95rem; }
}

@media (max-width: 860px) {
  .navbar { padding-top: 0.75rem; padding-bottom: 0.75rem; min-height: 72px; }
  .nav-logo a { font-size: 1.2rem; }
  .logo-img { height: 38px; width: 38px; }
  .nav-links { position: fixed; top: 84px; right: 0.75rem; left: 0.75rem; margin: 0; padding: 0.8rem; border-radius: 24px; border: 1px solid rgba(58,31,18,0.08); background: rgba(255,255,255,0.98); box-shadow: 0 24px 60px rgba(58,31,18,0.16); flex-direction: column; align-items: stretch; gap: 0.2rem; transform: translateY(-8px) scale(0.98); opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease; }
  .nav-links.active { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
  .nav-links li + li { border-top: 1px solid rgba(58,31,18,0.06); }
  .nav-links a { display: flex; justify-content: flex-start; width: 100%; padding: 0.95rem 1rem; border-radius: 16px; }
  .nav-links a::after { left: 1rem; right: auto; width: 1.5rem; bottom: 0.6rem; }
  .hamburger { display: inline-flex; flex: 0 0 auto; }
  .hamburger.active { border-color: rgba(139,0,0,0.22); }
  .hamburger.active .bar { background-color: #8B0000; }
  .hamburger.active .bar:nth-child(2) { opacity: 0; }
  .hamburger.active .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.active .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  body.nav-open { overflow: hidden; }
}

.cta-floating { position: fixed; bottom: 30px; right: 30px; z-index: 100; animation: bounce 2s infinite; }
.whatsapp-float-btn { display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; background-color: #25D366; color: white; border-radius: 50%; box-shadow: 0 4px 12px rgba(0,0,0,0.3); font-size: 30px; transition: all 0.3s ease; }
.whatsapp-float-btn:hover { transform: scale(1.1); background-color: #20BA5C; }

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* ============================================
   分類 Accent Color 系統（首頁類別卡）
   - liquor 酒類 (紅/酒紅)
   - coin 銀元 (靛/石板)
   - seafood 海味 (翠綠)
   ============================================ */
.category-card { --accent: #DEAA6E; --accent-dark: #c89a63; --accent-bg: #FFF8EE; --accent-border: #F2E2C5; }
.category-card[data-product-category="liquor"] { --accent: #8B0000; --accent-dark: #6a0000; --accent-bg: #FFF1F1; --accent-border: #F8D7D7; }
.category-card[data-product-category="coin"] { --accent: #475569; --accent-dark: #334155; --accent-bg: #F1F5F9; --accent-border: #CBD5E1; }
.category-card[data-product-category="seafood"] { --accent: #0F766E; --accent-dark: #0B5A54; --accent-bg: #ECFDF5; --accent-border: #B6E5D8; }

.category-card { border-color: var(--accent-border); transition: box-shadow .35s ease, border-color .35s ease, transform .35s ease; }
.category-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 18px 40px rgba(58,31,18,0.12); }
.category-card .cat-badge { color: var(--accent); background: var(--accent-bg); border: 1px solid var(--accent-border); }
.category-card .cat-icon { color: var(--accent); background: var(--accent-bg); border: 1px solid var(--accent-border); }
.category-card .cat-tag { color: var(--accent-dark); background: var(--accent-bg); border: 1px solid var(--accent-border); }
.category-card .cat-check { color: var(--accent); }
.category-card .cat-cta { color: var(--accent); border: 1.5px solid var(--accent); transition: background .25s ease, color .25s ease, transform .25s ease, box-shadow .25s ease; }
.category-card .cat-cta:hover { background: var(--accent); color: #fff; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.12); }

/* 類別卡：主圖 + 小縮圖切換（取代原本 2×2 四張縮圖） */
.category-media { position: relative; border-radius: 14px; overflow: hidden; background: #f8f3ea; border: 1px solid var(--accent-border); }
.category-media .cat-main { width: 100%; height: 220px; object-fit: cover; display: block; transition: opacity .35s ease, transform .6s ease; }
.category-media:hover .cat-main { transform: scale(1.04); }
.category-media .cat-thumbs { position: absolute; bottom: 10px; left: 10px; right: 10px; display: flex; gap: 6px; justify-content: flex-start; flex-wrap: nowrap; }
.category-media .cat-thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; border: 2px solid rgba(255,255,255,0.85); cursor: pointer; padding: 0; background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.18); transition: transform .2s ease, border-color .2s ease; }
.category-media .cat-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.category-media .cat-thumb:hover { transform: translateY(-2px); }
.category-media .cat-thumb.is-active { border-color: var(--accent); transform: translateY(-2px); }
.category-media .cat-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.35) 100%); pointer-events: none; }

@media (max-width: 480px) {
  .category-media .cat-main { height: 180px; }
  .category-media .cat-thumb { width: 38px; height: 38px; }
}

/* ============================================
   Scroll Reveal 動畫（IntersectionObserver 配合）
   ============================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); will-change: opacity, transform; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }
.reveal-delay-4 { transition-delay: .32s; }
.reveal-delay-5 { transition-delay: .40s; }
.reveal-delay-6 { transition-delay: .48s; }

/* Stagger 容器：子元素依序出現 */
.reveal-stagger > * { opacity: 0; transform: translateY(20px); transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1); }
.reveal-stagger.is-visible > *:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: .05s; }
.reveal-stagger.is-visible > *:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: .12s; }
.reveal-stagger.is-visible > *:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: .19s; }
.reveal-stagger.is-visible > *:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: .26s; }
.reveal-stagger.is-visible > *:nth-child(5) { opacity: 1; transform: translateY(0); transition-delay: .33s; }
.reveal-stagger.is-visible > *:nth-child(6) { opacity: 1; transform: translateY(0); transition-delay: .40s; }
.reveal-stagger.is-visible > *:nth-child(n+7) { opacity: 1; transform: translateY(0); transition-delay: .46s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Hero quickstart 區塊（第二屏）樣式 */
.quickstart-block { background: linear-gradient(180deg, #fff8ee 0%, #ffffff 100%); border: 1px solid #f2e2c5; border-radius: 20px; padding: 24px; box-shadow: 0 10px 30px rgba(58,31,18,0.06); }
.quickstart-block h2 { font-size: 1.5rem; font-weight: 800; color: #3a1f12; }
.quickstart-block ul li i { color: #8B0000; }
.quickstart-chip { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: #fff1f1; color: #8B0000; font-size: 12.5px; font-weight: 600; border: 1px solid #f8d7d7; }

/* Hero H1 斷句優化：在中文環境避免奇怪換行 */
.hero-h1 { text-wrap: balance; word-break: normal; overflow-wrap: break-word; line-height: 1.22; }
