/* =========================
   HENGJHU Design System v2.0 (Site-wide)
   優化版：統一設計 token、完整無障礙支援、效能優化
   ========================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* 品牌顏色 */
  --brand-1: #8A9E58;
  --brand-2: #A3B167;
  --brand-dark: #6E8045;
  --brand-light: #eef2ea;
  
  /* 向下相容 */
  --brand: var(--brand-1);
  --brand-600: var(--brand-1);
  --brand-700: var(--brand-dark);
  --brand-400: var(--brand-2);
  --brand-color: var(--brand-1);
  --brand-color-dark: var(--brand-dark);
  --brand-color-light: var(--brand-light);
  
  /* 文字顏色 */
  --ink-900: #0f172a;
  --ink-700: #374151;
  --ink-500: #6b7280;
  --ink-300: #9ca3af;
  
  /* 背景顏色 */
  --bg-0: #ffffff;
  --bg-50: #f9fafb;
  
  /* 邊框與陰影 */
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 10px 24px rgba(0,0,0,.08);
  
  /* 容器寬度 */
  --container: 1140px;
  
  /* 狀態顏色 */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
}

/* ---------- Base Reset ---------- */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--ink-900);
  font-family: Inter, system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--brand-color);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--brand-color-dark);
}

/* 無障礙：焦點樣式 */
:focus-visible {
  outline: 2px solid var(--brand-1);
  outline-offset: 2px;
}

/* 容器 */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* 標題 */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-weight: 700;
  line-height: 1.2;
}

p {
  margin: 0 0 1em;
}

.small {
  font-size: 0.875rem;
  color: var(--ink-500);
}

/* ---------- Buttons ---------- */
.btn,
a.button,
button.button,
input.button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--brand-color);
  color: #fff !important;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover,
a.button:hover,
button.button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover {
  background: var(--brand-color-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}

.btn:disabled,
button.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn.outline {
  background: transparent;
  color: var(--brand-color) !important;
  border-color: var(--brand-color);
}

.btn.outline:hover {
  background: var(--brand-color);
  color: #fff !important;
}

/* ---------- Cards ---------- */
.card {
  height: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.03);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card .img {
  aspect-ratio: 16/10;
  background: var(--brand-light);
}

.card .body {
  padding: 16px 16px 18px;
}

.card .title {
  font-weight: 700;
  margin: 0 0 8px;
}

.card .meta {
  color: var(--ink-300);
  font-size: 13px;
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.col-4 {
  grid-column: span 4;
}

.col-6 {
  grid-column: span 6;
}

.col-12 {
  grid-column: span 12;
}

/* ---------- Sections ---------- */
section {
  padding: 64px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.section-head h3 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.06em;
}

.section-head p {
  margin: 0;
  color: var(--ink-700);
}

/* ---------- Forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field input,
.field textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="time"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(138, 158, 88, 0.1);
}

/* ========================================
   ⭐ Header - 固定在最上方
   ======================================== */
header.hj-header,
.hj-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 99999 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 確保 Elementor 容器不影響 Header */
.elementor-widget-html .hj-header,
.elementor-element .hj-header,
.elementor-widget-container .hj-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
}

/* 為頁面內容預留空間 */
body {
  padding-top: 80px !important;
}

/* Elementor 編輯模式 */
.elementor-editor-active .hj-header {
  position: relative !important;
}

.elementor-editor-active body {
  padding-top: 0 !important;
}

/* ---------- Footer ---------- */
footer.hj-footer {
  background: var(--brand-1);
  color: #fff;
  padding: 28px 0;
  margin-top: 24px;
}

footer.hj-footer a {
  color: #fff;
  opacity: 0.92;
}

footer.hj-footer a:hover {
  opacity: 1;
}

/* ---------- WooCommerce ---------- */
.woocommerce ul.products {
  gap: 20px;
}

.woocommerce ul.products li.product {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  padding: 0 0 12px;
}

.woocommerce ul.products li.product a img {
  border-bottom: 1px solid var(--border);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-weight: 700;
  font-size: 16px;
  margin: 12px 12px 6px;
}

.woocommerce ul.products li.product .price {
  margin: 0 12px 10px;
  font-weight: 700;
  color: var(--ink-900);
}

.woocommerce ul.products li.product a.button {
  margin: 0 12px;
}

.woocommerce span.onsale {
  background: var(--brand-1);
  border-radius: 999px;
  min-width: 56px;
  min-height: 56px;
  line-height: 56px;
}

/* ---------- WPForms ---------- */
.hj-form.wpforms-container input,
.hj-form.wpforms-container textarea,
.hj-form.wpforms-container select {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
}

.hj-form.wpforms-container input:focus,
.hj-form.wpforms-container textarea:focus,
.hj-form.wpforms-container select:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(138, 158, 88, 0.1);
}

.hj-form.wpforms-container button[type="submit"] {
  background: var(--brand-1);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
}

.hj-form.wpforms-container button[type="submit"]:hover {
  background: var(--brand-dark);
}

/* ---------- 響應式設計 ---------- */
@media (max-width: 960px) {
  .container {
    padding: 0 16px;
  }
  
  .grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .col-4,
  .col-6,
  .col-12 {
    grid-column: span 6;
  }
  
  body {
    padding-top: 70px !important;
  }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Print Styles ---------- */
@media print {
  .hj-header,
  .hj-footer,
  .btn,
  button {
    display: none !important;
  }
  
  body {
    padding-top: 0 !important;
  }
}
.hj-seo-links{
  margin-top:40px;
  padding:24px;
  border:1px solid #e5e7eb;
  border-radius:16px;
  background:#f8faf8;
}

.hj-seo-links h2{
  margin:0 0 12px;
  font-size:24px;
  line-height:1.3;
}

.hj-seo-links p{
  margin:0 0 14px;
  color:#475569;
}

.hj-seo-links ul{
  margin:0;
  padding-left:20px;
}

.hj-seo-links li{
  margin:8px 0;
}

.hj-seo-links a{
  text-decoration:none;
}

.hj-seo-links a:hover{
  text-decoration:underline;
}
.hj-seo-links{
  margin-top:40px;
  padding:24px;
  border:1px solid #e5e7eb;
  border-radius:16px;
  background:#f8faf8;
}

.hj-seo-links h2{
  margin:0 0 12px;
  font-size:24px;
  line-height:1.3;
}

.hj-seo-links p{
  margin:0 0 14px;
  color:#475569;
}

.hj-seo-links ul{
  margin:0;
  padding-left:20px;
}

.hj-seo-links li{
  margin:8px 0;
}

.hj-seo-links a{
  text-decoration:none;
}

.hj-seo-links a:hover{
  text-decoration:underline;
}
.hj-about-seo,
.hj-product-seo{
  margin-top:40px;
  padding:24px;
  border:1px solid #e5e7eb;
  border-radius:16px;
  background:#f8faf8;
}

.hj-about-seo h2,
.hj-product-seo h2{
  margin:0 0 12px;
  font-size:24px;
  line-height:1.35;
}

.hj-about-seo p,
.hj-product-seo p{
  margin:0 0 14px;
  color:#475569;
}

.hj-about-seo ul,
.hj-product-seo ul{
  margin:0;
  padding-left:20px;
}

.hj-about-seo li,
.hj-product-seo li{
  margin:8px 0;
}

.hj-about-seo a,
.hj-product-seo a{
  text-decoration:none;
}

.hj-about-seo a:hover,
.hj-product-seo a:hover{
  text-decoration:underline;
}