@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Noto+Serif+TC:wght@400;600&display=swap");
@import "variables.css";

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  color: var(--color-black);
  background: var(--color-white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
ul { list-style: none; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

/* ===== 按鈕 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; font-size: 0.875rem; font-weight: 500;
  letter-spacing: 0.05em; border: none; cursor: pointer;
  transition: all var(--transition);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--color-navy); color: white; }
.btn-primary:hover:not(:disabled) { background: rgba(23,35,95,0.9); }
.btn-outline { background: transparent; color: var(--color-black); border: 1px solid var(--color-black); }
.btn-outline:hover:not(:disabled) { background: var(--color-black); color: white; }
.btn-line {
  background: #06c755; color: white; border: none;
  font-weight: 600;
}
.btn-line:hover:not(:disabled) { background: #05b34c; }
.btn-line svg { flex-shrink: 0; }
.oauth-buttons { display: flex; flex-direction: column; gap: 0.625rem; }
.oauth-buttons a.btn { text-decoration: none; box-sizing: border-box; }
.oauth-buttons .oauth-btn--locked { opacity: 0.42; cursor: not-allowed; }
.oauth-buttons .oauth-btn--loading { opacity: 0.85; pointer-events: none; }
.oauth-ios-line-tip {
  margin: 0 0 0.25rem; font-size: 0.6875rem; line-height: 1.5; color: var(--color-muted);
}
.oauth-ios-line-tip[hidden] { display: none; }
.btn-google {
  background: #fff; color: #3c4043; border: 1px solid #dadce0;
  font-weight: 500;
}
.btn-google:hover:not(:disabled) { background: #f8f9fa; border-color: #c6c9cc; }
.btn-google svg { flex-shrink: 0; }
.auth-page-shell { max-width: 28rem; margin: 0 auto; padding: 2rem 1rem 3rem; }
@media (min-width: 640px) { .auth-page-shell { padding: 4rem 1rem; } }

.oauth-section { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.25rem; }

/* 社群登入同意：簡潔勾選列（LINE 按鈕上方） */
.oauth-consent-label {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.875rem 0; cursor: pointer;
}
.oauth-consent-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.oauth-consent-mark {
  flex-shrink: 0; width: 1.125rem; height: 1.125rem; margin-top: 0.15rem;
  border: 1.5px solid #d1d5db; border-radius: 3px; background: #fff;
  transition: border-color var(--transition), background var(--transition);
}
.oauth-consent-input:focus-visible + .oauth-consent-mark {
  outline: 2px solid var(--color-navy); outline-offset: 2px;
}
.oauth-consent-input:checked + .oauth-consent-mark {
  border-color: var(--color-navy); background: var(--color-navy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' d='M2 6l3 3 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 0.75rem;
}
.oauth-consent-text {
  font-size: 0.8125rem; line-height: 1.6; color: rgba(0, 0, 0, 0.72);
}
.oauth-consent-text strong { font-weight: 500; color: var(--color-black); }

.line-consent-details {
  margin: 0; padding: 0; border: none; background: transparent;
  font-size: 0.75rem; line-height: 1.65; color: var(--color-muted);
}
.line-consent-details summary {
  cursor: pointer; color: var(--color-muted); font-weight: 400;
  list-style: none; text-decoration: underline; text-underline-offset: 2px;
}
.line-consent-details summary:hover { color: var(--color-navy); }
.line-consent-details summary::-webkit-details-marker { display: none; }
.line-consent-details-body {
  margin-top: 0.625rem; padding: 0.875rem 1rem;
  background: var(--color-gray); border-radius: 4px; color: #6b7280;
}
.line-consent-details-body ul { margin: 0.5rem 0 0; padding-left: 1.125rem; list-style: disc; }
.line-consent-details-body li { margin-top: 0.2rem; }

.oauth-consent-hint {
  margin: -0.25rem 0 0; font-size: 0.75rem; color: var(--color-muted);
}
.oauth-consent-hint[hidden] { display: none; }
.oauth-consent-error-below {
  min-height: 1.25rem; margin: 0; font-size: 0.8125rem; color: #ef4444;
}
.oauth-consent-error-below:empty { min-height: 0; }
.auth-divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.5rem 0; color: var(--color-muted); font-size: 0.8125rem;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: #e5e7eb;
}
.btn-danger { background: transparent; color: #991b1b; border: 1px solid #991b1b; }
.btn-danger:hover:not(:disabled) { background: #991b1b; color: white; }
.btn-ghost { background: transparent; color: var(--color-muted); }
.btn-ghost:hover { color: var(--color-navy); }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }
.btn-block { width: 100%; }

/* ===== 表單 ===== */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; }
.form-label .required { color: #ef4444; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.75rem 1rem; border: 1px solid #e5e7eb;
  background: white; transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--color-navy);
  box-shadow: 0 0 0 3px rgba(23,35,95,0.1);
}
.form-input.error { border-color: #ef4444; }
.form-select.error { border-color: #ef4444; }
.form-input[readonly] { background: var(--color-gray); color: var(--color-muted); cursor: default; }
.form-error { font-size: 0.8125rem; color: #ef4444; margin-top: 0.25rem; }
.form-textarea { resize: vertical; min-height: 80px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(8px);
  border-bottom: 1px solid #f3f4f6;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-height);
}
.logo img { height: 40px; width: auto; }
@media (min-width: 1024px) { .logo img { height: 48px; } }

.nav-desktop { display: none; gap: 2rem; }
@media (min-width: 1024px) { .nav-desktop { display: flex; } }
.nav-desktop a {
  font-size: 0.875rem; letter-spacing: 0.05em; color: rgba(0,0,0,0.7);
  transition: color var(--transition);
}
.nav-desktop a:hover, .nav-desktop a.active { color: var(--color-navy); font-weight: 500; }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.header-actions a, .header-actions button {
  padding: 0.5rem; color: rgba(0,0,0,0.7); background: none; border: none; cursor: pointer;
  transition: color var(--transition);
}
.header-actions a:hover, .header-actions button:hover { color: var(--color-navy); }
.cart-badge {
  position: absolute; top: 0; right: 0;
  width: 16px; height: 16px; background: var(--color-navy); color: white;
  font-size: 10px; font-weight: 700; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.cart-icon-wrap { position: relative; }

.menu-toggle { display: block; }
@media (min-width: 1024px) { .menu-toggle { display: none; } }

.nav-mobile {
  display: none; border-top: 1px solid #f3f4f6; padding: 1rem;
}
.nav-mobile.open { display: block; }
.nav-mobile a {
  display: block; padding: 0.75rem 1rem; font-size: 0.875rem;
  color: rgba(0,0,0,0.7); border-radius: 2px;
}
.nav-mobile a:hover, .nav-mobile a.active { background: var(--color-gray); color: var(--color-navy); }

/* ===== Footer ===== */
.site-footer { background: var(--color-navy); color: white; padding: 4rem 0 2rem; margin-top: auto; }
.footer-grid { display: grid; gap: 2.5rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand p { font-size: 0.875rem; color: rgba(255,255,255,0.7); margin-top: 1rem; line-height: 1.8; }
.footer-info { font-size: 0.875rem; color: rgba(255,255,255,0.6); margin-top: 1rem; }
.footer-info a { color: rgba(255,255,255,0.6); text-decoration: underline; text-underline-offset: 2px; transition: color var(--transition); }
.footer-info a:hover { color: white; }
.footer-info li { margin-bottom: 0.5rem; display: flex; align-items: flex-start; gap: 0.5rem; }
.footer-title { font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-links a { font-size: 0.875rem; color: rgba(255,255,255,0.6); display: block; margin-bottom: 0.5rem; transition: color var(--transition); }
.footer-links a:hover { color: white; }
.footer-bottom {
  margin-top: 3rem; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  font-size: 0.75rem; color: rgba(255,255,255,0.4);
}
.footer-bottom a { color: rgba(255,255,255,0.4); }
.footer-bottom a:hover { color: white; }
.footer-logo {
  height: 40px;
  width: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
}
@media (min-width: 1024px) { .footer-logo { height: 44px; } }

/* ===== 頁面標題區 ===== */
.page-hero {
  background: var(--color-gray); padding: 3rem 0;
}
@media (min-width: 1024px) { .page-hero { padding: 4rem 0; } }
.page-hero h1 {
  font-family: var(--font-serif); font-weight: 300; font-size: 2rem;
}
@media (min-width: 1024px) { .page-hero h1 { font-size: 2.5rem; } }
.page-hero p { margin-top: 0.5rem; font-size: 0.875rem; color: var(--color-muted); }

/* ===== 關於我們頁 ===== */
.page-hero-about { text-align: center; padding: 4rem 0 3.5rem; }
.page-hero-about h1 {
  max-width: 16em; margin: 0 auto; line-height: 1.45; color: var(--color-navy);
}
.page-hero-about .hero-brand {
  margin-top: 1rem; font-size: 1.125rem; letter-spacing: 0.15em;
  color: var(--color-muted); font-weight: 400;
}
.about-lead {
  max-width: 36rem; margin: 0 auto; text-align: center;
  font-size: 1.0625rem; line-height: 2; color: rgba(0,0,0,0.78);
}
.about-values { display: grid; gap: 1.25rem; }
@media (min-width: 768px) { .about-values { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }
.value-card {
  background: white; padding: 2rem 1.5rem; text-align: center;
  border: 1px solid rgba(23,35,95,0.06);
}
.value-card h3 {
  font-size: 1rem; font-weight: 500; color: var(--color-navy); letter-spacing: 0.08em;
}
.value-card p {
  margin-top: 0.75rem; font-size: 0.9375rem; line-height: 1.75;
  color: var(--color-muted);
}
.about-care { padding-top: 3rem; padding-bottom: 4rem; }
@media (min-width: 1024px) { .about-care { padding-top: 4rem; padding-bottom: 5rem; } }
.care-block { max-width: 42rem; margin: 0 auto 3.5rem; }
.care-block:last-child { margin-bottom: 0; }
.care-block h2 {
  font-family: var(--font-serif); font-weight: 300; font-size: 1.5rem;
  color: var(--color-navy); padding-bottom: 1rem;
  border-bottom: 1px solid #eee; margin-bottom: 1.25rem;
}
.care-label {
  font-size: 0.875rem; font-weight: 600; color: var(--color-navy);
  letter-spacing: 0.05em; margin: 1.25rem 0 0.5rem;
}
.care-block p, .care-block li {
  font-size: 0.9375rem; line-height: 1.85; color: rgba(0,0,0,0.65);
}
.care-list { list-style: none; padding: 0; }
.care-list li { margin-bottom: 0.75rem; padding-left: 1.25rem; position: relative; }

/* ===== 購買須知頁 ===== */
.policy-nav {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1rem;
  padding: 1.5rem 1rem 0; max-width: 42rem; margin: 0 auto;
}
.policy-nav a {
  font-size: 0.875rem; color: var(--color-navy); letter-spacing: 0.03em;
  padding: 0.5rem 0.75rem; border: 1px solid rgba(23,35,95,0.15);
  transition: all 0.2s;
}
.policy-nav a:hover { background: var(--color-navy); color: white; border-color: var(--color-navy); }
.policy-highlight {
  background: var(--color-gray); padding: 1.25rem 1.5rem; margin: 1rem 0;
  border-left: 3px solid var(--color-navy);
}
.policy-highlight-title { font-weight: 600; color: var(--color-navy); margin-bottom: 0.5rem; }
.policy-steps { counter-reset: step; }
.policy-steps li { counter-increment: step; padding-left: 2rem; }
.policy-steps li::before {
  content: counter(step); width: 1.25rem; height: 1.25rem;
  background: var(--color-navy); color: white; border-radius: 50%;
  font-size: 0.6875rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  top: 0.15em;
}
.care-list li::before {
  content: ""; position: absolute; left: 0; top: 0.65em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--color-navy);
}
.section-about { padding: 3rem 0; }
.section { padding: 4rem 0; }
@media (min-width: 1024px) { .section { padding: 6rem 0; } }
.section-gray { background: var(--color-gray); }
.section-title {
  font-family: var(--font-serif); font-weight: 300; font-size: 1.75rem;
}
@media (min-width: 1024px) { .section-title { font-size: 2rem; } }
.section-subtitle { margin-top: 0.5rem; font-size: 0.875rem; color: var(--color-muted); }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2.5rem; }
.section-link { font-size: 0.875rem; color: var(--color-navy); letter-spacing: 0.05em; }
.section-link:hover { text-decoration: underline; }

/* ===== Hero Banner ===== */
.hero-banner { position: relative; height: 60vh; min-height: 400px; max-height: 700px; overflow: hidden; background: var(--color-gray); }
#hero-slides { position: absolute; inset: 0; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease; }
.hero-slide.active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,0.4), transparent); }
.hero-content {
  position: absolute; inset: 0; display: flex; align-items: center;
  padding: 0 1rem; z-index: 2; pointer-events: none;
}
.hero-content a { pointer-events: auto; }
.hero-nav, .hero-dots { z-index: 3; }
.hero-content .container { max-width: 32rem; }
.hero-content h1 {
  font-family: var(--font-banner);
  font-weight: normal;
  font-size: 2.25rem;
  color: white;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
@media (min-width: 1024px) { .hero-content h1 { font-size: 3.25rem; } }
/* 華康墨字體空格 glyph 過寬，改用固定寬度空白 */
.hero-content h1 .hero-title-gap {
  display: inline-block;
  vertical-align: baseline;
}
.hero-content p {
  margin-top: 1rem;
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  font-family: var(--font-sans);
}
.hero-content .btn { margin-top: 2rem; background: white; color: var(--color-navy); }
.hero-content .btn:hover { background: rgba(255,255,255,0.9); }
.hero-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  padding: 0.5rem; background: rgba(255,255,255,0.2); backdrop-filter: blur(4px);
  border: none; color: white; cursor: pointer; border-radius: 50%; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.hero-nav:hover { background: rgba(255,255,255,0.3); }
.hero-nav.prev { left: 1rem; }
.hero-nav.next { right: 1rem; }
.hero-dots { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); display: flex; gap: 0.5rem; }
.hero-dot {
  height: 6px; border-radius: 3px; border: none; background: rgba(255,255,255,0.4); cursor: pointer;
  transition: all 0.3s; width: 6px; padding: 0;
}
.hero-dot.active { width: 32px; background: white; }

/* ===== 商品卡片 ===== */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
@media (min-width: 768px) { .product-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem 1.5rem; } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card { group: product; }
.product-card-image {
  position: relative; aspect-ratio: 1; background: var(--color-gray); overflow: hidden;
}
.product-card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .product-card-image img { transform: scale(1.05); }
.product-badge {
  position: absolute; top: 0.75rem; left: 0.75rem;
  padding: 0.125rem 0.625rem; font-size: 0.75rem; font-weight: 500;
}
.badge-new { background: var(--color-navy); color: white; }
.badge-sale { background: #fef2f2; color: #dc2626; }
.badge-out { background: #f3f4f6; color: var(--color-muted); }
.product-card-body { margin-top: 1rem; }
.product-category { font-size: 0.75rem; color: var(--color-muted); letter-spacing: 0.05em; }
.product-name { font-size: 0.875rem; font-weight: 500; margin-top: 0.25rem; line-height: 1.4; }
.product-card:hover .product-name { color: var(--color-navy); }
.product-price { font-size: 0.875rem; font-weight: 500; margin-top: 0.25rem; }
.product-price-old { font-size: 0.75rem; color: var(--color-muted); text-decoration: line-through; margin-left: 0.5rem; }
.product-stock { font-size: 0.75rem; margin-top: 0.25rem; }
.stock-in { color: #16a34a; }
.stock-low { color: #d97706; }
.stock-out { color: var(--color-muted); }

/* ===== 分類標籤 ===== */
.category-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.category-tag {
  padding: 0.5rem 1rem; font-size: 0.875rem; letter-spacing: 0.05em;
  border: 1px solid #e5e7eb; background: white; cursor: pointer;
  transition: all var(--transition); text-decoration: none; color: inherit;
}
.category-tag:hover, .category-tag.active {
  background: var(--color-navy); color: white; border-color: var(--color-navy);
}

/* ===== 篩選列 ===== */
.filter-bar { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
@media (min-width: 640px) { .filter-bar { flex-direction: row; justify-content: space-between; align-items: center; } }
.search-box { position: relative; width: 100%; max-width: 288px; }
.search-box input {
  width: 100%; padding: 0.625rem 1rem 0.625rem 2.5rem;
  border: 1px solid #e5e7eb; font-size: 0.875rem;
}
.search-box svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--color-muted); }

/* ===== 花色入口（單排 2～4 個，超出橫向捲動） ===== */
.category-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.category-grid > .category-card {
  flex: 0 0 calc((100% - 1rem) / 2);
  scroll-snap-align: start;
  min-width: 0;
}
.category-grid > .category-grid-empty {
  flex: 1 1 100%;
  text-align: center;
}
@media (min-width: 768px) {
  .category-grid { gap: 1.25rem; }
  .category-grid > .category-card { flex: 0 0 calc((100% - 2.5rem) / 3); }
}
@media (min-width: 1024px) {
  .category-grid { gap: 1.5rem; }
  .category-grid > .category-card { flex: 0 0 calc((100% - 4.5rem) / 4); }
}
.category-card {
  position: relative; overflow: hidden;
  aspect-ratio: 3/4; background: white; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 1.5rem;
  transition: box-shadow 0.3s;
}
.category-card-has-img { padding: 0; color: white; }
.category-card-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.category-card-has-img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(23,35,95,0.75) 0%, rgba(23,35,95,0.15) 55%, transparent 100%);
}
.category-card-has-img .category-code,
.category-card-has-img .category-name { position: relative; z-index: 1; color: white; }
.category-card-has-img .category-name { color: rgba(255,255,255,0.85); }
.category-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.category-code { font-family: var(--font-serif); font-size: 1.75rem; color: var(--color-navy); transition: transform 0.3s; }
@media (min-width: 1024px) { .category-code { font-size: 2rem; } }
.category-card:hover .category-code { transform: scale(1.1); }
.category-name { margin-top: 0.5rem; font-size: 0.75rem; color: var(--color-muted); letter-spacing: 0.05em; }

/* ===== 特色區塊 ===== */
.features-grid { display: grid; gap: 2.5rem; text-align: center; }
@media (min-width: 768px) { .features-grid { grid-template-columns: repeat(3, 1fr); gap: 4rem; } }
.feature-icon {
  width: 48px; height: 48px; margin: 0 auto 1rem; border-radius: 50%;
  background: rgba(23,35,95,0.05); display: flex; align-items: center; justify-content: center;
}
.feature-icon::after { content: ""; width: 24px; height: 24px; border-radius: 50%; background: rgba(23,35,95,0.2); }
.feature-title { font-size: 0.875rem; font-weight: 500; letter-spacing: 0.05em; }
.feature-desc { margin-top: 0.5rem; font-size: 0.875rem; color: var(--color-muted); line-height: 1.7; }

/* ===== 消息卡片 ===== */
.news-grid { display: grid; gap: 2rem; }
@media (min-width: 768px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
.news-card {
  padding: 1.5rem; border: 1px solid #f3f4f6; transition: border-color var(--transition);
}
.news-card:hover { border-color: rgba(23,35,95,0.2); }
.news-date { font-size: 0.75rem; color: var(--color-muted); letter-spacing: 0.05em; }
.news-title { margin-top: 0.5rem; font-size: 1.125rem; font-weight: 500; }
.news-card:hover .news-title { color: var(--color-navy); }
.news-excerpt { margin-top: 0.5rem; font-size: 0.875rem; color: var(--color-muted); }

/* ===== 門市資訊 ===== */
.store-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 768px) { .store-grid { grid-template-columns: 1fr 1fr; gap: 3rem; } }
.store-map { aspect-ratio: 4/3; background: #e5e7eb; overflow: hidden; }
.store-map iframe { width: 100%; height: 100%; border: 0; }
.store-info-item { display: flex; gap: 1rem; margin-bottom: 1.5rem; align-items: flex-start; }
.store-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(23, 35, 95, 0.06);
  color: var(--color-navy);
  flex-shrink: 0;
}
.store-info-icon svg { width: 20px; height: 20px; }
.store-info-item h3 { font-size: 0.875rem; font-weight: 500; }
.store-info-item p { font-size: 0.875rem; color: var(--color-muted); margin-top: 0.25rem; }

/* ===== 商品詳情 ===== */
.product-detail { display: grid; gap: 2.5rem; padding: 2rem 0 4rem; }
@media (min-width: 1024px) { .product-detail { grid-template-columns: 1fr 1fr; gap: 4rem; padding: 4rem 0; } }
.product-gallery-main { aspect-ratio: 1; background: var(--color-gray); overflow: hidden; }
.product-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.product-thumbs { display: flex; gap: 0.5rem; margin-top: 1rem; overflow-x: auto; }
.product-thumb {
  width: 80px; height: 80px; flex-shrink: 0; background: var(--color-gray);
  border: 2px solid transparent; cursor: pointer; overflow: hidden;
}
.product-thumb.active { border-color: var(--color-navy); }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-name { font-family: var(--font-serif); font-weight: 300; font-size: 1.75rem; margin-top: 0.5rem; }
@media (min-width: 1024px) { .product-detail-name { font-size: 2rem; } }
.product-detail-price { font-size: 1.5rem; font-weight: 500; margin-top: 1.5rem; }
.qty-control { display: flex; align-items: center; border: 1px solid #e5e7eb; width: fit-content; margin-top: 2rem; }
.qty-control button { padding: 0.5rem 0.75rem; background: none; border: none; cursor: pointer; }
.qty-control button:hover { background: var(--color-gray); }
.qty-control span { padding: 0.5rem 1rem; min-width: 3rem; text-align: center; font-size: 0.875rem; }
.product-actions { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 2rem; }
@media (min-width: 640px) { .product-actions { flex-direction: row; } }
.product-actions .btn { flex: 1; }
.product-meta { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid #f3f4f6; }
.product-meta h3 { font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; }
.product-meta p, .product-meta dl { font-size: 0.875rem; color: var(--color-muted); }
.product-meta dl { display: grid; gap: 0.25rem; }
.product-meta dt { display: inline; color: var(--color-muted); }
.product-meta dt::after { content: "："; }
.product-meta dd { display: inline; color: var(--color-black); }
.product-tabs { margin-top: 4rem; }
.product-tabs section { margin-bottom: 3rem; }
.product-tabs h2 { font-family: var(--font-serif); font-weight: 300; font-size: 1.25rem; margin-bottom: 1rem; }
.product-tabs p { font-size: 0.875rem; color: var(--color-muted); line-height: 1.8; white-space: pre-line; }

/* ===== 購物車 ===== */
.cart-item { display: flex; gap: 1rem; padding-bottom: 1.5rem; border-bottom: 1px solid #f3f4f6; margin-bottom: 1.5rem; }
.cart-item-image { width: 96px; height: 96px; flex-shrink: 0; background: var(--color-gray); overflow: hidden; }
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.875rem; font-weight: 500; }
.cart-item-price { font-size: 0.875rem; margin-top: 0.25rem; }
.cart-item-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 0.75rem; }
.cart-summary { background: var(--color-gray); padding: 1.5rem; position: sticky; top: calc(var(--header-height) + 1rem); }
.cart-summary h2 { font-size: 0.875rem; font-weight: 500; margin-bottom: 1rem; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.875rem; margin-bottom: 0.5rem; }
.summary-row .label { color: var(--color-muted); }
.summary-row.discount .label { color: #059669; }
.summary-row.discount span:last-child { color: #059669; }
.coupon-section { padding-bottom: 1rem; border-bottom: 1px solid #e5e7eb; margin-bottom: 1rem; }
.coupon-row { display: flex; gap: 0.5rem; }
.coupon-row .form-input { flex: 1; min-width: 0; }
.coupon-msg { font-size: 0.75rem; margin-top: 0.5rem; }
.coupon-msg.success { color: #059669; }
.coupon-msg.error { color: #dc2626; }
.summary-total { display: flex; justify-content: space-between; font-weight: 500; padding-top: 1rem; margin-top: 1rem; border-top: 1px solid #e5e7eb; }
.summary-note { font-size: 0.75rem; color: var(--color-muted); margin-top: 0.5rem; }
.cart-layout { display: grid; gap: 2.5rem; }
@media (min-width: 1024px) { .cart-layout { grid-template-columns: 2fr 1fr; } }

/* ===== 結帳步驟 ===== */
.checkout-steps { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 2.5rem; font-size: 0.875rem; }
.checkout-steps .step-done { color: var(--color-muted); }
.checkout-steps .step-active { color: var(--color-navy); font-weight: 500; }
.checkout-steps .arrow { color: var(--color-muted); }
.payment-option { padding: 1rem; border: 2px solid var(--color-navy); background: rgba(23,35,95,0.05); }
.payment-option p:first-child { font-size: 0.875rem; font-weight: 500; }
.payment-option p:last-child { font-size: 0.75rem; color: var(--color-muted); margin-top: 0.25rem; }

/* ===== 會員中心 ===== */
.member-menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (min-width: 1024px) { .member-menu { grid-template-columns: repeat(4, 1fr); } }
.member-card {
  padding: 1.5rem; border: 1px solid #f3f4f6; transition: all var(--transition);
  background: white;
}
.member-card:hover { border-color: rgba(23,35,95,0.2); box-shadow: 0 4px 16px rgba(23,35,95,0.06); }
.member-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(23, 35, 95, 0.06);
  color: var(--color-navy);
  transition: background var(--transition), color var(--transition);
}
.member-card:hover .member-card-icon { background: var(--color-navy); color: white; }
.member-card svg { width: 22px; height: 22px; }
.member-card h2 { font-size: 0.875rem; font-weight: 500; margin-top: 1rem; }
.member-card p { font-size: 0.75rem; color: var(--color-muted); margin-top: 0.25rem; }

/* ===== 會員訂單 ===== */
.member-order-card {
  background: white; border: 1px solid #f3f4f6; padding: 1.5rem; margin-bottom: 1.5rem;
}
.member-order-head {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem;
}
.member-order-no { font-size: 0.875rem; font-weight: 500; }
.member-order-date { font-size: 0.75rem; color: var(--color-muted); margin-top: 0.25rem; }
.member-order-status {
  padding: 0.25rem 0.75rem; font-size: 0.75rem; background: var(--color-gray);
  color: var(--color-navy); border-radius: 999px; align-self: flex-start;
}
.member-order-meta { font-size: 0.75rem; color: var(--color-muted); margin-top: 0.5rem; line-height: 1.6; }
.member-order-section-title {
  font-size: 0.8125rem; font-weight: 500; margin: 1.25rem 0 0.5rem; color: var(--color-navy);
}
.member-order-detail-row {
  display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0;
  font-size: 0.875rem; border-bottom: 1px solid #f3f4f6;
}
.member-order-detail-row span:first-child { color: var(--color-muted); flex-shrink: 0; }
.member-order-detail-row span:last-child { text-align: right; }
.member-order-detail-total { border-bottom: none; padding-top: 0.75rem; }
.member-order-atm {
  margin-top: 1rem; padding: 1rem; background: var(--color-gray); border-radius: 4px;
}
.guest-order-panel {
  background: white;
  border: 1px solid #f3f4f6;
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
}
.guest-order-panel-title { font-size: 1.125rem; font-weight: 500; }
.guest-order-form { display: grid; gap: 1rem; }
.guest-order-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
}
.guest-order-message-error { background: #fee2e2; color: #991b1b; }
.guest-order-message-info { background: #f3f4f6; color: #374151; }

/* ===== 會員：收藏 ===== */
.favorite-card {
  position: relative;
  background: white;
  border: 1px solid #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}
.favorite-card-inactive { opacity: 0.65; }
.favorite-card-link { display: block; color: inherit; }
.favorite-card-image {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--color-gray);
}
.favorite-card-image img { width: 100%; height: 100%; object-fit: cover; }
.favorite-card-body { padding: 1rem; }
.favorite-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: #6b7280;
  cursor: pointer;
  font-size: 0.875rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.favorite-remove:hover { color: #ef4444; }

/* ===== 會員：收件地址 ===== */
.address-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.address-card {
  background: white;
  border: 1px solid #f3f4f6;
  border-radius: 4px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.address-card-default { border-color: rgba(23,35,95,0.25); }
.address-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.address-label { font-weight: 500; font-size: 0.9375rem; }
.address-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  background: var(--color-navy);
  color: white;
  border-radius: 2px;
}
.address-card-actions { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.address-recipient { font-size: 0.875rem; margin-top: 0.75rem; }
.address-line { font-size: 0.8125rem; color: var(--color-muted); margin-top: 0.375rem; line-height: 1.6; }
.address-form-panel {
  background: white;
  border: 1px solid #f3f4f6;
  border-radius: 4px;
  padding: 1.5rem;
}
.address-form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.saved-address-list { display: grid; gap: 0.75rem; }
.checkout-check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
}
.checkout-check-label input { width: 1rem; height: 1rem; accent-color: var(--color-navy); }
.saved-address-option {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem;
  background: white;
  border: 1px solid #f3f4f6;
  border-radius: 4px;
  cursor: pointer;
}
.saved-address-option:has(input:checked) { border-color: rgba(23,35,95,0.35); }
.saved-address-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  cursor: pointer;
}
.text-danger { color: #ef4444 !important; }

/* ===== 後台 ===== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  display: none; width: 256px; background: var(--color-navy); color: white;
  padding: 1.5rem; flex-shrink: 0; flex-direction: column;
}
@media (min-width: 1024px) { .admin-sidebar { display: flex; } }
.admin-sidebar a {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem;
  font-size: 0.875rem; color: rgba(255,255,255,0.7); border-radius: 2px;
  margin-bottom: 0.25rem; transition: all var(--transition);
}
.admin-sidebar a:hover { color: white; background: rgba(255,255,255,0.1); }
.admin-main { flex: 1; padding: 1.5rem; background: var(--color-gray); }
@media (min-width: 1024px) { .admin-main { padding: 2.5rem; } }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2rem; }
@media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: white; padding: 1.5rem; border: 1px solid #f3f4f6; }
.stat-card p:first-child { font-size: 0.75rem; color: var(--color-muted); }
.stat-card p:last-child { font-size: 1.5rem; font-weight: 300; margin-top: 0.5rem; }

.admin-brand {
  display: block;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}
.admin-brand-logo {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
}
.admin-nav { display: flex; flex-direction: column; flex: 1; }
.admin-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  opacity: 0.85;
}
.admin-nav-icon svg { width: 100%; height: 100%; }
.admin-sidebar a.active .admin-nav-icon { opacity: 1; }
.admin-sidebar a.active { color: white; background: rgba(255,255,255,0.12); }
.admin-sidebar-footer {
  margin-top: auto; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1);
}
.admin-sidebar-footer a {
  font-size: 0.75rem; color: rgba(255,255,255,0.4); display: block; margin-bottom: 0.75rem;
}
.admin-logout-btn {
  background: none; border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.7);
  padding: 0.5rem 0.75rem; font-size: 0.75rem; width: 100%; cursor: pointer; border-radius: 2px;
}
.admin-logout-btn:hover { color: white; border-color: rgba(255,255,255,0.4); }
.admin-mobile-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--color-navy); color: white; padding: 0.875rem 1rem;
}
.admin-mobile-logo {
  display: block;
  width: auto;
  max-width: 160px;
  height: 32px;
  object-fit: contain;
  object-position: left center;
}
@media (min-width: 1024px) { .admin-mobile-bar { display: none; } }
.admin-menu-btn {
  background: none; border: none; color: white; font-size: 1.25rem; cursor: pointer; padding: 0.25rem;
}
@media (max-width: 1023px) {
  .admin-sidebar {
    display: flex; position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
    transform: translateX(-100%); transition: transform 0.25s ease;
  }
  .admin-layout.sidebar-open .admin-sidebar { transform: translateX(0); }
  .admin-layout.sidebar-open::before {
    content: ""; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 40;
  }
}
.admin-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem;
}
.admin-table-wrap { background: white; border: 1px solid #f3f4f6; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 640px; }
.admin-table th, .admin-table td {
  padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid #f3f4f6; vertical-align: middle;
}
.admin-table th {
  font-size: 0.75rem; font-weight: 500; color: var(--color-muted);
  background: #fafafa; white-space: nowrap;
}
.admin-table tr:hover td { background: #fafafa; }
.admin-table .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.admin-panel {
  background: white; border: 1px solid #f3f4f6; padding: 1.5rem; margin-top: 1rem;
}
.admin-panel h2 { font-size: 1rem; font-weight: 500; margin-bottom: 1rem; }
.admin-badge {
  display: inline-block; padding: 0.125rem 0.5rem; border-radius: 999px;
  font-size: 0.6875rem; font-weight: 500; white-space: nowrap;
}
.admin-badge-pending { background: #fef3c7; color: #92400e; }
.admin-badge-success { background: #dcfce7; color: #166534; }
.admin-badge-info { background: #dbeafe; color: #1e40af; }
.admin-badge-muted { background: #f3f4f6; color: #6b7280; }
.admin-badge-danger { background: #fee2e2; color: #991b1b; }
.admin-form-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .admin-form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.admin-check-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.5rem; }
.admin-check-row label { display: flex; align-items: center; gap: 0.375rem; font-size: 0.875rem; }
.admin-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.admin-modal {
  background: white; max-width: 720px; width: 100%; max-height: 90vh;
  overflow-y: auto; padding: 1.5rem; border-radius: 4px;
}
.admin-modal-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem;
}
.admin-modal-close {
  background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--color-muted); line-height: 1;
}
.admin-toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200;
  padding: 0.75rem 1.25rem; border-radius: 4px; font-size: 0.875rem;
  opacity: 0; transform: translateY(0.5rem); transition: all 0.25s ease; pointer-events: none;
}
.admin-toast.show { opacity: 1; transform: translateY(0); }
.admin-toast-success { background: var(--color-navy); color: white; }
.admin-toast-error { background: #991b1b; color: white; }
.admin-forbidden { max-width: 28rem; }
.admin-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 2px; background: #f3f4f6; }
.admin-banner-preview {
  display: block; max-width: 100%; max-height: 200px; margin-top: 0.75rem;
  border-radius: 4px; border: 1px solid #f3f4f6; object-fit: contain; background: #fafafa;
}
.admin-banner-preview[hidden] { display: none; }
.admin-product-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.admin-product-images:empty::before {
  content: "尚未上傳圖片";
  font-size: 0.8125rem;
  color: var(--color-muted);
}
.admin-product-image-card {
  width: 120px;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}
.admin-product-image-card.is-primary { border-color: var(--color-navy); box-shadow: 0 0 0 1px var(--color-navy); }
.admin-product-image-card img {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
  background: #f3f4f6;
}
.admin-product-image-meta {
  padding: 0.375rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.admin-product-image-badge {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-navy);
}
.admin-product-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.admin-product-image-actions button {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 4px;
  cursor: pointer;
}
.admin-product-image-actions button:hover { border-color: var(--color-navy); color: var(--color-navy); }
.admin-detail-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; font-size: 0.875rem; border-bottom: 1px solid #f3f4f6; }
.admin-detail-row span:first-child { color: var(--color-muted); flex-shrink: 0; }
.admin-order-items { margin-top: 1rem; }
.admin-order-items li { font-size: 0.875rem; padding: 0.375rem 0; color: var(--color-muted); }

/* ===== 空狀態 ===== */
.empty-state { text-align: center; padding: 5rem 1rem; }
.empty-state svg { width: 48px; height: 48px; color: var(--color-muted); margin: 0 auto; }
.empty-state h2 { font-family: var(--font-serif); font-weight: 300; font-size: 1.5rem; margin-top: 1rem; }
.empty-state p { font-size: 0.875rem; color: var(--color-muted); margin-top: 0.5rem; }
.empty-state .btn { margin-top: 2rem; }

/* ===== 工具 ===== */
.text-center { text-align: center; }
.text-muted { color: var(--color-muted); }
.text-navy { color: var(--color-navy); }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.prose { max-width: 48rem; margin: 0 auto; }
.prose p { font-size: 0.875rem; color: var(--color-muted); line-height: 1.8; margin-bottom: 1rem; }
.back-link { font-size: 0.875rem; color: var(--color-navy); }
.back-link:hover { text-decoration: underline; }

/* ===== 動畫 ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.animate-fade { animation: fadeIn 0.6s ease; }

/* 隱藏前台 header/footer 在後台 */
body.admin-page .site-header,
body.admin-page .site-footer { display: none; }
body.admin-page main { flex: 1; }
