/* ==========================================================================
   «Мой Сад» — стили. Палитра: зелёный / белый / светло-коричневый (земля).
   Mobile-first, без внешних фреймворков.
   ========================================================================== */

:root {
  --green: #2f6b3a;
  --green-dark: #234f2b;
  --green-soft: #e7f2e8;
  --green-line: #cfe3d1;
  --brown: #8a6a4f;
  --brown-dark: #6f543e;
  --earth: #f6f1e8;
  --cream: #fbf9f5;
  --white: #ffffff;
  --text: #26302a;
  --muted: #6d7a70;
  --line: #e6e2d8;
  --ok: #2e7d32;
  --ok-bg: #e8f5e9;
  --bad: #c0392b;
  --bad-bg: #fdecea;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(35, 60, 40, 0.06), 0 6px 18px rgba(35, 60, 40, 0.06);
  --shadow-lg: 0 10px 30px rgba(35, 60, 40, 0.12);
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }

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

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; color: var(--text); margin: 0 0 0.5em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }

p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- Шапка ---------- */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  flex-wrap: wrap;
  padding: 10px 16px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--green-dark);
}
.logo__mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--green), #5b8f4f);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem;
}
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  color: var(--text);
  padding: 8px 11px;
  border-radius: 9px;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav a:hover { background: var(--green-soft); color: var(--green-dark); }
.nav a.active { background: var(--green-soft); color: var(--green-dark); }

.header__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.region-pick { position: relative; }
.region-pick select {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--white) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%236d7a70' stroke-width='2'/></svg>") no-repeat right 10px center;
  padding: 9px 30px 9px 12px;
  border-radius: 9px;
  font-size: 0.9rem;
  color: var(--text);
  max-width: 190px;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); color: #fff; }
.btn--ghost { background: var(--white); border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--green); color: var(--green-dark); }
.btn--sm { padding: 7px 12px; font-size: 0.85rem; border-radius: 8px; }
.btn--block { width: 100%; }

/* ---------- Баннер главной ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(91, 143, 79, 0.18), transparent),
    linear-gradient(160deg, #2f6b3a 0%, #3f7f47 55%, #5b8f4f 100%);
  color: #fff;
  padding: 40px 0 46px;
}
.hero h1 { color: #fff; font-size: 1.9rem; margin-bottom: 0.3em; }
.hero p { color: rgba(255,255,255,0.92); font-size: 1.02rem; max-width: 620px; }
.hero__form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 12px;
  margin-top: 20px;
  color: var(--text);
}
@media (min-width: 720px) {
  .hero__form { grid-template-columns: 1fr 1fr 1fr 1fr auto; align-items: end; }
}
.field label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field select, .field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  font-family: inherit;
}
.field select:focus, .field input:focus, .field textarea:focus {
  outline: 2px solid var(--green-line);
  border-color: var(--green);
}

.location-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.location-tab {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 9px;
  padding: 9px 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.location-tab.active { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- Секции ---------- */
