@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #689f38;
  --primary-dark: #558b2f;
  --primary-light: #f1f8e9;
  --secondary: #33691e;
  --accent: #ff6f00;
  --header-bg: #33691e;
  --header-top: #1b5e20;
  --text: #212121;
  --text-muted: #616161;
  --bg: #f5f5f5;
  --white: #ffffff;
  --border: #e0e0e0;
  --deal: #e65100;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--secondary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

.site-header { background: var(--white); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.header-top { background: var(--header-top); color: #c8e6c9; font-size: 0.8rem; }
.header-top a { color: #e8f5e9; }
.header-top-inner { display: flex; gap: 24px; padding: 8px 20px; flex-wrap: wrap; justify-content: flex-end; }
.header-main { display: flex; align-items: center; gap: 16px; padding: 12px 20px; flex-wrap: wrap; }
.logo { font-size: 1.9rem; font-weight: 800; color: var(--header-bg); flex-shrink: 0; }
.logo span { color: var(--primary); }
.header-search { flex: 1; max-width: 480px; display: flex; border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.header-search input { flex: 1; border: none; padding: 10px 16px; font-size: 0.95rem; outline: none; }
.header-search button { background: var(--primary); color: var(--white); border: none; padding: 10px 20px; font-weight: 700; cursor: pointer; }
.main-nav { display: flex; gap: 4px; align-items: center; }
.nav-link { color: var(--text); font-weight: 600; font-size: 0.9rem; padding: 8px 12px; border-radius: 6px; }
.nav-link:hover { background: var(--primary-light); color: var(--primary-dark); }
.nav-dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); min-width: 220px; box-shadow: var(--shadow-lg); padding: 8px 0; z-index: 50; }
.dropdown-menu a { display: block; padding: 10px 16px; color: var(--text); font-size: 0.88rem; }
.dropdown-menu a:hover { background: var(--primary-light); }
.nav-dropdown:hover .dropdown-menu { display: block; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cart-link { display: flex; align-items: center; gap: 6px; font-weight: 600; padding: 8px 14px; border: 2px solid var(--border); border-radius: var(--radius); color: var(--text); }
.cart-link:hover { border-color: var(--primary); color: var(--primary); }
.cart-badge { background: var(--accent); color: var(--white); font-size: 0.65rem; min-width: 18px; height: 18px; border-radius: 50%; display: none; align-items: center; justify-content: center; font-weight: 700; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

.btn { display: inline-block; padding: 10px 20px; border-radius: var(--radius); font-weight: 700; cursor: pointer; border: 2px solid transparent; font-size: 0.9rem; text-align: center; transition: all 0.2s; font-family: inherit; }
.btn-primary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }
.btn-outline { background: var(--white); color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.hero { background: linear-gradient(135deg, #1b5e20 0%, #388e3c 50%, #689f38 100%); color: var(--white); padding: 48px 0 64px; text-align: center; }
.hero h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 12px; font-weight: 800; }
.hero p { font-size: 1.05rem; opacity: 0.95; margin-bottom: 24px; }
.hero-search { max-width: 560px; margin: 0 auto 32px; display: flex; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-search input { flex: 1; border: none; padding: 14px 20px; font-size: 1rem; outline: none; color: var(--text); }
.hero-search button { background: var(--accent); color: var(--white); border: none; padding: 14px 28px; font-weight: 700; cursor: pointer; }
.hero-stats { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.stat { background: rgba(255,255,255,0.15); border-radius: var(--radius); padding: 14px 24px; }
.stat strong { display: block; font-size: 1.6rem; font-weight: 800; }
.stat span { font-size: 0.85rem; opacity: 0.9; }

.trust-strip { background: var(--white); border-bottom: 1px solid var(--border); padding: 12px 0; }
.trust-strip .container { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.trust-strip span::before { content: '✓ '; color: var(--primary); }

section { padding: 48px 0; }
.section-title { text-align: center; margin-bottom: 32px; }
.section-title h2 { font-size: 1.65rem; font-weight: 800; color: var(--header-bg); margin-bottom: 6px; }
.section-title p { color: var(--text-muted); }
.section-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.section-header-row h2 { font-size: 1.5rem; font-weight: 800; color: var(--header-bg); }
.view-all { font-weight: 600; color: var(--primary); }

.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.category-card { background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; border: 1px solid var(--border); }
.category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-card-photo { height: 140px; overflow: hidden; }
.cat-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.cat-card-body { padding: 16px; }
.cat-icon { font-size: 1.5rem; }
.cat-card-body h3 { font-size: 1.1rem; margin: 6px 0; color: var(--header-bg); }
.cat-card-body p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.cat-count { font-size: 0.85rem; font-weight: 600; color: var(--primary); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.product-card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.2s; position: relative; }
.product-card:hover { box-shadow: var(--shadow-lg); }
.product-badges { position: absolute; top: 8px; left: 8px; z-index: 2; display: flex; flex-direction: column; gap: 4px; }
.badge-discount { background: var(--deal); color: var(--white); font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.badge-deal { background: var(--primary); color: var(--white); font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.product-card-link { display: block; color: var(--text); flex: 1; }
.product-thumb { width: 100%; height: 160px; background: #fff; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border); }
.product-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8px; box-sizing: border-box; }
.product-thumb-fallback { font-size: 3rem; }
.product-card h3 { font-size: 0.92rem; font-weight: 700; padding: 10px 14px 0; line-height: 1.35; color: var(--text); }
.product-card .vendor { font-size: 0.78rem; color: var(--text-muted); padding: 0 14px; }
.pack-size { font-size: 0.8rem; color: var(--primary-dark); font-weight: 600; padding: 2px 14px; }
.rating { display: inline-block; background: var(--primary-light); color: var(--primary-dark); font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin: 6px 14px; }
.price-row { padding: 4px 14px 12px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.price-old { font-size: 0.85rem; color: var(--text-muted); text-decoration: line-through; }
.product-card-actions { display: flex; gap: 8px; padding: 0 14px 14px; }

.scroll-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.scroll-row .product-card { min-width: 220px; flex-shrink: 0; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tab-btn { padding: 8px 16px; border: 2px solid var(--border); background: var(--white); border-radius: 20px; font-weight: 600; cursor: pointer; font-size: 0.88rem; }
.tab-btn.active, .tab-btn:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }

.page-header { background: var(--white); border-bottom: 1px solid var(--border); padding: 24px 0; }
.page-header h1 { font-size: 1.75rem; font-weight: 800; color: var(--header-bg); }
.breadcrumb { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--primary); }

.category-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.category-sidebar { background: var(--white); border-radius: var(--radius-lg); padding: 20px; border: 1px solid var(--border); height: fit-content; }
.category-sidebar h3 { font-size: 1rem; margin-bottom: 12px; }
.category-sidebar a { display: block; padding: 8px 0; font-size: 0.9rem; color: var(--text); border-bottom: 1px solid var(--border); }
.category-sidebar a:hover, .category-sidebar a.active { color: var(--primary); font-weight: 600; }
.sort-bar { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.sort-bar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; }

.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; background: var(--white); padding: 32px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.product-detail-visual { background: #fafafa; border-radius: var(--radius); overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 320px; }
.product-detail-img { width: 100%; max-height: 400px; object-fit: contain; padding: 16px; }
.product-detail-info h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: 8px; }
.pack-size-lg { font-size: 1rem; color: var(--primary-dark); font-weight: 600; margin-bottom: 8px; }
.price-block { margin: 16px 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.price-large { font-size: 2rem; font-weight: 800; color: var(--primary-dark); }
.price-old-lg { font-size: 1.2rem; color: var(--text-muted); text-decoration: line-through; }
.product-desc { margin: 20px 0; color: var(--text-muted); }
.feature-list { margin-left: 20px; color: var(--text-muted); }
.feature-list li { margin-bottom: 6px; }

.cart-table { width: 100%; background: var(--white); border-radius: var(--radius-lg); border-collapse: collapse; overflow: hidden; border: 1px solid var(--border); }
.cart-table th, .cart-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.cart-table th { background: var(--primary-light); font-weight: 700; }
.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-control button { width: 28px; height: 28px; border: 1px solid var(--border); background: var(--white); border-radius: 4px; cursor: pointer; font-weight: 700; }
.btn-remove { background: none; border: none; color: #c62828; cursor: pointer; font-size: 1.1rem; }
.cart-summary { background: var(--white); padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); margin-top: 20px; max-width: 400px; margin-left: auto; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.2rem; margin-bottom: 16px; }
.delivery-note { font-size: 0.85rem; color: var(--primary); margin-bottom: 16px; }
.empty-cart { text-align: center; padding: 60px 20px; background: var(--white); border-radius: var(--radius-lg); }

.checkout-grid { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; }
.checkout-form, .checkout-summary { background: var(--white); padding: 28px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.checkout-form h2 { margin-bottom: 20px; font-size: 1.25rem; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; font-family: inherit; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#checkout-errors p { color: #c62828; font-size: 0.88rem; margin-bottom: 4px; }
.payment-methods { margin: 20px 0; }
.payment-option { display: flex; align-items: center; gap: 10px; padding: 12px; border: 2px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; cursor: pointer; }
.payment-option:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.payment-option input { width: auto; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.summary-row.total { font-weight: 800; font-size: 1.1rem; border-bottom: none; margin-top: 8px; }
.payment-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 12px; }

.success-box { text-align: center; background: var(--white); padding: 48px 32px; border-radius: var(--radius-lg); max-width: 560px; margin: 0 auto; border: 1px solid var(--border); }
.success-icon { width: 72px; height: 72px; background: var(--primary); color: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 20px; }
.cod-note { background: #fff3e0; color: #e65100; padding: 10px 16px; border-radius: var(--radius); margin: 12px 0; font-weight: 600; }
.order-details { text-align: left; margin: 24px 0; padding: 20px; background: var(--bg); border-radius: var(--radius); }
.order-total { margin-top: 12px; font-size: 1.1rem; }

.site-footer { background: var(--header-bg); color: #c8e6c9; padding: 48px 0 0; margin-top: 48px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.footer-logo { color: var(--white) !important; }
.footer-logo span { color: #a5d6a7; }
.footer-col h4 { color: var(--white); margin-bottom: 14px; font-size: 1rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #a5d6a7; font-size: 0.9rem; }
.footer-col a:hover { color: var(--white); }
.footer-contact { font-size: 0.88rem; line-height: 1.7; margin-top: 12px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); margin-top: 32px; padding: 16px 0; text-align: center; font-size: 0.82rem; }

.legal-page { background: var(--white); padding: 40px 0; min-height: 50vh; }
.legal-page h1 { font-size: 1.75rem; margin-bottom: 24px; color: var(--header-bg); }
.legal-body h2 { font-size: 1.15rem; margin: 24px 0 10px; color: var(--secondary); }
.legal-body p, .legal-body li { margin-bottom: 10px; color: var(--text-muted); line-height: 1.7; }
.legal-body ul { margin-left: 24px; margin-bottom: 16px; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.about-card { background: var(--white); padding: 32px; border-radius: var(--radius-lg); border: 1px solid var(--border); }

.faq-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.faq-question { width: 100%; text-align: left; padding: 16px 20px; background: none; border: none; font-weight: 600; cursor: pointer; font-size: 0.95rem; font-family: inherit; display: flex; justify-content: space-between; }
.faq-answer { display: none; padding: 0 20px 16px; color: var(--text-muted); font-size: 0.9rem; }
.faq-item.open .faq-answer { display: block; }

.toast { position: fixed; bottom: 24px; right: 24px; background: var(--header-bg); color: var(--white); padding: 12px 24px; border-radius: var(--radius); font-weight: 600; z-index: 200; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .checkout-grid, .product-detail-grid, .category-layout, .about-grid { grid-template-columns: 1fr; }
  .header-search { order: 3; max-width: 100%; width: 100%; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); flex-direction: column; padding: 16px; box-shadow: var(--shadow-lg); border-top: 1px solid var(--border); }
  .main-nav.open { display: flex; }
  .menu-toggle { display: block; }
  .category-sidebar { display: none; }
}
