/* ===== Thái Nguyên Farm ===== */
:root {
  --green-900: #1b3a2a;
  --green-700: #2e5d41;
  --green-600: #3a7452;
  --green-500: #4c9367;
  --green-100: #e3f1e8;
  --green-50: #f2f8f4;
  --amber: #d99e2b;
  --amber-dark: #b57f14;
  --red: #d9534f;
  --text: #22322a;
  --muted: #6b7d72;
  --bg: #fdfcf9;
  --card: #ffffff;
  --border: #e4ebe6;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(27, 58, 42, .10);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; }
img { max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 999px;
  font-weight: 600; font-size: 15px; border: none; transition: .2s;
}
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-600); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--green-700); border: 2px solid var(--green-700); }
.btn-ghost:hover { background: var(--green-100); }
.btn-block { width: 100%; text-align: center; }

/* ===== Header ===== */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 252, 249, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 500; color: var(--green-900); }
.logo b { color: var(--green-600); }
.logo-icon { font-size: 26px; }
.nav { display: flex; gap: 6px; margin-right: auto; }
.nav-link { padding: 8px 14px; border-radius: 999px; font-size: 15px; color: var(--muted); font-weight: 500; }
.nav-link:hover, .nav-link.active { background: var(--green-100); color: var(--green-900); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.search-box { position: relative; }
.search-box input {
  width: 240px; padding: 9px 14px 9px 38px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); font-size: 14px; outline: none;
}
.search-box input:focus { border-color: var(--green-500); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .6; }
.cart-btn {
  position: relative; font-size: 22px; background: var(--green-100);
  border: none; width: 44px; height: 44px; border-radius: 50%;
}
.cart-btn:hover { background: var(--green-500); }
.cart-badge {
  position: absolute; top: -4px; right: -6px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.menu-btn { display: none; font-size: 22px; background: none; border: none; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 55%, #4c8a5f 100%);
  color: #fff; overflow: hidden;
}
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; padding: 70px 20px; align-items: center; }
.hero-tag {
  display: inline-block; background: rgba(255,255,255,.14); padding: 7px 16px;
  border-radius: 999px; font-size: 14px; margin-bottom: 18px;
}
.hero h1 { font-size: 44px; line-height: 1.2; margin-bottom: 16px; }
.hero .accent { color: #ffd977; }
.hero p { color: #d8e8dd; max-width: 520px; margin-bottom: 26px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-cta .btn-ghost { color: #fff; border-color: rgba(255,255,255,.6); }
.hero-cta .btn-ghost:hover { background: rgba(255,255,255,.12); }
.hero-stats { display: flex; gap: 36px; margin-top: 38px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 24px; color: #ffd977; }
.hero-stats span { font-size: 13px; color: #c4dbca; }

.hero-visual { position: relative; height: 340px; }
.hero-circle {
  position: absolute; inset: 10% 5%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,217,119,.35), rgba(255,255,255,.06) 60%);
  border: 1px dashed rgba(255,255,255,.35);
}
.hero-card {
  position: absolute; background: rgba(255,255,255,.96); color: var(--text);
  border-radius: 14px; padding: 14px 18px; font-size: 30px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  animation: float 5s ease-in-out infinite;
}
.hero-card span { font-size: 13px; font-weight: 600; color: var(--green-700); white-space: nowrap; }
.float-1 { top: 6%; left: 12%; animation-delay: 0s; }
.float-2 { top: 42%; right: 4%; animation-delay: 1.4s; }
.float-3 { bottom: 4%; left: 22%; animation-delay: 2.8s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ===== USP ===== */
.usp { background: var(--card); border-bottom: 1px solid var(--border); }
.usp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 22px 20px; }
.usp-item { display: flex; align-items: center; gap: 12px; }
.usp-item span { font-size: 28px; }
.usp-item b { display: block; font-size: 14.5px; }
.usp-item small { color: var(--muted); font-size: 12.5px; }

/* ===== Sections ===== */
.section { padding: 64px 0; }
.section-head { text-align: center; margin-bottom: 34px; }
.section-head h2 { font-size: 32px; color: var(--green-900); }
.section-head p { color: var(--muted); margin-top: 6px; }

/* ===== Filter chips ===== */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 34px; }
.chip {
  padding: 9px 20px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); font-size: 14.5px; font-weight: 500; color: var(--muted); transition: .2s;
}
.chip:hover { border-color: var(--green-500); color: var(--green-700); }
.chip.active { background: var(--green-700); color: #fff; border-color: var(--green-700); }

/* ===== Product grid ===== */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.product-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: .25s; display: flex; flex-direction: column; position: relative;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--green-500); }
.product-img {
  height: 160px; display: flex; align-items: center; justify-content: center;
  font-size: 64px; cursor: pointer; transition: .3s;
}
.product-card:hover .product-img { transform: scale(1.08); }
.badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: #fff;
}
.badge-hot { background: var(--red); }
.badge-new { background: var(--green-600); }
.badge-sale { background: var(--amber-dark); }
.product-info { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.product-origin { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.product-name { font-size: 15px; font-weight: 600; cursor: pointer; line-height: 1.4; }
.product-name:hover { color: var(--green-600); }
.product-rating { font-size: 12.5px; color: var(--amber-dark); margin: 4px 0 8px; }
.product-rating i { color: var(--muted); font-style: normal; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.price { font-size: 17px; font-weight: 700; color: var(--green-700); }
.old-price { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.add-btn {
  margin-top: 12px; padding: 10px; border-radius: 10px; border: none;
  background: var(--green-100); color: var(--green-800, var(--green-700)); font-weight: 600; font-size: 14px; transition: .2s;
}
.add-btn:hover { background: var(--green-700); color: #fff; }
.empty-note { text-align: center; color: var(--muted); padding: 40px 0; font-size: 17px; }

/* ===== Story ===== */
.story { background: var(--green-50); }
.story-inner { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: center; }
.story-photo {
  height: 320px; border-radius: 24px; display: flex; align-items: center; justify-content: center;
  font-size: 90px; background: linear-gradient(145deg, #cde7d5, #7db894);
  box-shadow: var(--shadow);
}
.story-text h2 { font-size: 30px; color: var(--green-900); margin-bottom: 16px; }
.story-text p { color: #45564c; margin-bottom: 12px; }
.story-list { list-style: none; margin-top: 16px; }
.story-list li { padding: 6px 0; font-weight: 500; }

/* ===== Footer ===== */
.footer { background: var(--green-900); color: #c9dcd0; padding: 48px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr .8fr; gap: 32px; padding-bottom: 36px; }
.footer h4 { color: #fff; margin-bottom: 12px; }
.footer p { font-size: 14px; margin-bottom: 6px; }
.footer-logo { color: #fff; margin-bottom: 12px; }
.footer-logo b { color: #ffd977; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); text-align: center; padding: 18px; font-size: 13px; }

/* ===== Overlay / drawer / modal ===== */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 30, 22, .5); z-index: 90;
  opacity: 0; pointer-events: none; transition: .25s;
}
.overlay.show { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed; top: 0; right: -420px; width: 400px; max-width: 94vw; height: 100vh;
  background: var(--card); z-index: 100; display: flex; flex-direction: column;
  transition: right .3s ease; box-shadow: -8px 0 30px rgba(0,0,0,.15);
}
.cart-drawer.open { right: 0; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.drawer-head h3 { color: var(--green-900); font-size: 18px; }
.close-btn { background: var(--green-50); border: none; width: 34px; height: 34px; border-radius: 50%; font-size: 15px; }
.close-btn:hover { background: var(--green-100); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-empty { text-align: center; color: var(--muted); padding: 60px 0; }
.cart-empty span { font-size: 48px; display: block; margin-bottom: 10px; }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.cart-item-img {
  width: 62px; height: 62px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 14px; font-weight: 600; line-height: 1.35; }
.cart-item-price { font-size: 13.5px; color: var(--green-700); font-weight: 700; margin-top: 2px; }
.qty-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.qty-btn {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); font-size: 14px; font-weight: 700; line-height: 1;
}
.qty-btn:hover { background: var(--green-100); }
.qty-num { font-weight: 600; min-width: 20px; text-align: center; font-size: 14px; }
.remove-btn { margin-left: auto; background: none; border: none; font-size: 15px; opacity: .55; }
.remove-btn:hover { opacity: 1; }
.drawer-foot { padding: 16px 20px 20px; border-top: 1px solid var(--border); background: var(--green-50); }
.ship-note { font-size: 13px; color: var(--green-700); margin-bottom: 10px; min-height: 18px; }
.total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 15px; }
.total-row b { font-size: 20px; color: var(--green-900); }

.modal {
  position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: .25s; background: rgba(15, 30, 22, .5);
}
.modal.show { opacity: 1; pointer-events: auto; }
.modal-card {
  background: var(--card); border-radius: 20px; max-width: 720px; width: 100%;
  max-height: 90vh; overflow-y: auto; transform: translateY(16px); transition: .25s;
}
.modal.show .modal-card { transform: translateY(0); }

/* Product detail */
.detail-grid { display: grid; grid-template-columns: 1fr 1.1fr; }
.detail-img { display: flex; align-items: center; justify-content: center; font-size: 110px; min-height: 300px; border-radius: 20px 0 0 20px; }
.detail-info { padding: 28px; }
.detail-info h3 { font-size: 24px; color: var(--green-900); line-height: 1.3; }
.detail-origin { color: var(--muted); font-size: 13.5px; margin: 6px 0 10px; }
.detail-desc { font-size: 14.5px; color: #45564c; margin: 12px 0 18px; }
.detail-price { font-size: 26px; font-weight: 800; color: var(--green-700); }
.detail-actions { display: flex; gap: 12px; margin-top: 20px; align-items: center; }
.detail-close { position: sticky; top: 12px; float: right; margin: 12px; z-index: 5; }

/* Checkout */
.checkout-card { max-width: 480px; }
#checkoutForm { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
#checkoutForm label { font-size: 13.5px; font-weight: 600; color: var(--green-900); display: flex; flex-direction: column; gap: 5px; }
#checkoutForm input, #checkoutForm textarea {
  padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border);
  font-family: inherit; font-size: 14px; outline: none;
}
#checkoutForm input:focus, #checkoutForm textarea:focus { border-color: var(--green-500); }
.pay-options { display: flex; flex-direction: column; gap: 8px; }
.pay-option {
  flex-direction: row !important; align-items: center; gap: 10px !important;
  padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-weight: 500 !important; cursor: pointer;
}
.pay-option:has(input:checked) { border-color: var(--green-600); background: var(--green-50); }

/* Success */
.success-card { max-width: 420px; text-align: center; padding: 40px 30px; }
.success-icon { font-size: 60px; margin-bottom: 10px; }
.success-card h3 { font-size: 24px; color: var(--green-900); margin-bottom: 8px; }
.success-card p { margin-bottom: 10px; }
.success-card .muted { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 20px);
  background: var(--green-900); color: #fff; padding: 12px 24px; border-radius: 999px;
  font-size: 14.5px; z-index: 200; opacity: 0; pointer-events: none; transition: .3s;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; padding: 48px 20px; }
  .hero-visual { display: none; }
  .hero h1 { font-size: 34px; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .usp-grid { grid-template-columns: repeat(2, 1fr); }
  .story-inner { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .search-box input { width: 160px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-img { border-radius: 20px 20px 0 0; min-height: 200px; }
}
@media (max-width: 640px) {
  .nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--card); flex-direction: column; padding: 12px; border-bottom: 1px solid var(--border);
  }
  .nav.open { display: flex; }
  .menu-btn { display: block; }
  .search-box input { width: 130px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .hero-stats { gap: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
}
