/* =========================================================
   OEH Agrihorti Sdn. Bhd. — Green Nature / Coconut Theme
   ========================================================= */

:root {
  --deep-green: #163d2c;
  --green: #1f5e3f;
  --leaf-green: #2f8f5b;
  --lime: #8bc34a;
  --coconut-brown: #7a5230;
  --coconut-brown-dark: #5c3d21;
  --cream: #faf7ee;
  --cream-dark: #f1ead9;
  --ink: #1f2a20;
  --muted: #5b6b5c;
  --white: #ffffff;
  --danger: #b23b3b;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(22, 61, 44, 0.12);
  --shadow-sm: 0 2px 8px rgba(22, 61, 44, 0.10);
  --max-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

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

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--deep-green);
  margin: 0 0 12px;
  line-height: 1.25;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 14px; }

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--leaf-green);
  margin-bottom: 10px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--leaf-green);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--green); }

.btn-secondary {
  background: transparent;
  color: var(--deep-green);
  border-color: var(--deep-green);
}
.btn-secondary:hover { background: var(--deep-green); color: #fff; }

.btn-brown {
  background: var(--coconut-brown);
  color: #fff;
}
.btn-brown:hover { background: var(--coconut-brown-dark); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-small { padding: 8px 16px; font-size: 0.85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 238, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--cream-dark);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--deep-green);
}
.brand .logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--cream), 0 0 0 3px var(--cream-dark);
}
.brand .logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.brand small {
  display: block;
  font-family: "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.main-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav a.active { color: var(--leaf-green); border-color: var(--leaf-green); }

.header-actions { display: flex; align-items: center; gap: 14px; }

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--deep-green);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}
.cart-count {
  background: var(--lime);
  color: var(--deep-green);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  padding: 0 5px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--deep-green);
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: #fff;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--deep-green);
}
.hero img.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(15,40,26,0.25) 0%, rgba(11,31,20,0.55) 55%, rgba(9,26,17,0.88) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 60px 24px 70px;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}
.hero-content .eyebrow { color: var(--lime); }
.hero h1 { color: #fff; font-size: 3.2rem; max-width: 680px; }
.hero p.lead {
  color: #eef4ea;
  max-width: 560px;
  font-size: 1.1rem;
}
.hero-actions { display: flex; gap: 14px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Sections ---------- */
section { padding: 70px 0; }
.section-alt { background: var(--cream-dark); }
.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-head.left { margin: 0 0 40px; text-align: left; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }

/* category cards */
.cat-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: var(--cream-dark);
  box-shadow: var(--shadow);
}
.cat-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.cat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(10,30,20,0) 30%, rgba(8,24,16,0.85) 100%);
}
.cat-card .cat-body { position: relative; z-index: 2; padding: 22px; }
.cat-card h3 { color: #fff; margin-bottom: 4px; }
.cat-card span { color: var(--lime); font-weight: 700; font-size: 0.85rem; }

/* feature list */
.feature-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; text-align: center; }
.feature-item { background: #fff; border-radius: var(--radius); padding: 28px 18px; box-shadow: var(--shadow-sm); }
.feature-item .icon { font-size: 1.8rem; margin-bottom: 10px; }

/* ---------- Product cards ---------- */
.product-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.product-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex: 1 1 250px;
  max-width: 270px;
  width: 100%;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--cream-dark);
  position: relative;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--leaf-green);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.badge.out { background: var(--danger); }
.product-info { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-cat { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--leaf-green); font-weight: 700; }
.product-info h3 { font-size: 1.05rem; margin: 0; }
.product-desc { font-size: 0.87rem; color: var(--muted); flex: 1; }
.product-price-row { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-top: 10px; }
.product-price-row .btn { width: 100%; }
.price { font-size: 1.15rem; font-weight: 800; color: var(--coconut-brown-dark); }
.unit { font-size: 0.75rem; color: var(--muted); display: block; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.filter-chip {
  padding: 9px 18px;
  border-radius: 999px;
  border: 2px solid var(--cream-dark);
  background: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--muted);
}
.filter-chip.active { background: var(--deep-green); border-color: var(--deep-green); color: #fff; }

/* ---------- Testimonials / story ---------- */
.story-block { display: grid; grid-template-columns: 1fr 1fr; gap: 46px; align-items: center; }
.story-block img { border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-row { display: flex; gap: 30px; margin-top: 24px; flex-wrap: wrap; }
.stat b { display: block; font-size: 1.8rem; color: var(--coconut-brown-dark); font-family: Georgia, serif; }
.stat span { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 230px;
  grid-auto-flow: dense;
  gap: 16px;
}
.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease;
}
.gallery-grid img:hover { transform: scale(1.02); }
.gallery-grid .tall { grid-row: span 2; }
.gallery-grid .wide { grid-column: span 2; }
.gallery-grid .big { grid-column: span 2; grid-row: span 2; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--deep-green);
  color: #d9e6dc;
  padding: 56px 0 24px;
  margin-top: 60px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 32px; }
