/* FermePro Market : site public (ADR-0014, P2). Aucun script, aucune ressource externe.
   Mobile d'abord (360 px), puis 640, 960 et 1200 px. Police Poppins servie localement. */

@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/Poppins-Regular.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/Poppins-Medium.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/Poppins-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../fonts/Poppins-Bold.woff2") format("woff2"); }

:root {
  --green: #1D5C3B;
  --green-dark: #154329;
  --green-soft: #E4EEE7;
  --yellow: #E9C46A;
  --yellow-dark: #D9B04C;
  --yellow-soft: #FAF0D3;
  --bg: #F3F4EF;
  --card: #FFFFFF;
  --border: #8A9285;
  --line: #D6D9D0;
  --text: #1E2B23;
  --muted: #5A645D;
  --radius: 14px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--font);
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; padding-top: 16px; padding-bottom: 40px; }
img { max-width: 100%; height: auto; }
a { color: var(--green); }
h1, h2, h3 { font-weight: 700; line-height: 1.25; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.sr, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 10; background: var(--yellow);
  color: var(--green-dark); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
main :focus-visible { outline-color: var(--green); }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 2px solid transparent;
  font: 600 14px/1.2 var(--font); text-decoration: none; text-align: center; cursor: pointer;
}
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); }
.btn-yellow { background: var(--yellow); color: var(--green-dark); }
.btn-yellow:hover { background: var(--yellow-dark); }
.btn-ghost { background: transparent; color: var(--green); border-color: var(--green); }
.btn-ghost:hover { background: var(--green-soft); }
.btn-block { display: flex; width: 100%; }

