:root {
  --font-main: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --green: #477f3f;
  --green-dark: #2f6330;
  --blue: #2f6c8f;
  --red: #dc4438;
  --ink: #202522;
  --muted: #667064;
  --line: #dfe5dd;
  --paper: #f7f8f3;
  --surface: #ffffff;
  --soft: #edf4e9;
  --shadow: 0 16px 40px rgba(31, 39, 34, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.48;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
h4,
.brand,
.nav-links,
.btn,
.text-button {
  font-family: var(--font-main);
}

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

button,
input,
select,
textarea {
  border: 0;
}

button {
  cursor: pointer;
}

img {
  display: block;
}

p,
h1,
h2,
h3,
h4,
dl,
dd {
  margin-top: 0;
}

.container {
  width: min(calc(100% - 40px), 1180px);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(31, 39, 34, 0.09);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
}

.brand strong {
  display: block;
  color: var(--ink);
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
}

.nav-links,
.header-actions,
.lang-switcher {
  display: flex;
  align-items: center;
}

.nav-links {
  gap: 28px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
}

.nav-links a {
  padding: 24px 0;
}

.nav-links a:hover {
  color: var(--green-dark);
}

.header-actions {
  flex: 0 0 auto;
  gap: 12px;
}

.lang-switcher {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.lang-switcher button {
  min-width: 42px;
  min-height: 38px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 750;
}

.lang-switcher button.is-active {
  color: #fff;
  background: var(--green);
}

.btn,
.text-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.btn:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: var(--green);
}

.btn-primary:hover {
  background: var(--green-dark);
}

.btn-secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
}

.btn-secondary:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.btn-quiet {
  color: var(--blue);
  background: #edf5f8;
}

.text-button {
  min-height: 34px;
  padding-inline: 10px;
  color: var(--blue);
  background: transparent;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 540px;
  background: #28362b;
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background: rgba(12, 22, 16, 0.48);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 540px;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  gap: 42px;
  align-content: center;
  padding: 70px 0 54px;
  color: #fff;
}

.hero-copy {
  max-width: 690px;
}

.eyebrow {
  margin-bottom: 10px;
  color: #dfeebd;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.hero p {
  max-width: 590px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.42;
}

.hero-search {
  align-self: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.hero-search label,
.field span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(71, 127, 63, 0.14);
}

.hero-stats {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 12px;
  margin: 4px 0 0;
}

.hero-stats div {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-stats dt {
  margin-bottom: 2px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.hero-stats dd {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
}

.catalog-section,
.map-section {
  padding: 72px 0;
}

.map-section {
  background: var(--surface);
}

.section-heading,
.map-heading {
  margin-bottom: 24px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2,
.map-heading h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 780;
  line-height: 1.08;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) minmax(170px, 0.7fr) minmax(190px, 0.7fr);
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: var(--surface);
}

.catalog-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
}

.catalog-meta p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.farm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.farm-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
}

.farm-card h3 {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.farm-facts {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.farm-line {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.36;
  overflow-wrap: anywhere;
}

.farm-line span {
  color: var(--muted);
  font-weight: 720;
}

.farm-line strong {
  color: var(--ink);
  font-weight: 590;
}

.primary-fact strong {
  color: var(--green-dark);
  font-weight: 760;
}

.detail-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.detail-grid div {
  display: grid;
  gap: 2px;
}

.detail-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: uppercase;
}

.detail-grid dd {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 560;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.detail-grid dd.is-muted,
.detail-note {
  color: var(--muted);
  font-weight: 560;
}

.detail-note {
  margin-bottom: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--paper);
  font-size: 14px;
  line-height: 1.45;
}

.card-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-actions {
  margin-top: 14px;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 34px;
  color: var(--muted);
  background: var(--surface);
  text-align: center;
}

.map-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: stretch;
}

.farm-map {
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e7ece4;
}

.map-sidebar {
  display: flex;
  min-height: 560px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--paper);
}

.map-sidebar h3 {
  margin-bottom: 12px;
  font-size: 20px;
  line-height: 1.2;
}

.district-list {
  display: grid;
  max-height: 350px;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.district-chip {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
}

.district-chip:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.district-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.district-chip strong {
  color: var(--green-dark);
  font-size: 16px;
}

.selected-farm {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.selected-farm span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.selected-farm strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.22;
}

.selected-farm p {
  margin-bottom: 0;
}

.map-fallback {
  display: grid;
  height: 100%;
  min-height: 420px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  color: var(--muted);
  background: var(--surface);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.footer-inner span:first-child,
.footer-inner a {
  color: var(--ink);
  font-weight: 800;
}

.footer-inner a:hover {
  color: var(--green-dark);
}

.farm-dialog {
  width: min(820px, calc(100% - 32px));
  max-height: min(88vh, 920px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(16, 24, 18, 0.35);
}

.farm-dialog::backdrop {
  background: rgba(8, 18, 13, 0.58);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: #f0f3ef;
  font-size: 26px;
  line-height: 1;
}

#dialog-content {
  padding: 34px;
}

.dialog-heading {
  padding-right: 44px;
}

.dialog-heading h3 {
  margin-bottom: 18px;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 780;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 24px;
}

.detail-grid div:nth-child(2),
.detail-grid div:nth-child(6) {
  grid-column: 1 / -1;
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 22px;
}

.detail-section h4 {
  margin-bottom: 14px;
  font-size: 22px;
  line-height: 1.2;
}

.performance-table {
  display: grid;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.performance-row {
  display: grid;
  grid-template-columns: 0.7fr 1.1fr 1.1fr 0.8fr;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
  align-items: center;
}

.performance-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.contact-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.contact-list a {
  color: var(--blue);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dialog-actions {
  margin-top: 26px;
}

@media (max-width: 1020px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .hero-inner,
  .map-panel {
    grid-template-columns: 1fr;
  }

  .farm-grid,
  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-sidebar,
  .farm-map {
    min-height: 440px;
  }
}

@media (max-width: 660px) {
  .container {
    width: min(calc(100% - 28px), 1180px);
  }

  .header-actions {
    margin-left: auto;
  }

  .hero,
  .hero-inner {
    min-height: auto;
  }

  .hero-inner {
    padding: 52px 0 36px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .search-row,
  .hero-stats,
  .toolbar,
  .farm-grid,
  .detail-grid,
  .performance-row {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .catalog-meta,
  .footer-inner {
    align-items: start;
    flex-direction: column;
  }

  .catalog-section,
  .map-section {
    padding: 52px 0;
  }

  .farm-card h3 {
    margin-bottom: 12px;
  }

  #dialog-content {
    padding: 26px 20px;
  }

  .detail-grid div:nth-child(2),
  .detail-grid div:nth-child(6) {
    grid-column: auto;
  }

  .performance-head {
    display: none;
  }

}