.footer-grid h4 { color: #fff; font-family: Georgia, serif; margin-bottom: 14px; }
.footer-grid a { display: block; color: #cfe0d3; margin-bottom: 8px; font-size: 0.92rem; }
.footer-grid a:hover { color: var(--lime); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 40px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: #a9c0af;
}

/* ---------- Forms ---------- */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.88rem; }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid #d8d2c1;
  background: #fff;
  font-size: 0.95rem;
  font-family: inherit;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { outline: 2px solid var(--leaf-green); border-color: var(--leaf-green); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Cart page ---------- */
.cart-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 36px; align-items: flex-start; }
.cart-line {
  display: grid;
  grid-template-columns: 76px 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--cream-dark);
}
.cart-line img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; }
.qty-control { display: flex; align-items: center; border: 1.5px solid var(--cream-dark); border-radius: 999px; overflow: hidden; }
.qty-control button {
  width: 30px; height: 30px; border: none; background: var(--cream-dark); cursor: pointer; font-weight: 700;
}
.qty-control input { width: 40px; border: none; text-align: center; font-weight: 700; }
.summary-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 100px;
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.95rem; }
.summary-row.total { font-size: 1.2rem; font-weight: 800; color: var(--deep-green); border-top: 1px solid var(--cream-dark); padding-top: 14px; margin-top: 14px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 14px; }

/* ---------- Admin ---------- */
.admin-gate {
  max-width: 420px;
  margin: 90px auto;
  background: #fff;
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-table th, .admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--cream-dark); font-size: 0.9rem; text-align: left; vertical-align: middle; }
.admin-table th { background: var(--cream-dark); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.5px; color: var(--muted); }
.admin-table img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.admin-panel { background: #fff; border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); margin-bottom: 30px; }
.pill-note {
  background: var(--cream-dark);
  border-left: 4px solid var(--leaf-green);
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--ink);
  margin-bottom: 20px;
}
.thumb-preview { width: 90px; height: 90px; object-fit: cover; border-radius: 10px; margin-top: 8px; border: 1px solid var(--cream-dark); }
.stock-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  right: 26px;
  background: var(--deep-green);
  color: #fff;
  padding: 14px 22px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 200;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- Breadcrumb / page header ---------- */
.page-banner {
  background: linear-gradient(120deg, var(--deep-green), var(--green));
  color: #fff;
  padding: 60px 0 50px;
}
.page-banner h1 { color: #fff; margin-bottom: 6px; }
.page-banner p { color: #d5e5d8; margin: 0; }
.breadcrumb { font-size: 0.8rem; color: #bcd6c3; margin-bottom: 10px; }
.breadcrumb a { color: #bcd6c3; }
.breadcrumb a:hover { color: #fff; }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.muted { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-3, .feature-list { grid-template-columns: repeat(2, 1fr); }
  .story-block { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
}

@media (max-width: 720px) {
  .main-nav { position: fixed; top: 70px; left: 0; right: 0; background: var(--cream); flex-direction: column; padding: 20px 24px; box-shadow: var(--shadow); display: none; gap: 16px; }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .hero h1 { font-size: 2.1rem; }
  .grid-3, .grid-2, .feature-list { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; gap: 10px; }
  .gallery-grid .big { grid-column: span 2; grid-row: span 2; }
  .product-card { max-width: 100%; flex-basis: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cart-line { grid-template-columns: 60px 1fr; grid-template-areas: "img name" "img qty" "img price"; }
  .cart-line img { grid-area: img; }
}
