/* ===== Design Tokens ===== */
:root {
  --primary: #164c3e;
  --primary-dark: #0c2e24;
  --primary-light: #e8f5f0;
  --primary-gradient: linear-gradient(135deg, #164c3e 0%, #1a5c4b 100%);
  --accent: #c9952e;
  --accent-light: #fff8e8;
  --gold: #c9952e;
  --gold-light: #fff8e8;
  --green: #00B578;
  --green-light: #E8F9F0;
  --red: #e53e3e;
  --red-light: #ffe5e5;
  --bg: #f5f5f5;
  --bg-white: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #E0E0E0;
  --border-light: #F0F0F0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --shadow-glow: 0 4px 20px rgba(22,76,62,0.20);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --container: 1320px;
  --font: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --transition: 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; outline: none; }
input { outline: none; font-family: inherit; }

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

/* ===== Announcement Bar ===== */
.announcement {
  background: var(--primary-gradient);
  color: #fff;
  font-size: 13px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.announcement__wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  width: 100%;
  max-width: 720px;
  height: 38px;
  flex: 1 1 auto;
}
.announcement__list {
  position: relative;
  height: 38px;
  overflow: hidden;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.announcement__item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 38px;
  line-height: 38px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  opacity: 0;
  transition: opacity 0.5s ease;
  text-align: center;
}
.announcement__item.active {
  opacity: 1;
}
.announcement__close {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.2s;
}
.announcement__close:hover { color: #fff; }

/* ===== Top Bar ===== */
.topbar {
  background: #0c2e24;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  height: 34px;
}
.topbar__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
}
.topbar__left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar__left a { color: rgba(255,255,255,0.7); transition: color 0.2s; }
.topbar__left a:hover { color: #fff; }
.topbar__divider { color: rgba(255,255,255,0.3); margin: 0 2px; }
.topbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar__right a {
  color: rgba(255,255,255,0.7);
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.topbar__right a:hover { color: var(--gold); }
.msg-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 9px; min-width: 18px; height: 18px; padding: 0 5px;
  margin-left: 4px; vertical-align: middle;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,1);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}
.header.scrolled {
  background: rgba(22,76,62,1);
  box-shadow: 0 2px 20px rgba(0,0,0,0.12);
  border-color: transparent;
}
.header.scrolled .logo__text,
.header.scrolled .logo__text span { color: #fff; }
.header.scrolled .search-box input {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}
.header.scrolled .search-box input::placeholder { color: rgba(255,255,255,0.5); }
.header.scrolled .search-btn { color: rgba(255,255,255,0.7); }
.header.scrolled .nav a { color: rgba(255,255,255,0.75); }
.header.scrolled .nav a:hover { background: rgba(255,255,255,0.12); color: #fff; }
.header.scrolled .nav a.active { color: #fff; background: rgba(255,255,255,0.15); }
.header.scrolled .nav .cart-link { color: rgba(255,255,255,0.75); }
.header.scrolled .nav .cart-badge { background: var(--gold); }
.header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo__img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: var(--shadow-glow);
}
.logo__text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
}
.logo__text span { color: var(--primary); }

/* Search Box */
.search-box {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 48px 0 18px;
  border: 2px solid var(--border);
  border-radius: 21px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  transition: all var(--transition);
}
.search-box input:focus {
  border-color: var(--primary);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(22,76,62,0.08);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box .search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.2s;
}
.search-box .search-btn:hover { background: var(--primary-dark); }

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.nav a {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
}
.nav a:hover { background: var(--primary-light); color: var(--primary); }
.nav a.active { color: var(--primary); font-weight: 600; background: var(--primary-light); }
.nav .cart-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav .cart-link .cart-icon { font-size: 18px; }
.nav .cart-badge {
  position: absolute;
  top: 0;
  right: 6px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ===== Quick Nav Pills ===== */
.quick-nav {
  max-width: var(--container);
  margin: 8px auto 0;
  padding: 0 20px;
  display: flex;
  gap: 8px;
}
.quick-nav a {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 50px;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  transition: all 0.2s;
  white-space: nowrap;
}
.quick-nav a:hover { border-color: var(--primary); color: var(--primary); }

/* ===== Footer ===== */
.footer { background: var(--primary-dark); color: rgba(255,255,255,0.5); text-align: center; padding: 28px 24px; font-size: 13px; }

/* ===== Sidebar ===== */
.sidebar {
  width: 228px; flex-shrink: 0;
  position: sticky; top: 92px; height: fit-content;
  background: #fff; border-radius: 14px;
  box-shadow: 0 4px 12px rgba(22,76,62,0.08); overflow: hidden;
}
.sidebar-header {
  padding: 20px 20px 14px;
  font-size: 15px; font-weight: 700;
  color: #111827; display: flex; align-items: center; gap: 8px;
}
.sidebar-header svg { width: 20px; height: 20px; stroke: var(--primary); }
.sidebar-section { padding: 6px 0; }
.sidebar-divider { margin: 4px 16px; height: 1px; background: #eaecf0; }
.sidebar-label {
  padding: 8px 20px 4px; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: #8b919e;
}
.sidebar-group { position: relative; }
.sidebar-group-trigger {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; width: 100%;
  font-size: 13px; font-weight: 500; color: #4b5563;
  transition: all 0.2s; cursor: pointer; position: relative;
}
.sidebar-group-trigger:hover { color: var(--primary); background: var(--primary-light); }
.sidebar-group-trigger svg { width: 18px; height: 18px; }
.sidebar-group-trigger .group-arrow { margin-left: auto; width: 14px; height: 14px; transition: transform 0.3s; color: #8b919e; }
.sidebar-group.open .sidebar-group-trigger { color: var(--primary); font-weight: 600; }
.sidebar-group.open .sidebar-group-trigger .group-arrow { transform: rotate(90deg); }
.sidebar-group.open .sidebar-group-trigger::after {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; background: var(--primary); border-radius: 0 2px 2px 0;
}
.sidebar-children { overflow: hidden; max-height: 0; transition: max-height 0.35s cubic-bezier(0.22,1,0.36,1); }
.sidebar-group.open .sidebar-children { max-height: 400px; }
.sidebar-child {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px; font-size: 13px; color: #6b7280; font-weight: 400;
  transition: all 0.2s; cursor: pointer;
}
.sidebar-child:hover { color: var(--primary); background: var(--primary-light); }
.sidebar-child.active { color: var(--primary); font-weight: 600; background: var(--primary-light); }
.sidebar-child .child-dot { width: 5px; height: 5px; border-radius: 50%; background: #b3b8c2; flex-shrink: 0; transition: all 0.2s; }
.sidebar-child.active .child-dot { background: var(--primary); }
.sidebar-child .child-badge {
  margin-left: auto; background: #E8634A; color: #fff; font-size: 10px; font-weight: 600;
  min-width: 18px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.sidebar-solo {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; font-size: 13px; font-weight: 500; color: #4b5563;
  transition: all 0.2s; cursor: pointer; position: relative;
}
.sidebar-solo:hover { color: var(--primary); background: var(--primary-light); }
.sidebar-solo.active { color: var(--primary); font-weight: 600; background: var(--primary-light); }
.sidebar-solo.active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; background: var(--primary); border-radius: 0 2px 2px 0;
}
.sidebar-solo svg { width: 18px; height: 18px; }
.sidebar-solo .solo-badge {
  margin-left: auto; background: #E8634A; color: #fff; font-size: 10px; font-weight: 600;
  min-width: 18px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; margin-bottom: 16px; }
}
