:root{
  --bg:#f9fafb;
  --ink:#1f2937;
  --muted:#6b7280;
  --brand:#f08a24;
  --brand-hover:#d97706;
  --card:#ffffff;
  --card-alt:#fdfaf7;
  --rule:#e5e7eb;

  --space-xxs:6px; --space-xs:10px; --space-s:14px;
  --space-m:18px;  --space-l:24px;  --space-xl:32px;

  --radius-m:16px; --radius-s:12px;
  --shadow-sm:0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(31,41,55,.04);
}

/* ===== БАЗА ===== */
*,
*::before,
*::after{ box-sizing:border-box; }

html,body{
  margin:0; padding:0; background:var(--bg); color:var(--ink);
  font-family:Manrope,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  line-height:1.55; -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  overflow-x:clip; /* без горизонтального скролла */
  scroll-behavior:smooth;
}
img{max-width:100%;display:block}

/* безопасные отступы на iPhone */
.container{
  max-width:1120px;
  margin-inline:auto;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right:max(20px, env(safe-area-inset-right));
}
.section{margin-block:var(--space-xl);}
h1,h2,h3{margin:0 0 10px;}
h2{font-size:28px; line-height:1.2; font-weight:800;}
.muted{color:var(--muted);}
.card{background:var(--card); border:1px solid var(--rule); border-radius:var(--radius-m); padding:18px; box-shadow:var(--shadow-sm);}
a{ color:var(--brand); text-decoration:none; }
a:hover{ color:var(--brand-hover); text-decoration:underline; }

/* ===== HERO ===== */
.hero{ background:#F9F0DB; padding-block:var(--space-l); }
.hero__inner{
  display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,0.8fr);
  gap:var(--space-l); align-items:flex-start;
}
.hero__logo{display:block; width:100%; max-width:520px; height:auto; object-fit:contain;}
.hero__lead{ font-size:18px; line-height:1.65; margin:8px 0 var(--space-m); }

/* Контакты — спокойные ссылки */
.cnt-link{ color:var(--ink); border-bottom:1px solid rgba(0,0,0,.12); text-decoration:none; }
.cnt-link:hover{ color:var(--brand); border-bottom-color: currentColor; }

/* ===== КНОПКИ ===== */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:12px 16px; border-radius:16px;
  border:1px solid var(--rule); background:#fff; color:#111827;
  font-weight:700; box-shadow:var(--shadow-sm);
  transition:.2s box-shadow,.2s transform,.2s border-color,.2s background;
}
.btn:hover{ transform:translateY(-1px); box-shadow:0 10px 24px rgba(31,41,55,.08); }
.btns-row{ display:flex; gap:12px; flex-wrap:wrap; margin:10px 0; }
.btn-ico{ width:20px; height:20px; display:block; }
.btn-accent{ background:var(--brand); color:#fff; border-color:transparent; }
.btn-accent:hover{ background:var(--brand-hover); }

/* ===== КАТЕГОРИИ ===== */
.cats-grid{
  display: grid;
  grid-template-columns: repeat(6, 150px);
  justify-content: center;
  gap: 16px;
  margin: 28px auto;
}
.cats-grid .cat{
  display:flex; flex-direction:column; align-items:center;
  text-decoration:none; color:var(--ink); text-align:center;
}
.cats-grid .cat img{
  width:150px; height:150px; object-fit:cover;
  border-radius:12px; box-shadow:var(--shadow-sm);
}
.cats-grid .cat p{
  margin-top:6px; font-size:12px; font-weight:600; line-height:1.15;
  max-width:150px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:center;
}
/* мобайл: 3 в ряд */
@media (max-width: 768px){
  .cats-grid{
    --m-gap:14px;
    display:flex; flex-wrap:wrap; gap:var(--m-gap); justify-content:center;
    margin:20px auto;
  }
  .cats-grid .cat{
    flex: 0 0 calc((100% - (2 * var(--m-gap))) / 3);
    min-width:0;
  }
  .cats-grid .cat img{
    width:100%; aspect-ratio:1/1; height:auto; object-fit:cover;
    border-radius:12px; box-shadow:var(--shadow-sm);
  }
  .cats-grid .cat p{
    max-width:100%;
    margin-top:6px; font-size:12px; line-height:1.15; text-align:center;
  }
}

/* ===== ЛЕНТА + ПОСТЫ ===== */
#feed-and-posts{
  display:grid;
  grid-template-columns: 1fr 2fr; /* лента = 1/3, посты = 2/3 */
  gap: var(--space-l);
  align-items:start;
}
#feed-and-posts > *{ min-width:0; }

@media(max-width:1024px){
  #feed-and-posts{ grid-template-columns:1fr; }
}

