/*
Theme Name: Mercaato
Theme URI: https://mercaato.com
Description: Dark-green, Heebo-typeset fresh produce theme inspired by mercaato.com: white header with logo, full-width hero, product card grid, quality pillars and certification block.
Author: Asmaa
Version: 1.0.0
Text Domain: mercaato
*/

:root {
  --ae-bg: #182719;
  --ae-bg-2: #121c10;
  --ae-card: #233a24;
  --ae-white: #ffffff;
  --ae-text: #121c10;
  --ae-muted: #d1d1d1;
  --ae-gold: #eaa84e;
  --ae-green: #00793e;
  --ae-max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Heebo", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ae-white);
  background: var(--ae-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5em; font-weight: 700; line-height: 1.2; }

.container { width: min(100% - 32px, var(--ae-max)); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ae-white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
}
.site-logo img { height: 62px; width: auto; }

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
  width: 44px;
  height: 44px;
}
.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--ae-bg);
  margin: 6px 0;
}

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; }
.main-nav a {
  display: block;
  color: var(--ae-text);
  font-weight: 500;
  font-size: 15px;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: border-color .2s ease, color .2s ease;
}
.main-nav a:hover,
.main-nav .current-menu-item > a { color: var(--ae-green); border-color: var(--ae-gold); }

.main-nav li { position: relative; }
.main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  flex-direction: column;
  gap: 0;
  background: var(--ae-white);
  padding: 8px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  border-top: 3px solid var(--ae-gold);
}
.main-nav .sub-menu a { padding: 8px 18px; border: 0; }
.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu { display: flex; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    linear-gradient(rgba(18, 28, 16, .65), rgba(18, 28, 16, .75)),
    var(--hero-img, none) center / cover no-repeat,
    var(--ae-bg-2);
  padding: 80px 0;
}
.hero h1 { font-size: clamp(32px, 5vw, 56px); margin-bottom: 14px; }
.hero p { font-size: 18px; color: var(--ae-muted); max-width: 680px; margin: 0 auto 26px; }
.hero-pillars {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--ae-gold);
}

.btn {
  display: inline-block;
  padding: 14px 30px;
  background: var(--ae-gold);
  color: var(--ae-text);
  font-weight: 600;
  border: 0;
  cursor: pointer;
  transition: filter .2s ease, transform .2s ease;
}
.btn:hover { filter: brightness(.95); transform: translateY(-1px); }
.btn--green { background: var(--ae-green); color: var(--ae-white); }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section--alt { background: var(--ae-bg-2); }
.section-title { text-align: center; font-size: clamp(28px, 4vw, 44px); margin-bottom: 40px; }
.section-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  background: var(--ae-gold);
  margin: 14px auto 0;
}

/* Product cards */
.product-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.product-card {
  position: relative;
  overflow: hidden;
  background: var(--ae-card);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 26px;
  background-size: cover;
  background-position: center;
  transition: transform .3s ease;
}
.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 30%, rgba(18, 28, 16, .95));
}
.product-card > * { position: relative; }
.product-card h3 { font-size: 24px; margin: 0 0 6px; }
.product-card span { color: var(--ae-gold); font-size: 14px; }
.product-card:hover { transform: translateY(-4px); }

/* Value pillars */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  text-align: center;
}
.pillar { padding: 28px 20px; border-top: 3px solid var(--ae-gold); background: var(--ae-card); }
.pillar h3 { color: var(--ae-gold); font-size: 20px; text-transform: uppercase; letter-spacing: .06em; }
.pillar p { color: var(--ae-muted); margin: 0; }

/* Certificates */
.certs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.certs p { max-width: 720px; color: var(--ae-muted); margin: 0; }
.cert-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; list-style: none; padding: 0; margin: 0; }
.cert-badges li {
  border: 1px solid var(--ae-gold);
  color: var(--ae-gold);
  padding: 8px 16px;
  font-weight: 500;
  letter-spacing: .05em;
}

/* Page content */
.content-wrap { padding: 60px 0; }
.content-wrap .entry { background: var(--ae-white); color: var(--ae-text); padding: 40px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ae-bg-2); padding: 60px 0 24px; color: var(--ae-muted); font-size: 15px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}
.site-footer h4 { color: var(--ae-white); text-transform: uppercase; letter-spacing: .08em; font-size: 15px; margin: 0 0 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a:hover { color: var(--ae-gold); }
.social { display: flex; gap: 10px; }
.social a {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--ae-card);
  font-size: 13px;
  font-weight: 600;
}
.copyright {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ae-white);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .15);
    padding: 12px 16px;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav .sub-menu { position: static; box-shadow: none; border: 0; padding-left: 14px; }
  .main-nav li:hover > .sub-menu { display: none; }
  .main-nav li.is-open > .sub-menu { display: flex; }
  .site-header { position: relative; }
}
@media (max-width: 560px) {
  .hero { min-height: 480px; padding: 60px 0; }
  .section { padding: 56px 0; }
  .content-wrap .entry { padding: 22px; }
}

