/*
  FreshNest Farm — Styles
  - Modern, mobile-first, responsive styles
  - CSS variables for color palette
  - Flexbox/Grid layouts
  - Smooth animations and transitions
*/

/* ---------- Base & Variables ---------- */
:root {
  /* Brand palette from logo: olives, warm oranges, browns */
  --brand-olive-700: #5f5a2f; /* deep olive */
  --brand-olive-600: #6f6a33; /* primary olive */
  --brand-olive-500: #7c7640; /* light olive */
  --brand-orange-600: #d86422; /* deep orange */
  --brand-orange-500: #e9772e; /* bright orange */
  --brand-brown-600: #6b3e2b; /* rich brown */

  /* Semantic aliases for components */
  --accent-600: var(--brand-orange-600);
  --accent-500: var(--brand-orange-500);

  /* Back-compat with previous tokens */
  --green-600: var(--brand-olive-700);
  --green-500: var(--brand-olive-600);
  --green-400: var(--brand-olive-500);

  --cream: #f6f7f2;
  --bg: #ffffff;
  --text-900: #222222;
  --text-700: #404040;
  --text-500: #6b7280;
  --shadow: 0 10px 25px rgba(0,0,0,0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 70px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-900);
  background: var(--bg);
  line-height: 1.6;
}
/* Prevent accidental horizontal scroll and reduce bounce on mobile */
body { overflow-x: hidden; overscroll-behavior-y: none; }

img, svg { display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

.section { padding: 30px 0; }
.section__header { text-align: center; margin-bottom: 28px; }
.section__title { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem); margin: 0 0 8px; font-weight: 700; color: var(--green-600); }
.section__subtitle { color: var(--text-700); margin: 0 auto; max-width: 720px; }
.section__body { color: var(--text-700); }

/* ---------- Navigation ---------- */
.site-header { position: -webkit-sticky; position: sticky; top: 0; z-index: 100; }
.nav {
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: currentcolor;
  backdrop-filter: saturate(140%) blur(10px);
  box-shadow: none;
  transition: box-shadow 240ms ease, background 240ms ease;
}
.nav.scrolled { box-shadow: 0 8px 24px rgba(0,0,0,0.08); background:currentcolor; }

.nav__brand { font-weight: 700; color: #fff; letter-spacing: 0.3px; display: inline-flex; align-items: center; gap: 10px; }
.nav__brand-logo { display: inline-flex; width: 28px; height: 28px; }
.nav__brand-text { line-height: 1; }

.nav__links { list-style: none; display: flex; gap: 8px; align-items: center; margin: 0; padding: 0; }
.nav__link { padding: 10px 14px; border-radius: 999px; color: #fff; transition: background 200ms ease, color 200ms ease; }
.nav__link:hover { background: var(--cream); color: var(--text-900); }
.nav__link.active { background: var(--accent-500); color: #fff; }

.nav__toggle { display: none; background: transparent; border: none; padding: 8px; border-radius: 10px; }
.nav__toggle:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }
.nav__toggle-bar { width: 22px; height: 2px; background: #fff; margin: 4px 0; border-radius: 2px; }

@media (max-width: 820px) {
  .nav { grid-template-columns: auto auto; }
  .nav__toggle { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; }
  .nav__links { position: fixed; inset: calc(var(--header-h) + 6px) 6px auto; bottom: auto; display: grid; gap: 8px; background: currentColor; padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow); transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity 220ms ease, transform 220ms ease; }
  .nav__links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100svh - var(--header-h));
  display: grid; place-items: center;
  position: relative; overflow: clip;
  color: #0b2a0f;
  background-size: cover;
  background-position: center;

}
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0,0,0,0.28) 0%, rgba(0,0,0,0.52) 100%); }
.hero__content { position: relative; z-index: 2; text-align: center; padding: 24px 0; }
.hero__title { font-family: 'Merriweather', serif; font-weight: 700; font-size: clamp(2rem, 1.6rem + 2.5vw, 3rem); margin: 0 0 12px; }
.hero__subtitle { font-size: clamp(1rem, 0.95rem + 0.5vw, 1.25rem); color: var(--text-700); margin-bottom: 22px; }
.hero__cta { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }

