/* ============================================================
   组件库 — Hero / Banner / Section / Modal
   ============================================================ */

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-6);
  color: #fff;
  background:
    radial-gradient(80% 60% at 20% 20%, rgba(255,255,255,0.15), transparent 60%),
    linear-gradient(135deg, var(--brand-400), var(--brand-700));
  min-height: 320px;
  display: flex; align-items: center;
}
.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: var(--weight-bold); line-height: var(--leading-tight);
  margin-bottom: var(--space-3);
}
/* 双色标题：前一行保持白色，强调词用草木绿呼应"自然"主题 */
.hero h1 .hero-accent {
  color: var(--leaf-300);
  text-shadow: 0 1px 3px rgba(60, 40, 20, 0.35);
}
.hero p { font-size: var(--text-lg); max-width: 36em; opacity: 0.92; margin-bottom: var(--space-6); }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.hero .hero-visual {
  position: absolute; right: -20px; bottom: -30px;
  width: 50%; max-width: 360px; aspect-ratio: 1; opacity: 0.85;
  pointer-events: none;
}
@media (min-width: 768px) {
  .hero { padding: var(--space-16) var(--space-10); min-height: 380px; }
  .hero .hero-visual { right: var(--space-8); bottom: var(--space-4); }
}

/* ---------- Section ---------- */
.section { padding: var(--space-10) 0; }
.section-head {
  display: flex; align-items: end; justify-content: space-between; gap: var(--space-4);
  margin-bottom: var(--space-6); flex-wrap: wrap;
}
.section-head h2 {
  font-size: var(--text-2xl); font-weight: var(--weight-bold);
  color: var(--color-text-strong); line-height: var(--leading-tight);
}
.section-head .sub { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-1); }

/* ---------- Promo strip ---------- */
.promo-strip {
  display: grid; gap: var(--space-3);
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) { .promo-strip { grid-template-columns: repeat(4, 1fr); } }
.promo-strip .card {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4); background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  font-size: var(--text-sm); transition: all var(--dur-fast);
}
.promo-strip .card:hover { border-color: var(--brand-300); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.promo-strip .ic {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-50); color: var(--brand-600); flex: none;
}
.promo-strip .card strong { display: block; color: var(--color-text-strong); font-weight: var(--weight-semibold); margin-bottom: 2px; }

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(28,25,23,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: end; justify-content: center;
  animation: fade-in var(--dur-fast) var(--ease-out);
}
@media (min-width: 768px) { .modal-mask { align-items: center; } }
.modal {
  background: var(--color-surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%; max-width: 560px; max-height: 90vh; overflow: auto;
  padding: var(--space-6);
  animation: slide-up var(--dur-normal) var(--ease-out);
}
@media (min-width: 768px) {
  .modal { border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.modal-head h3 { font-size: var(--text-xl); font-weight: var(--weight-bold); color: var(--color-text-strong); }
.modal-foot { display: flex; gap: var(--space-3); margin-top: var(--space-6); }
.modal-foot .btn { flex: 1; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- 侧边栏（购物车抽屉）---------- */
.drawer {
  position: fixed; inset: 0; z-index: 100;
  display: flex; pointer-events: none;
}
.drawer-mask { position: absolute; inset: 0; background: rgba(28,25,23,0); transition: background var(--dur-normal); }
.drawer-panel {
  position: relative; margin-left: auto;
  width: 100%; max-width: 440px; height: 100%;
  background: var(--color-surface);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform var(--dur-normal) var(--ease-out);
}
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-mask { background: rgba(28,25,23,0.5); }
.drawer.open .drawer-panel { transform: translateX(0); }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: var(--space-1); overflow-x: auto;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  padding: var(--space-3) var(--space-4); min-height: 44px;
  font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--color-text-muted);
  position: relative; white-space: nowrap;
}
.tabs button:hover { color: var(--color-text-strong); }
.tabs button.active { color: var(--brand-700); font-weight: var(--weight-semibold); }
.tabs button.active::after {
  content: ''; position: absolute; left: 50%; bottom: -1px;
  width: 24px; height: 3px; border-radius: 3px;
  background: var(--brand-500); transform: translateX(-50%);
}