/* ---------- Products page (availability grid) ---------- */
.products-page { background: var(--ae-bg); }
.products-title { color: #5f7a1f; font-size: clamp(30px, 4vw, 44px); margin-top: 10px; }
.products-sub { color: var(--ae-gold); font-size: clamp(18px, 2.4vw, 24px); margin: 0 0 30px; font-weight: 500; }

.avail-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--ae-white); padding: 12px; }
.avail-table { width: 100%; border-collapse: collapse; min-width: 760px; color: var(--ae-text); }
.avail-table thead th {
  background: #8fae2d;
  color: var(--ae-white);
  font-weight: 500;
  font-size: 15px;
  padding: 10px 6px;
  text-align: center;
}
.avail-table tbody tr:nth-child(odd) { background: #fff; }
.avail-table tbody tr:nth-child(even) { background: #d5e3a6; }
.avail-table tbody th { text-align: left; padding: 6px 10px 6px 4px; width: 210px; }
.avail-table td { text-align: center; padding: 10px 4px; border-bottom: 2px solid #5f7a1f; }
.avail-table tbody tr { border-bottom: 2px solid #5f7a1f; }

.avail-name {
  display: block;
  background: #2b3a16;
  color: var(--ae-white);
  padding: 12px 14px;
  font-weight: 500;
  font-size: 15px;
  transition: background .2s ease, color .2s ease;
}
.avail-name:hover { background: var(--ae-gold); color: var(--ae-text); }

.dot {
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ae-gold);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Mercaato light theme (matches mercaato.com) ---------- */
:root {
  --ae-bg: #ffffff;
  --ae-bg-2: #f4f7ea;
  --ae-card: #eef4da;
  --ae-text: #1f2a14;
  --ae-muted: #4a5538;
  --ae-gold: #fbc500;
  --ae-green: #8fae2d;
  --ae-olive: #5f7a1f;
  --ae-dark: #2b3a16;
}
body { background: #ffffff; color: var(--ae-text); }
.site-header { background: #ffffff; }
.main-nav a { color: #1f2a14; font-weight: 500; }
.main-nav a:hover,
.main-nav .current-menu-item > a {
  color: #ffffff;
  background: var(--ae-green);
  border-color: transparent;
  padding: 8px 12px;
}
.main-nav .sub-menu a { color: #1f2a14; padding: 8px 18px; }
.main-nav .sub-menu a:hover { color: #ffffff; background: var(--ae-green); }

.hero { background: var(--ae-bg-2); color: var(--ae-text); }
.hero h1 { color: var(--ae-olive); }
.hero p { color: var(--ae-muted); }
.hero-pillars { color: var(--ae-green); }
.btn { background: var(--ae-gold); color: #1f2a14; }
.btn--green { background: var(--ae-dark); color: #ffffff; }

.section--alt { background: var(--ae-bg-2); }
.section-title { color: var(--ae-olive); }
.product-card h3 { color: #ffffff; }
.product-card span { color: var(--ae-gold); }
.pillar { background: #ffffff; border: 1px solid #dfe8c4; border-top: 3px solid var(--ae-gold); }
.pillar h3 { color: var(--ae-olive); }
.pillar p { color: var(--ae-muted); }
.cert-badges li { color: var(--ae-olive); border-color: var(--ae-gold); }
.certs p { color: var(--ae-muted); }

.content-wrap .entry { background: #ffffff; color: var(--ae-text); border: 1px solid #e3ead0; }

.products-page { background: #ffffff; }
.products-title { color: var(--ae-olive); }
.products-sub { color: #e0a800; }
.avail-wrap { background: #ffffff; border: 1px solid #e3ead0; }
.avail-table thead th { background: var(--ae-green); }
.avail-table tbody tr:nth-child(even) { background: #d5e3a6; }
.avail-table td { border-bottom: 2px solid var(--ae-olive); }
.avail-table tbody tr { border-bottom: 2px solid var(--ae-olive); }
.avail-name { background: var(--ae-dark); }
.avail-name:hover { background: var(--ae-gold); color: #1f2a14; }
.dot { background: var(--ae-gold); }

.site-footer { background: var(--ae-dark); color: #e7edd0; }
.site-footer h4 { color: #ffffff; }
.site-footer a { color: #e7edd0; }
.site-footer a:hover { color: var(--ae-gold); }
.social a { background: #3d4f22; color: #ffffff; }
.copyright { border-top-color: rgba(255, 255, 255, .15); }

/* ---------- Hero with photo, product page layout ---------- */
.hero--img { color: #ffffff; background-size: cover; background-position: center; }
.hero--img h1 { color: #ffffff; }
.hero--img p { color: #f1f5e4; }
.hero--img .hero-pillars { color: var(--ae-gold); }
.product-card { background-size: cover; background-position: center; }

.product-single-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  background: #ffffff;
  padding: 24px;
  border: 1px solid #e3ead0;
}
.product-single-img { width: 100%; height: auto; }
.product-single .entry { color: var(--ae-text); }

@media (max-width: 720px) {
  .product-single-grid { grid-template-columns: 1fr; }
}