/* En-tête */
.site-header { background: var(--green); color: #fff; }
.header-row { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; padding-top: 10px; padding-bottom: 12px; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 400; font-size: 18px; }
.brand img { border-radius: 50%; background: var(--bg); }
.brand b { font-weight: 700; color: var(--yellow); }
.header-login { min-height: 40px; padding: 6px 14px; font-size: 13px; }
.search { grid-column: 1 / -1; grid-row: 2; display: flex; }
.search input {
  flex: 1; min-width: 0; height: 46px; border: 2px solid var(--yellow); border-right: 0;
  border-radius: 999px 0 0 999px; padding: 0 16px; font: 400 15px var(--font); color: var(--text);
  background: #fff; -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px;
  border: 2px solid var(--yellow); background: var(--yellow); color: var(--green-dark);
  border-radius: 0 999px 999px 0; font: 600 14px var(--font); cursor: pointer;
}
.search-btn:hover { background: var(--yellow-dark); border-color: var(--yellow-dark); }
.btn-label { display: none; }

/* Accueil */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--green); color: #fff; border-radius: var(--radius);
  padding: 20px 18px; margin-bottom: 16px;
}
.hero h1 { font-size: 20px; }
.hero p { margin-top: 8px; color: #E6EFE9; font-size: 14px; max-width: 46ch; }
.hero-logo { display: none; background: var(--bg); border-radius: 14px; padding: 8px 10px; }

.cats ul { list-style: none; display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -16px 6px; padding-left: 16px; padding-right: 16px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.cat {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 92px; min-height: 84px; padding: 8px 6px; scroll-snap-align: start;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none; text-align: center; font-size: 12px; font-weight: 500; line-height: 1.2;
}
.cat-ico { color: var(--green); display: flex; }
.cat:hover { background: var(--green-soft); }
.cat.active { background: var(--green); border-color: var(--green); color: #fff; }
.cat.active .cat-ico { color: var(--yellow); }

.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 18px;
}
.filters label { font-weight: 600; font-size: 13px; }
.filters input[type=text] {
  flex: 1 1 160px; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--border);
  border-radius: 999px; background: #fff; font: 400 14px var(--font); color: var(--text);
}
.filters .btn { min-height: 44px; }

.section-title { font-size: 18px; margin: 4px 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag { font-size: 12px; font-weight: 600; background: var(--yellow-soft); color: var(--green-dark); border: 1px solid var(--yellow); border-radius: 999px; padding: 2px 10px; }

/* Grille d'annonces */
.grid { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card:hover { box-shadow: 0 4px 14px rgba(30, 43, 35, .14); }
.card-link { display: block; color: inherit; text-decoration: none; height: 100%; }
.card-photo { position: relative; aspect-ratio: 4 / 3; background: var(--green-soft); }
.card-photo > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ph img { opacity: .55; }
.badge {
  position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; line-height: 1; padding: 5px 8px; border-radius: 999px;
}
.badge.static { position: static; font-size: 12px; padding: 6px 10px; }
.badge-trace { background: var(--yellow); color: var(--green-dark); }
.badge-wanted { background: var(--green); color: #fff; }
.card-body { padding: 10px 12px 12px; }
.card-price { font-weight: 700; font-size: 18px; color: var(--green); line-height: 1.2; }
.card-price small { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.card-price.no-price { font-size: 14px; color: var(--muted); font-weight: 600; }
.card-title {
  font-size: 14px; font-weight: 600; margin-top: 4px; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere; min-height: 2.5em;
}
.card-qty { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-meta { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 6px; min-width: 0; }
.card-meta svg { flex: none; color: var(--green); }
.card-meta .place { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card-meta span:last-child { white-space: nowrap; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.pager-page { font-size: 13px; color: var(--muted); font-weight: 500; }

.empty, .notice { text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty h3, .notice h1 { font-size: 18px; }
.notice { max-width: 560px; margin: 24px auto; }
.notice h1 { font-size: 20px; }
.notice .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.muted { color: var(--muted); }

/* Fil d'Ariane et panneaux */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }

/* Fiche */
.listing { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.gallery {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius);
  margin: 0 -16px; padding: 0 16px; -webkit-overflow-scrolling: touch;
}
.gallery.single { overflow: visible; }
.g-item { flex: 0 0 88%; scroll-snap-align: center; display: block; background: var(--green-soft); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 4 / 3; }
.gallery.single .g-item { flex-basis: 100%; }
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-none { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 16 / 9; background: var(--green-soft); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); font-size: 13px; }
.g-none img { opacity: .55; }
.summary { display: grid; gap: 12px; align-content: start; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badges:empty { display: none; }
.summary h1 { font-size: 20px; margin: 8px 0 6px; overflow-wrap: anywhere; }
.price { font-size: 28px; font-weight: 700; color: var(--green); line-height: 1.15; }
.price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.price.no-price { font-size: 18px; color: var(--muted); }
.negotiable { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--green-dark); background: var(--yellow-soft); border-radius: 999px; padding: 3px 10px; }
.facts { margin: 14px 0 16px; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; text-align: center; }
.seller-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--green); color: var(--yellow); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; }
.avatar.big { width: 64px; height: 64px; font-size: 28px; }
.seller-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.seller-text strong { overflow-wrap: anywhere; }
.seller-text small { color: var(--muted); font-size: 12px; }
.chev { font-size: 24px; color: var(--muted); }
.farm { font-size: 13px; color: var(--muted); margin-top: 10px; overflow-wrap: anywhere; }
.safety { font-size: 13px; }
.details { display: grid; gap: 14px; align-content: start; }
.details h2 { font-size: 16px; margin-bottom: 8px; }
.desc { white-space: normal; overflow-wrap: anywhere; }
.trace { list-style: none; margin-top: 10px; border-left: 3px solid var(--yellow); padding-left: 14px; display: grid; gap: 10px; }
.trace li { display: flex; flex-direction: column; font-size: 14px; }
.trace time { color: var(--muted); font-size: 12px; }
.trace-meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.seller-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.seller-head h1 { font-size: 20px; overflow-wrap: anywhere; }

/* Pages de texte */
.prose { max-width: 760px; margin: 0 auto; padding: 20px 18px 24px; }
.prose h1 { font-size: 24px; margin-bottom: 12px; }
.prose h2 { font-size: 17px; margin: 24px 0 8px; color: var(--green-dark); }
.prose p { margin-top: 8px; }
.prose ul, .prose ol { margin-top: 8px; padding-left: 22px; display: grid; gap: 6px; }
.prose .todo-list { list-style: none; padding-left: 0; }
.draft { background: var(--yellow-soft); border: 1px solid var(--yellow); border-radius: 10px; padding: 10px 14px; font-weight: 500; font-size: 14px; margin: 8px 0 12px; }
.callout { background: var(--green-soft); border-left: 4px solid var(--green); border-radius: 8px; padding: 12px 14px; font-weight: 600; }
.todo { color: #7A5A00; background: var(--yellow-soft); border-radius: 6px; padding: 2px 8px; }
.prose li.todo { list-style-position: inside; }

/* Pied de page */
.site-footer { background: var(--green-dark); color: #E6EFE9; padding: 24px 0; margin-top: 8px; }
.footer-row { display: grid; gap: 16px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { background: var(--bg); border-radius: 10px; padding: 4px 6px; }
.footer-brand p { font-size: 14px; max-width: 36ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { color: #fff; font-size: 14px; font-weight: 500; }
.footer-note { font-size: 12px; color: #B9CCC0; max-width: 70ch; }

@media (min-width: 640px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .hero { padding: 28px 28px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .hero-logo { display: block; }
  .cats ul { flex-wrap: wrap; overflow: visible; margin: 0 0 12px; padding: 0; }
  .cat { flex-direction: row; width: auto; min-height: 48px; padding: 8px 16px 8px 12px; gap: 8px; font-size: 14px; }
  .btn-label { display: inline; }
  .gallery { margin: 0; padding: 0; }
  .price { font-size: 32px; }
  .footer-row { grid-template-columns: 1fr auto; align-items: start; }
  .footer-note { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
  main { padding-top: 24px; }
  .header-row { grid-template-columns: auto 1fr auto; gap: 24px; padding-top: 14px; padding-bottom: 14px; }
  .search { grid-column: auto; grid-row: auto; max-width: 720px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .listing { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "gallery summary" "details summary"; gap: 20px; align-items: start; }
  .gallery { grid-area: gallery; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; overflow: visible; }
  .gallery .g-item { grid-column: span 1; aspect-ratio: 4 / 3; }
  .gallery .g-item:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
  .gallery.single .g-item:first-child { aspect-ratio: 16 / 10; }
  .g-none { grid-column: 1 / -1; }
  .summary { grid-area: summary; position: sticky; top: 16px; }
  .details { grid-area: details; }
  .summary h1 { font-size: 22px; }
}
@media (min-width: 1200px) {
  .hero { padding: 32px 40px; }
}
@media (prefers-reduced-motion: no-preference) {
  .card, .btn { transition: box-shadow .15s, background-color .15s; }
}