/* ---------- Hero Slider ---------- */
.slider { position: relative; max-width: 940px; margin: 0 auto; }
.slider__track { position: relative; min-height: 360px; }
.slide { position: absolute; inset: 0; display: grid; place-items: center; gap: 8px; padding: 0 16px; opacity: 0; transform: translateY(22px) scale(0.98); transition: opacity 520ms ease, transform 520ms ease; }
.slide.is-active { opacity: 1; transform: none; }
.slide .hero__title { color: #fff; text-shadow: 0 8px 28px rgba(0,0,0,0.35); animation: pop-title 640ms ease both; }
.slide .hero__subtitle { color: #f1f5f9; text-shadow: 0 6px 22px rgba(0,0,0,0.3); animation: pop-sub 700ms ease both 90ms; }

/* Hero background variants mapped by JS */
.hero.hero--bg-0 { background-image: url('img/hero1.jpg'); }
.hero.hero--bg-1 { background-image: url('img/hero2.jpg'); }
.hero.hero--bg-2 { background-image: url('img/hero3.jpg'); }

@keyframes pop-title { from { opacity: 0; transform: translateY(10px) scale(0.96); letter-spacing: 0.2px; } to { opacity: 1; transform: translateY(0) scale(1); letter-spacing: 0; } }
@keyframes pop-sub { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.slider__control { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: rgba(0,0,0,0.35); color: #fff; border: 1px solid rgba(255,255,255,0.18); box-shadow: var(--shadow); cursor: pointer; transition: background 160ms ease, transform 160ms ease; }
.slider__control:hover { background: rgba(0,0,0,0.5); transform: translateY(-50%) scale(1.03); }
.slider__control--prev { left: -4px; }
.slider__control--next { right: -4px; }

.slider__dots { position: absolute; inset: auto 0 -32px 0; display: flex; justify-content: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.6); transition: transform 160ms ease, background 160ms ease; }
.dot.is-active { transform: scale(1.3); background: var(--accent-500); border-color: var(--accent-500); }
@media (max-width: 560px) { .slider__track { min-height: 320px; } }

/* ---------- Buttons ---------- */
.btn { --pad-x: 18px; --pad-y: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: var(--pad-y) var(--pad-x); border-radius: 999px; font-weight: 600; border: 1px solid transparent; cursor: pointer; transition: transform 180ms ease, box-shadow 200ms ease, background 200ms ease, color 200ms ease; }
.btn--primary { background: linear-gradient(180deg, var(--accent-500), var(--accent-600)); color: #fff; box-shadow: 0 6px 16px rgba(216,100,34,0.35); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(216,100,34,0.45); }
.btn--ghost { background: white; color: var(--green-600); border-color: color-mix(in oklab, var(--green-600), transparent 60%); }
.btn--ghost:hover { background: color-mix(in oklab, var(--green-600), white 90%); }

/* ---------- Products ---------- */
.products { background: #fff; }
.product-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }

.card { background: #fff; border: 1px solid #eef0ea; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: transform 200ms ease, box-shadow 200ms ease; }
.card:hover { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(0,0,0,0.12); }
.card__icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--accent-600); margin-bottom: 8px; }
.card__title { font-weight: 600; margin: 0 0 6px; color: var(--green-600); }
/* Section subheadings */
.section h3 { color: var(--green-600); }
.card__body { color: var(--text-700); margin: 0; }

/* Product strip (horizontal scroll) */
.product-strip { margin-top: 32px; padding-top: 16px; padding-bottom: 24px; }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 300px); gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.hscroll::-webkit-scrollbar { height: 10px; }
.hscroll::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 999px; }
.product-card { position: relative; background: #fff; border: 1px solid #eef0ea; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: transform 180ms ease, box-shadow 200ms ease, border-color 200ms ease; min-width: 320px; height: 400px; display: flex; flex-direction: column; flex: 0 0 320px; overflow: visible; }
.product-card__image { width: 200px; height: 200px; border-radius: 999px; border: 3px solid color-mix(in oklab, var(--accent-500), white 30%); overflow: hidden; box-shadow: 0 6px 14px rgba(0,0,0,0.12); margin: 0 auto 12px; }
.product-card__image img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(0,0,0,0.12); }
.product-card__title { font-weight: 700; margin: 0 0 6px; color: var(--text-900); font-size: 1.05rem; }
.product-card__meta { color: var(--text-700); font-size: 0.95rem; margin-bottom: 8px; }
.product-card__price { color: var(--accent-600); font-weight: 700; font-size: 1.15rem; margin-top: 2px; }
.product-card__actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; min-height: 44px; flex-wrap: nowrap; }
.product-card__actions .btn { --pad-x: 14px; --pad-y: 10px; }
.product-card--disabled { opacity: 0.85; filter: grayscale(0.2); pointer-events: none; }
/* Badges for card status */
.product-card__badge { position: absolute; top: 10px; right: 10px; font-size: 0.75rem; padding: 4px 10px; border-radius: 999px; border: 1px solid #e5e7eb; pointer-events: none; z-index: 2; }
.product-card__badge--available { background: #e9f8ed; color: var(--green-600); border-color: color-mix(in oklab, var(--green-600), white 70%); }
.product-card__badge--soon { background: #f3f4f6; color: #6b7280; }
.product-card--featured { border-color: color-mix(in oklab, var(--accent-500), transparent 75%); box-shadow: 0 16px 32px rgba(216,100,34,0.12); }

/* Product slider (no native scrollbars) */
.product-slider { position: relative; padding: 10px 0; }
.product-slider__viewport { overflow-x: hidden; overflow-y: visible; padding-bottom: 50px; touch-action: pan-y; overscroll-behavior-x: contain; }
.product-slider__track { display: flex; gap: 16px; will-change: transform; transition: transform 320ms ease; align-items: stretch; user-select: none; cursor: grab; }
.product-slider__track.dragging { cursor: grabbing; transition: none; }
.product-slider__control { display: none; }
.product-slider__control--prev { left: -6px; }
.product-slider__control--next { right: -6px; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: center; }
@media (min-width: 900px) { .about__grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.about__image { min-height: 450px; border-radius: var(--radius); background:
  linear-gradient(180deg, rgba(111,106,51,0.18), rgba(111,106,51,0.08)),
  url('img/abt.jpeg'); /* placeholder; can be replaced */
  background-size: cover; background-position: center; box-shadow: var(--shadow); }
.about__content { padding: 8px; }

/* ---------- Location ---------- */
.location__grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
@media (min-width: 900px) { .location__grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.hours { list-style: none; padding: 0; margin: 10px 0 0; }
.hours li { padding: 8px 0; color: var(--text-700); }
.location__map .map__placeholder { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid #eef0ea; }
.location__map iframe { width: 100%; height: 320px; border: 0; }

/* ---------- Contact ---------- */
.form { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 820px) { .form { grid-template-columns: 1fr 1fr; } }
.form__field { display: grid; gap: 6px; }
.form__field--full { grid-column: 1 / -1; }
.form label { font-weight: 600; }
.form input, .form textarea { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid #e5e7eb; background: #fff; color: var(--text-900); transition: border-color 160ms ease, box-shadow 160ms ease; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 4px rgba(63,163,77,0.15); }
.form__actions { display: flex; gap: 10px; align-items: center; }
.error { min-height: 18px; font-size: 0.85rem; color: #b00020; }

.form-success { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 14px; border-radius: 999px; background: #e9f8ed; color: var(--green-600); box-shadow: var(--shadow); animation: toast-in 380ms ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Footer ---------- */
.footer { background: currentcolor; border-top: 1px solid #eef0ea; margin-top: 32px; }
.footer__grid { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; padding: 28px 0;color: #fff; }
@media (min-width: 820px) { .footer__grid { grid-template-columns: 2fr 2fr 1fr; } }
.footer__brand strong { font-weight: 700; color: var(--green-600); }
.footer__social { display: flex; gap: 10px; }
.social { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; background: #fff; border: 1px solid #eef0ea; box-shadow: var(--shadow); color: var(--text-700); transition: transform 160ms ease, background 160ms ease; }
.social:hover { transform: translateY(-2px); background: #f9fafb; }
.footer__bottom { text-align: center; padding: 12px 0; color: #fff; border-top: 1px solid #e9ece6; }

/* ---------- Reveal Animations ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 500ms ease, transform 500ms ease; }
.reveal { transition-delay: var(--reveal-delay, 0ms); }
.reveal[data-animate="slide-up"] { transform: translateY(22px); }
.reveal[data-animate="fade-in"] { transform: none; }
.reveal[data-animate="slide-in-right"] { transform: translateX(22px); }
.reveal-visible { opacity: 1; transform: none; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 999; display: none; }
.modal.open { display: block; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); }
.modal__dialog { position: relative; margin: 4vh auto; max-width: 680px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; transform: translateY(16px) scale(0.98); opacity: 0; transition: transform 220ms ease, opacity 220ms ease; }
.modal.open .modal__dialog { transform: none; opacity: 1; }
.modal__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.modal__close { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #f3f4f6; border: 1px solid #e5e7eb; color: #111827; cursor: pointer; }
@media (max-width: 560px) { .modal__dialog { margin: 2vh 12px; } }

/* Utility */
.hidden { display: none !important; }

/* Section theme classes removed */

/* ---------- Parallax Layers ---------- */
.parallax { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.parallax__item { position: absolute; border-radius: 999px; opacity: 0.22; will-change: transform; filter: blur(0.2px); }
.parallax__item--leaf { width: 160px; height: 160px; left: 6%; top: 12%; background: radial-gradient(80px 80px at 50% 50%, rgba(111,106,51,0.5), rgba(111,106,51,0.22)); box-shadow: 0 10px 24px rgba(111,106,51,0.18); }
.parallax__item--grain { width: 220px; height: 220px; right: 8%; top: 30%; background: radial-gradient(110px 110px at 50% 50%, rgba(233,119,46,0.55), rgba(233,119,46,0.25)); box-shadow: 0 10px 24px rgba(233,119,46,0.18); }
.parallax__item--sun { width: 280px; height: 280px; left: 50%; bottom: 10%; transform: translateX(-50%); background: radial-gradient(120px 120px at 50% 50%, rgba(255,220,160,0.6), rgba(255,220,160,0.25)); box-shadow: 0 10px 24px rgba(255,200,140,0.18); }

/* ---------- Floating WhatsApp Button ---------- */
.fab { position: fixed; right: 18px; bottom: 18px; width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; z-index: 60; box-shadow: 0 14px 32px rgba(0,0,0,0.18); transition: transform 160ms ease, box-shadow 160ms ease; }
.fab--whatsapp { background: linear-gradient(180deg, #25d366, #128c7e); color: #fff; }
.fab:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(0,0,0,0.22); }
@media (max-width: 480px) { .fab { right: 12px; bottom: 14px; width: 52px; height: 52px; } }

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(34, 34, 34);
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 400ms ease, visibility 0s linear 400ms;
}
.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}
.loader__inner { display: grid; place-items: center; gap: 20px; }
.loader__logo img {
  width: 160px;
  height: auto;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.15));
  animation: logoPulse 1400ms ease infinite;
}
.loader__ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 6px solid rgba(233, 119, 46, 0.25);
  border-top-color: var(--accent-500);
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes logoPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.92; }
}
@media (prefers-reduced-motion: reduce) {
  .loader__logo img, .loader__ring { animation: none; }
}
