/* ============ Variables ============ */
:root {
  --soil: #2C1810;
  --earth: #5D3A1A;
  --gold: #D4A853;
  --gold-light: #E8C87A;
  --cream: #F7F3EB;
  --warm-white: #FFFDF8;
  --peanut: #C4956A;
  --garlic: #E8DFD0;
  --shadow: rgba(44, 24, 16, 0.12);
  --radius: 12px;
  --radius-lg: 24px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--soil);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ============ Layout ============ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: 5rem 0; }

/* ============ Navigation ============ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(247, 243, 235, 0.95);
  backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid rgba(44, 24, 16, 0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Noto Serif TC', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--soil);
}

.logo-icon { font-size: 1.75rem; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-weight: 500;
  color: var(--earth);
  transition: color 0.3s;
}

.nav-links a:hover { color: var(--gold); }
.nav-links a.active { color: var(--soil); font-weight: 700; }

.cart-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-count {
  background: var(--gold);
  color: var(--soil);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 100px;
  min-width: 1.5rem;
  text-align: center;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary {
  background: var(--gold);
  color: var(--soil);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 168, 83, 0.4);
}

.btn-secondary {
  background: var(--cream);
  color: var(--soil);
  border: 1px solid var(--earth);
}

.btn-secondary:hover {
  background: var(--soil);
  color: var(--cream);
}

.btn-lg { padding: 1.125rem 2.5rem; font-size: 1.125rem; }
.btn-block { width: 100%; }

/* ============ Hero ============ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: 60px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--soil) 0%, var(--earth) 100%);
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23D4A853' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  text-align: center;
  z-index: 1;
  padding: 2rem;
}

.hero-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--soil);
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  border-radius: 100px;
}

.hero-title {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(4rem, 15vw, 8rem);
  font-weight: 900;
  color: var(--warm-white);
  line-height: 1;
  margin-bottom: 1rem;
  text-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.hero-title span { color: var(--gold); }

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--cream);
  font-weight: 300;
  letter-spacing: 0.2em;
  margin-bottom: 2.5rem;
}

/* ============ Section Headers ============ */
.section-header { text-align: center; margin-bottom: 3rem; }

