:root {
  --green-dark: #0b5f34;
  --green: #14803e;
  --green-light: #1c9950;
  --green-pale: #e8f7ee;
  --white: #ffffff;
  --off-white: #f6f9f7;
  --red: #d9302f;
  --red-dark: #b12220;
  --text-dark: #182b22;
  --text-muted: #5c6b63;
  --border: #dfe9e2;
  --shadow: 0 4px 16px rgba(11, 95, 52, 0.08);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
  color: var(--text-dark);
  background: var(--off-white);
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

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

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 15px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--green);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(20,128,62,0.3);
}
.btn-primary:hover { background: var(--green-dark); }
.btn-outline {
  background: var(--white);
  color: var(--green);
  border: 2px solid var(--green);
}
.btn-outline:hover { background: var(--green-pale); }
.btn-block { width: 100%; }
.btn-small { padding: 8px 14px; font-size: 13px; margin-top: 4px; }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: var(--red-dark); }

/* ===== Header ===== */
.topbar { background: var(--green-dark); color: var(--white); font-size: 13px; }
.topbar-inner { padding: 6px 20px; text-align: center; }

.site-header { background: var(--white); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 20px;
  flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { font-size: 30px; }
.logo-text { font-size: 20px; font-weight: 800; color: var(--green-dark); }
.logo-text span { color: var(--red); }
.logo-text.light { color: var(--white); }
.logo-text.light span { color: #ff6b6b; }
.logo-sub { font-size: 11px; color: var(--text-muted); }

.search-bar { display: flex; flex: 1; max-width: 420px; }
.search-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-size: 14px;
}
.search-bar input:focus { outline: none; border-color: var(--green); }
.search-bar button {
  background: var(--green);
  color: white;
  border: none;
  padding: 0 16px;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
}

.header-actions { display: flex; gap: 18px; align-items: center; }
.header-icon-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 20px;
  color: var(--text-dark);
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
}
.header-icon-link small { font-size: 10px; color: var(--text-muted); }
.cart-count {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-nav { background: var(--green-dark); }
.nav-inner {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 20px;
}
.nav-item {
  padding: 12px 16px;
  color: var(--white);
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}
.nav-item:hover, .nav-item.active { border-bottom-color: var(--red); background: rgba(255,255,255,0.06); }

/* ===== Hero ===== */
.hero { background: linear-gradient(135deg, var(--green-pale), var(--white)); padding: 50px 0; }
.hero-inner { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; }
.hero-text { flex: 1; min-width: 300px; }
.hero-text h1 { font-size: 38px; color: var(--text-dark); line-height: 1.2; margin-bottom: 16px; }
.hero-text h1 span { color: var(--green); }
.hero-text p { color: var(--text-muted); font-size: 16px; margin-bottom: 24px; max-width: 480px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-badges {
  flex: 1;
  min-width: 280px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.badge-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 14px;
  border-top: 3px solid var(--red);
}
.badge-card span { display: block; font-size: 28px; margin-bottom: 8px; }

/* ===== Delivery Check ===== */
.delivery-check { background: var(--green-dark); padding: 30px 0; }
.delivery-check-inner { text-align: center; color: var(--white); }
.delivery-check-inner h3 { margin-bottom: 14px; font-size: 20px; }
.delivery-check-form { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.delivery-check-form input {
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  width: 260px;
  font-size: 14px;
}
#deliveryResult { margin-top: 14px; font-weight: 600; }

/* ===== Category tiles ===== */
.category-tiles {
  padding: 40px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}
.cat-tile {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 10px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s ease;
}
.cat-tile:hover { border-color: var(--green); }
.cat-tile .cat-icon { font-size: 30px; margin-bottom: 8px; }
.cat-tile .cat-name { font-weight: 700; font-size: 14px; color: var(--green-dark); }

/* ===== Shop / Product Grid ===== */
.shop-section { padding: 20px 20px 60px; }
.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.shop-header h2 { color: var(--green-dark); font-size: 26px; }
.filter-row select {
  padding: 10px 14px;
  border-radius: 8px;
  border: 2px solid var(--border);
  font-size: 14px;
  background: var(--white);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.15s ease;
}
.product-card:hover { transform: translateY(-3px); }
.product-img {
  width: 100%;
  height: 160px;
  background: var(--green-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  overflow: hidden;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.product-cat { font-size: 11px; color: var(--red); font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.product-name { font-weight: 700; font-size: 15px; margin-bottom: 6px; cursor: pointer; }
.product-name:hover { color: var(--green); }
.product-unit { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.product-price { font-size: 18px; font-weight: 800; color: var(--green-dark); margin-bottom: 10px; }
.out-of-stock-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--red); color: white;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
}
.add-to-cart-btn {
  background: var(--green);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  margin-top: auto;
}
.add-to-cart-btn:hover { background: var(--green-dark); }
.add-to-cart-btn:disabled { background: #ccc; cursor: not-allowed; }

/* ===== Cart Drawer ===== */
.cart-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
}
.cart-overlay.active { display: block; }
.cart-drawer {
  position: fixed;
  top: 0; right: -400px;
  width: 380px; max-width: 90vw;
  height: 100vh;
  background: var(--white);
  z-index: 100;
  transition: right 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}
.cart-drawer.active { right: 0; }
.cart-drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  background: var(--green-dark); color: white;
}
.cart-drawer-header button { background: none; border: none; color: white; font-size: 20px; cursor: pointer; }
.cart-items { flex: 1; overflow-y: auto; padding: 14px 20px; }
.cart-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: center; }
.cart-item-img { width: 50px; height: 50px; border-radius: 8px; background: var(--green-pale); flex-shrink: 0; display:flex; align-items:center; justify-content:center; overflow:hidden; font-size:20px;}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 14px; }
.cart-item-price { font-size: 13px; color: var(--text-muted); }
.cart-item-qty { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.cart-item-qty button {
  width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--border);
  background: var(--white); cursor: pointer; font-weight: 700;
}
.cart-item-remove { color: var(--red); font-size: 12px; cursor: pointer; background:none; border:none; margin-top:4px; }
.empty-cart-msg { text-align: center; color: var(--text-muted); padding: 40px 0; }

.cart-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.cart-total-row { display: flex; justify-content: space-between; font-size: 16px; margin-bottom: 8px; }
.min-order-note { font-size: 12px; color: var(--red); margin-bottom: 10px; }

/* ===== Product Detail ===== */
.product-detail-section { padding: 40px 20px; display: flex; gap: 40px; flex-wrap: wrap; }
.detail-img { flex: 1; min-width: 280px; }
.detail-img-box {
  background: var(--green-pale); border-radius: var(--radius);
  height: 360px; display: flex; align-items: center; justify-content: center;
  font-size: 60px; overflow: hidden;
}
.detail-img-box img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; min-width: 280px; }
.detail-info h1 { font-size: 26px; margin-bottom: 8px; color: var(--text-dark); }
.detail-price { font-size: 28px; font-weight: 800; color: var(--green-dark); margin: 12px 0; }
.detail-desc { color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.qty-selector { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.qty-selector button { width: 36px; height: 36px; border-radius: 8px; border: 2px solid var(--green); background: white; color: var(--green); font-size: 18px; font-weight: 700; cursor: pointer; }
.qty-selector span { font-size: 18px; font-weight: 700; min-width: 30px; text-align: center; }

/* ===== Checkout ===== */
.checkout-section { padding: 30px 20px 60px; }
.checkout-section h1 { color: var(--green-dark); margin-bottom: 24px; }
.checkout-grid { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.checkout-form-col { flex: 2; min-width: 320px; display: flex; flex-direction: column; gap: 20px; }
.checkout-summary-col { flex: 1; min-width: 300px; position: sticky; top: 90px; }
.checkout-card {
  background: var(--white); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.checkout-card h3 { color: var(--green-dark); margin-bottom: 16px; font-size: 17px; border-bottom: 2px solid var(--green-pale); padding-bottom: 10px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-dark); }
.form-row input, .form-row textarea {
  width: 100%; padding: 10px 12px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--green); }
.postcode-status { margin-top: 8px; font-size: 13px; font-weight: 600; }
.payment-option {
  display: flex; align-items: center; gap: 14px;
  border: 2px solid var(--green); background: var(--green-pale);
  border-radius: 10px; padding: 16px;
}
.payment-radio { color: var(--green); font-size: 20px; }
.payment-icon { font-size: 24px; margin-left: auto; }
.summary-card h3 { margin-bottom: 14px; }
.checkout-items { max-height: 220px; overflow-y: auto; margin-bottom: 14px; }
.checkout-item-row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; }
.summary-row.total { font-size: 18px; font-weight: 800; color: var(--green-dark); border-top: 2px solid var(--border); margin-top: 6px; padding-top: 10px; }
.min-order-warning { color: var(--red); font-size: 13px; font-weight: 600; margin: 8px 0; }
.secure-note { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 10px; }

/* ===== Confirmation ===== */
.confirmation-section { padding: 60px 20px; text-align: center; max-width: 600px; }
.confirm-icon { font-size: 60px; margin-bottom: 16px; }
.confirmation-section h1 { color: var(--green-dark); margin-bottom: 10px; }
.tracking-box {
  background: var(--white); border: 2px dashed var(--green);
  border-radius: var(--radius); padding: 20px; margin: 24px 0;
}
.tracking-code { font-size: 26px; font-weight: 800; color: var(--red); letter-spacing: 2px; }

/* ===== Track / Account ===== */
.track-section, .account-section { padding: 60px 20px; display: flex; justify-content: center; }
.track-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 30px; max-width: 500px; width: 100%; text-align: center;
}
.track-card h1 { color: var(--green-dark); margin-bottom: 8px; }
.track-card p { color: var(--text-muted); margin-bottom: 20px; font-size: 14px; }
.track-form { display: flex; gap: 10px; margin-bottom: 20px; }
.track-form input { flex: 1; padding: 12px; border-radius: 8px; border: 2px solid var(--border); }
.order-status-card { text-align: left; margin-top: 20px; border-top: 2px solid var(--border); padding-top: 20px; }
.status-pill {
  display: inline-block; padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 700; color: white;
}
.status-Pending { background: #e0a800; }
.status-Confirmed { background: var(--green); }
.status-Out-for-Delivery { background: #2196f3; }
.status-Delivered { background: var(--green-dark); }
.status-Cancelled { background: var(--red); }

/* ===== Footer ===== */
.site-footer { background: var(--green-dark); color: rgba(255,255,255,0.85); margin-top: 40px; }
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  padding: 40px 20px;
}
.footer-col h4 { color: white; margin-bottom: 14px; font-size: 15px; border-bottom: 2px solid var(--red); display: inline-block; padding-bottom: 6px; }
.footer-col a, .footer-col p { display: block; margin-bottom: 8px; font-size: 14px; color: rgba(255,255,255,0.75); }
.footer-col a:hover { color: white; }
.footer-bottom { text-align: center; padding: 16px; font-size: 12px; border-top: 1px solid rgba(255,255,255,0.15); }

@media (max-width: 768px) {
  .hero-text h1 { font-size: 28px; }
  .search-bar { order: 3; max-width: 100%; width: 100%; }
  .checkout-summary-col { position: static; }
}