.section { padding: 34px 0; }
.section--alt { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.section__head h2 { margin: 0; }

/* ---------- Карточки растений ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }

.plant-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, transform .15s;
}
.plant-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.plant-card__cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--green-soft), var(--earth));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.plant-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.plant-card__ph { font-size: 2.6rem; }
.badge {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(255,255,255,0.92);
  color: var(--green-dark);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}
.plant-card__body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 8px; }
.plant-card__body h3 { margin: 0; font-size: 1.02rem; }
.plant-card__body h3 a { color: var(--text); }
.plant-card__body h3 a:hover { color: var(--green); }
.plant-card__meta { margin: 0; color: var(--muted); font-size: 0.83rem; }
.plant-card__varieties { font-size: 0.8rem; color: var(--brown-dark); font-weight: 600; }

.fit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  align-self: flex-start;
}
.fit--ok { background: var(--ok-bg); color: var(--ok); }
.fit--no { background: var(--bad-bg); color: var(--bad); }

/* ---------- Список постов / тем ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }
.item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 14px;
}
.item__thumb {
  flex: 0 0 84px;
  height: 84px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--green-soft), var(--earth));
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem;
}
.item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.item__body { min-width: 0; }
.item__body h3 { margin: 0 0 4px; font-size: 1.05rem; }
.item__body h3 a { color: var(--text); }
.item__body h3 a:hover { color: var(--green); }
.item__meta { color: var(--muted); font-size: 0.82rem; margin: 0 0 6px; }
.item__body p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ---------- Детальная страница ---------- */
.detail { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.detail__grid { display: grid; gap: 22px; }
@media (min-width: 760px) { .detail__grid { grid-template-columns: 340px 1fr; } }
.detail__cover {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--green-soft), var(--earth));
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem;
  overflow: hidden;
}
.detail__cover img { width: 100%; height: 100%; object-fit: cover; }
.specs { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin: 14px 0; }
.spec {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 0.86rem;
}
.spec b { display: block; color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tag { background: var(--earth); color: var(--brown-dark); font-size: 0.8rem; padding: 4px 10px; border-radius: 20px; }

/* ---------- Форум ---------- */
.forum-section { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.forum-section h3 { margin: 0 0 4px; }
.forum-section p { color: var(--muted); font-size: 0.9rem; margin: 0; }
.reply { border-left: 3px solid var(--green-line); padding: 10px 14px; margin: 12px 0; background: var(--cream); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.reply__meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }

/* ---------- Формы ---------- */
.form { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; max-width: 520px; }
.form .field { margin-bottom: 14px; }
.form--wide { max-width: 720px; }

/* ---------- Календарь ---------- */
.month-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.month-nav a { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--white); color: var(--text); font-size: 0.9rem; }
.month-nav a:hover { border-color: var(--green); }
.month-nav .current { background: var(--green); color: #fff; border-color: var(--green); }

.task-group { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.task-group h3 { display: flex; align-items: center; gap: 8px; }

/* ---------- Сообщения ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 11px 14px; border-radius: 9px; margin-bottom: 8px; font-size: 0.92rem; }
.messages .success { background: var(--ok-bg); color: var(--ok); }
.messages .error { background: var(--bad-bg); color: var(--bad); }
.messages .info { background: var(--green-soft); color: var(--green-dark); }

/* ---------- Категории каталога ---------- */
.cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 20px;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
.cat-chip:hover { border-color: var(--green); color: var(--green-dark); }
.cat-chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.cat-chip .count { font-size: 0.76rem; font-weight: 700; opacity: .75; }

/* ---------- Пагинация ---------- */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 22px; }
.pagination a, .pagination span { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--white); color: var(--text); font-size: 0.9rem; }
.pagination .current { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- Футер ---------- */
.footer { background: #23351f; color: rgba(255,255,255,0.82); padding: 34px 0 26px; margin-top: 40px; }
.footer a { color: rgba(255,255,255,0.9); }
.footer a:hover { color: #fff; }
.footer__grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer h4 { color: #fff; font-size: 1rem; margin-bottom: 10px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 7px; }
.footer__legal { border-top: 1px solid rgba(255,255,255,0.14); margin-top: 22px; padding-top: 18px; font-size: 0.82rem; color: rgba(255,255,255,0.6); }

/* ---------- Cookie-баннер ---------- */
.cookie {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 16px 18px;
  z-index: 100;
  display: none;
}
@media (min-width: 700px) { .cookie { left: auto; right: 20px; max-width: 420px; } }
.cookie p { margin: 0 0 12px; font-size: 0.9rem; }
.cookie__actions { display: flex; gap: 8px; }

/* ---------- Вспомогательное ---------- */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.empty { background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--green-soft); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--green-dark); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.filter-bar { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; }
.filter-bar form { display: grid; gap: 12px; }
@media (min-width: 720px) { .filter-bar form { grid-template-columns: 1.4fr repeat(5, 1fr) auto; align-items: end; } }

.article { max-width: 720px; margin: 0 auto; }
.article h1 { font-size: 1.8rem; }
.article h2 { margin-top: 1.4em; }
.article ul, .article ol { padding-left: 1.4em; }
.article li { margin-bottom: 0.4em; }
.article__cover { border-radius: var(--radius); margin-bottom: 18px; aspect-ratio: 16/7; background: linear-gradient(135deg, var(--green-soft), var(--earth)); display: flex; align-items: center; justify-content: center; font-size: 3rem; overflow: hidden; }
.article__cover img { width: 100%; height: 100%; object-fit: cover; }

.legal { max-width: 760px; margin: 0 auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.legal h2 { margin-top: 1.4em; }