.label {
  display: inline-block;
  color: var(--gold);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--soil);
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--earth);
  font-size: 1.0625rem;
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ============ Products ============ */
.products { background: var(--cream); }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.product-card {
  background: var(--warm-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 40px var(--shadow);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(44, 24, 16, 0.15);
}

.product-image {
  height: 280px;
  background: linear-gradient(135deg, var(--earth) 0%, var(--soil) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-image.peanut { background: linear-gradient(135deg, #8B6914 0%, #5D3A1A 100%); }
.product-image.garlic { background: linear-gradient(135deg, #E8DFD0 0%, #C4B5A0 100%); }

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-emoji {
  font-size: 6rem;
  opacity: 0.3;
  transition: all 0.5s;
}

.product-card:hover .product-emoji {
  transform: scale(1.1) rotate(5deg);
  opacity: 0.5;
}

.product-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--gold);
  color: var(--soil);
  padding: 0.375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 100px;
}

.product-content { padding: 1.5rem; }

.product-name {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--soil);
  margin-bottom: 0.25rem;
}

.product-subtitle {
  color: var(--earth);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.product-desc {
  color: #666;
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.product-price {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--soil);
}

.product-price span {
  font-size: 0.875rem;
  font-weight: 400;
  color: #999;
}

.btn-add-cart {
  background: var(--soil);
  color: var(--cream);
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-add-cart:hover {
  background: var(--gold);
  color: var(--soil);
  transform: scale(1.05);
}

/* ============ Story ============ */
.story { background: var(--soil); }

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: center;
}

.story-image {
  aspect-ratio: 4/5;
  background: linear-gradient(135deg, var(--earth) 0%, var(--peanut) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-icon { font-size: 8rem; opacity: 0.5; }

.story-content { color: var(--cream); }

.story-content .label { color: var(--gold); }

.story-content .section-title {
  color: var(--warm-white);
  margin-bottom: 1.5rem;
}

.story-text {
  color: rgba(247, 243, 235, 0.8);
  font-size: 1.0625rem;
  line-height: 2;
  margin-bottom: 2.5rem;
}

.story-stats {
  display: flex;
  gap: 3rem;
}

.stat { text-align: center; }

.stat-num {
  display: block;
  font-family: 'Noto Serif TC', serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold);
}

.stat-label {
  font-size: 0.875rem;
  color: rgba(247, 243, 235, 0.6);
}

/* ============ Features ============ */
.features { background: var(--warm-white); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--cream);
  padding: 2rem;
  border-radius: var(--radius);
  text-align: center;
  transition: all 0.4s;
  border: 2px solid transparent;
}

.feature-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
}

.feature-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.75rem;
}

.feature-card h3 {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: #666;
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* ============ CTA ============ */
.cta {
  background: linear-gradient(135deg, var(--soil) 0%, var(--earth) 100%);
  text-align: center;
  padding: 6rem 0;
}

.cta h2 {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--warm-white);
  margin-bottom: 1rem;
}

.cta p {
  color: rgba(247, 243, 235, 0.7);
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

/* ============ Footer ============ */
footer {
  background: #1a0f0a;
  padding: 4rem 0 2rem;
  color: rgba(247, 243, 235, 0.6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand h3 {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.9375rem;
  line-height: 1.8;
}

.footer-links h4 {
  color: var(--cream);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.footer-links a {
  display: block;
  padding: 0.375rem 0;
  color: rgba(247, 243, 235, 0.6);
  transition: color 0.3s;
}

.footer-links a:hover { color: var(--gold); }

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(247, 243, 235, 0.1);
  text-align: center;
  font-size: 0.875rem;
}

/* ============ Cart Page ============ */
.cart-page { padding-top: 100px; min-height: 100vh; }
.page-title { font-family: 'Noto Serif TC', serif; font-size: 2rem; margin-bottom: 2rem; color: var(--soil); }

.cart-container { background: white; border-radius: var(--radius-lg); padding: 2rem; box-shadow: 0 10px 40px var(--shadow); }
.cart-empty { text-align: center; padding: 4rem; color: #999; }
.cart-empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.5; }
.cart-empty h3 { font-size: 1.25rem; margin-bottom: 0.5rem; color: var(--earth); }
.cart-empty p { margin-bottom: 1.5rem; }

.cart-item { display: flex; gap: 1.5rem; padding: 1.5rem 0; border-bottom: 1px solid #eee; align-items: center; }
.cart-item:last-child { border-bottom: none; }
.cart-item-image { width: 100px; height: 100px; background: linear-gradient(135deg, var(--earth), var(--soil)); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 3rem; flex-shrink: 0; }
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 700; font-size: 1.125rem; margin-bottom: 0.25rem; }
.cart-item-price { color: var(--gold); font-weight: 600; }
.cart-item-controls { display: flex; align-items: center; gap: 1rem; }
.qty-btn { width: 32px; height: 32px; border: 1px solid #ddd; background: white; border-radius: 8px; cursor: pointer; font-size: 1.25rem; transition: all 0.2s; }
.qty-btn:hover { background: var(--cream); border-color: var(--earth); }
.qty-value { font-weight: 700; min-width: 2rem; text-align: center; }
.cart-item-remove { color: #dc3545; background: none; border: none; cursor: pointer; font-size: 0.875rem; padding: 0.5rem; }
.cart-item-total { font-weight: 700; font-size: 1.25rem; min-width: 100px; text-align: right; }

.cart-summary { margin-top: 2rem; padding-top: 2rem; border-top: 2px solid #eee; }
.cart-summary-row { display: flex; justify-content: space-between; margin-bottom: 0.75rem; font-size: 1.0625rem; }
.cart-summary-row.total { font-size: 1.5rem; font-weight: 700; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #eee; }
.cart-summary-row .label { color: var(--earth); }
.cart-summary-row .value { color: var(--soil); }
.cart-summary-row.total .value { color: var(--gold); font-size: 1.75rem; }

/* ============ Checkout ============ */
.checkout-page { padding-top: 100px; min-height: 100vh; padding-bottom: 4rem; }
.checkout-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2rem; }
.checkout-form { background: white; border-radius: var(--radius-lg); padding: 2rem; box-shadow: 0 10px 40px var(--shadow); }
.checkout-form h2 { font-family: 'Noto Serif TC', serif; font-size: 1.5rem; margin-bottom: 1.5rem; color: var(--soil); }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.5rem; color: var(--earth); }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 0.875rem 1rem; border: 1px solid #ddd; border-radius: var(--radius); font-size: 1rem; font-family: inherit; transition: border-color 0.3s; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--gold); }

.checkout-summary { background: white; border-radius: var(--radius-lg); padding: 2rem; box-shadow: 0 10px 40px var(--shadow); height: fit-content; position: sticky; top: 100px; }
.checkout-summary h2 { font-family: 'Noto Serif TC', serif; font-size: 1.5rem; margin-bottom: 1.5rem; color: var(--soil); }
.summary-item { display: flex; justify-content: space-between; padding: 0.75rem 0; border-bottom: 1px solid #eee; font-size: 0.9375rem; }
.summary-total { display: flex; justify-content: space-between; margin-top: 1.5rem; padding-top: 1rem; border-top: 2px solid var(--soil); font-size: 1.25rem; font-weight: 700; }
.total-price { color: var(--gold); font-size: 1.5rem; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .story-grid { grid-template-columns: 1fr; text-align: center; }
  .story-image { max-width: 400px; margin: 0 auto; }
  .story-stats { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .checkout-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .nav-links { gap: 1rem; }
  .products-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 3.5rem; }
  .cart-item { flex-wrap: wrap; }
  .cart-item-total { width: 100%; text-align: left; margin-top: 1rem; padding-left: calc(100px + 1.5rem); }
}

/* ============ Animations ============ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal { animation: fadeIn 0.6s ease forwards; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--soil);
  color: var(--cream);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