/* Лента — СПИСОК БЕЗ КАРТИНОК */
.feed{
  width:100%;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: 0;
  display: flex;
  flex-direction: column;
  min-width:0;
}
/* Строка ленты: текст слева (может переноситься), дата справа фикс. */
.feed-row{
  display:grid;
  grid-template-columns: 1fr auto;
  align-items:start;
  column-gap:12px;
  row-gap:4px;
  padding: 10px 14px;
  border-bottom:1px solid var(--rule);
  cursor:pointer;
  font-size:15px;
  line-height:1.4;
  transition: background .15s ease;
}
.feed-row:last-child{ border-bottom:none; }
.feed-row:hover{ background:#fdfaf7; }

.feed-row-text{
  min-width:0;
  overflow-wrap: anywhere;     /* переносим длинные «слова»/артикулы */
  word-break: break-word;
  white-space: normal;         /* разрешаем перенос строк */
  color:var(--ink);
}
.feed-row-date{
  min-width:max-content;       /* дата не ломается и не прыгает */
  color:var(--muted);
  font-size:13px;
  text-align:right;
}

/* ===== ПОСТЫ ===== */
.cat-block{
  width:100%;
  margin-bottom: var(--space-xl);
  background:#fff;
  border:1px solid var(--rule);
  border-radius:14px;
  padding:16px;
  box-shadow:var(--shadow-sm);
  min-width:0;
}
.cat-heading{ display:flex; align-items:center; margin-bottom:12px; }
.cat-heading h2{ font-size:26px; }

.specials{ display:grid; gap: var(--space-s); grid-template-columns:1fr; }
@media (min-width: 720px){ .specials{ grid-template-columns:repeat(2, 1fr); } }

.post{
  background:var(--card-alt); border:1px solid var(--rule); border-radius:14px;
  padding:var(--space-s) var(--space-m); display:grid; gap: var(--space-xxs);
}
.post .date{ color:var(--muted); font-size:.9rem; }
.post .text{ font-size:1.02rem; line-height:1.7; white-space:pre-wrap; word-break:break-word; }
.post__files a{ color:var(--brand); text-decoration:none; }
.post__files a:hover{ color:var(--brand-hover); text-decoration:underline; }

/* ===== НИЖНИЙ БЛОК: слева УСЛОВИЯ — справа КАРТА ===== */
.grid-2{
  display:grid; grid-template-columns: 1fr 1fr;
  gap: var(--space-l); align-items:start;
}
.grid-2 > *{ min-width:0; }

@media(max-width:1024px){ .grid-2{ grid-template-columns:1fr; } }

.features{ display:grid; gap:12px; }
.feature{
  border:1px solid var(--rule); background:#fff; border-radius:12px;
  padding:14px; display:flex; flex-direction:column; gap:6px;
}
.feature-head{ display:flex; align-items:center; gap:10px; }
.feature-icon{ width:32px; height:32px; display:flex; align-items:center; justify-content:center; color:var(--brand); }
.feature-title{ font-weight:800; margin:0; }
.map-wrap iframe{ display:block; width:100%; height:380px; border:0; border-radius:12px; box-shadow:var(--shadow-sm); }

/* ===== МОДАЛКА ===== */
.modal{ position:fixed; inset:0; display:none; }
.modal--show{ display:block; }
.modal__backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.45); }
.modal__dialog{
  position:relative; z-index:2; max-width:560px; width:calc(100% - 32px);
  margin: 10vh auto 0; background:#fff; border-radius:16px; box-shadow: 0 20px 40px rgba(15,23,42,.2);
  padding:20px;
}
.modal__close{
  position:absolute; top:8px; right:10px; width:36px; height:36px; border:none; border-radius:999px;
  background:#f3f4f6; color:#111827; font-size:20px; cursor:pointer;
}
.modal__close:hover{ background:#e5e7eb; }

/* форма — один столбец */
.form-grid{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.form-grid label{ display:flex; flex-direction:column; gap:6px; }
.form-grid input,
.form-grid textarea{
  width:100%;
  border:1px solid var(--rule);
  border-radius:10px;
  padding:10px 12px;
  background:#fff;
  font:inherit;
}
.form-grid__full{ width:100%; }
.modal__actions{ display:flex; gap:10px; flex-wrap:wrap; }
@media (max-width: 480px){
  .modal__dialog{ width:calc(100% - 24px); margin:8vh auto 0; padding:16px; }
  .modal__actions{ flex-direction:column; }
  .modal__actions .btn{ width:100%; }
}
.hp{ display:none; }

/* ===== Плавающая кнопка «Наверх» ===== */
.float-top{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  width: 44px; height: 44px;
  border: none; border-radius: 9999px;
  background: var(--brand); color: #fff;
  font-size: 20px; font-weight: 800; line-height: 44px; text-align: center;
  box-shadow: 0 10px 24px rgba(31,41,55,.18);
  cursor: pointer;
  opacity: 0; transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s, transform .2s, background .2s, box-shadow .2s;
}
.float-top:hover{ background: var(--brand-hover); box-shadow: 0 12px 28px rgba(31,41,55,.22); }
.float-top--show{ opacity: 1; transform: translateY(0); pointer-events: auto; }
@media (max-width: 380px){ .float-top{ right: 12px; bottom: 12px; } }

/* ===== ФУТЕР ===== */
.footer{ border-top:1px solid var(--rule); background:#fff; color:var(--muted); padding:18px 0; margin-top:var(--space-xl); }
.footer-row{ display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }

/* ===== Адаптив hero-сетки ===== */
@media (max-width:1024px){
  .hero__inner{ grid-template-columns:1fr; }
}

/* узкие экраны — чуть меньше поля */
@media (max-width: 390px){
  .container{ padding-left:max(12px, env(safe-area-inset-left)); padding-right:max(12px, env(safe-area-inset-right)); }
}