
/* Тема: чистый белый фон, зелёный только как акцент */
:root {
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --bg-elev-2: #f9fafb;
  --text: #111827;
  --muted: #6b7280;
  --brand: #9BC727;
  --brand-dark: #7a9e1f;
  --accent: #16a34a;
  --danger: #ef4444;
  --warning: #f59e0b;
  --card: #ffffff;
  --line: #e5e7eb;
  --chip: #f3f4f6;
  --font-heading: 'Cuprum', sans-serif;
  --font-body: 'Open Sans', sans-serif;
}

/* Базовые стили */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(155, 199, 39, 0.16), transparent 60%),
    radial-gradient(900px 420px at 90% -20%, rgba(37, 71, 47, 0.12), transparent 58%),
    linear-gradient(180deg, #f8fbf4 0%, #f3f7ef 45%, #eef4ea 100%);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Улучшение скролла на мобильных */
@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .sidebar {
    -webkit-overflow-scrolling: touch;
  }

  .main {
    overflow-x: hidden;
  }

  /* Улучшение читаемости текста */
  p {
    font-size: 14px;
    line-height: 1.6;
  }

  a {
  -webkit-tap-highlight-color: rgba(155, 199, 39, 0.15);
  touch-action: manipulation;
}

  /* Улучшение отображения ссылок в карточках */
  .card a {
    word-break: break-all;
  }
}

/* Улучшенная анимация появления */
.app {
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(244, 248, 238, 0.88)),
    repeating-linear-gradient(
      45deg,
      rgba(37, 71, 47, 0.016) 0px,
      rgba(37, 71, 47, 0.016) 2px,
      transparent 2px,
      transparent 8px
    );
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  padding: 28px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.page {
  display: none;
  flex: 1;
}

.page.active {
  display: block;
}

h4 {
  margin: 0 0 16px 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Горизонтальное меню в одну строку (по мотивам 21st + доступность MDN) */
.header-menu-line {
  position: sticky;
  top: 0;
  z-index: 95;
  background: linear-gradient(100deg, #0d1d0f 0%, #112713 45%, #17321a 100%);
  border-top: 1px solid rgba(155, 199, 39, 0.35);
  border-bottom: 1px solid rgba(155, 199, 39, 0.35);
  overflow: visible;
  box-shadow: 0 8px 20px rgba(11, 26, 14, 0.32);
  backdrop-filter: blur(6px);
}

.header-menu-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.header-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: visible;
  scrollbar-width: thin;
  min-width: 0;
  flex: 1;
}

.header-menu-list > li {
  flex-shrink: 0;
}

.header-menu-link,
.header-menu-group summary {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.header-menu-link:hover,
.header-menu-group summary:hover,
.header-menu-link:focus-visible,
.header-menu-group summary:focus-visible {
  color: #ffffff;
  background: rgba(155, 199, 39, 0.2);
  outline: none;
  transform: translateY(-1px);
}

.header-menu-link.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(155, 199, 39, 0.34), rgba(155, 199, 39, 0.2));
  box-shadow: inset 0 0 0 1px rgba(217, 245, 167, 0.45);
}

.header-menu-group {
  position: relative;
}

.header-menu-group details {
  position: relative;
}

.header-menu-group details[open] {
  z-index: 120;
}

.header-menu-group summary {
  list-style: none;
  cursor: pointer;
}

.header-menu-group summary::-webkit-details-marker {
  display: none;
}

.header-menu-group summary::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(255, 255, 255, 0.7);
  margin-left: 6px;
  transition: transform 0.2s ease;
}

.header-menu-group details[open] summary::after {
  transform: rotate(180deg);
}

.header-menu-dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(155, 199, 39, 0.24);
  background: linear-gradient(155deg, #102411 0%, #153019 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 3px;
  z-index: 130;
}

.header-menu-dropdown a {
  color: #d9f5a7;
  text-decoration: none;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.header-menu-dropdown a:hover,
.header-menu-dropdown a:focus-visible {
  color: #ffffff;
  background: rgba(155, 199, 39, 0.3);
  outline: none;
}

.header-menu-cta {
  display: inline-flex;
  flex-shrink: 0;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(155, 199, 39, 0.34), rgba(155, 199, 39, 0.22));
  border: 1px solid rgba(217, 245, 167, 0.5);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, transform 0.2s ease;
}

.header-menu-cta:hover,
.header-menu-cta:focus-visible {
  background: rgba(155, 199, 39, 0.3);
  transform: translateY(-1px);
  outline: none;
}

/* Новый визуальный стиль главной (полная перекомпоновка блоков) */
.new-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(155, 199, 39, 0.25);
  background: linear-gradient(120deg, #0e2010 0%, #163219 55%, #1f3d22 100%);
}

.new-hero-copy {
  padding: 44px 38px;
  color: #f1f9de;
}

.new-hero-kicker {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #9BC727;
}

.new-hero-title {
  margin: 0 0 14px;
  font-family: var(--font-heading);
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.new-hero-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(241, 249, 222, 0.9);
  max-width: 560px;
}

.new-hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.new-hero-tags {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.new-hero-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(155, 199, 39, 0.4);
  background: rgba(155, 199, 39, 0.1);
  color: #d9f5a7;
  font-size: 12px;
  font-weight: 700;
}

.new-hero-media {
  position: relative;
  min-height: 100%;
  background: #0a140a;
}

.new-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  mix-blend-mode: screen;
  opacity: 0.84;
}

.new-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.new-kpi-card {
  margin: 0;
  border-radius: 14px;
  border: 1px solid rgba(37, 71, 47, 0.13);
  background: linear-gradient(180deg, #ffffff 0%, #f7faef 100%);
  padding: 18px;
}

.new-kpi-card h3 {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.new-kpi-card p {
  margin: 0;
  color: #1f3d22;
  font-weight: 700;
  font-size: 18px;
  font-family: var(--font-heading);
}

.new-products-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.new-product-column {
  border: 1px solid rgba(37, 71, 47, 0.12);
  border-radius: 14px;
  background: #ffffff;
  padding: 18px;
}

.new-product-column h2 {
  margin: 0 0 14px;
  font-size: 18px;
  color: #1f3d22;
  font-family: var(--font-heading);
}

.new-product-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  background: #f9fbf4;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.new-product-item span {
  color: #1a2d1e;
  font-size: 14px;
  font-weight: 700;
}

.new-product-item small {
  color: var(--muted);
  font-size: 12px;
}

.new-product-item:hover {
  border-color: rgba(155, 199, 39, 0.45);
  transform: translateY(-1px);
}

.new-trust-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.new-about-block,
.new-resource-block {
  border-radius: 14px;
  border: 1px solid rgba(37, 71, 47, 0.12);
  background: #ffffff;
  padding: 22px;
}

.new-about-block h3,
.new-resource-block h3 {
  margin: 0 0 14px;
  color: #1f3d22;
  font-family: var(--font-heading);
  font-size: 22px;
}

.new-about-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.new-about-block li {
  position: relative;
  padding-left: 24px;
  font-size: 14px;
  color: #334155;
}

.new-about-block li::before {
  content: "●";
  position: absolute;
  left: 0;
  top: 0;
  color: #9BC727;
}

.new-about-block a,
.new-resource-block a {
  color: #4d7a15;
  text-decoration: none;
  font-weight: 700;
}

.new-about-block a:hover,
.new-resource-block a:hover {
  text-decoration: underline;
}

.new-resource-block p {
  margin: 12px 0 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
}

.topbar-slogan {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-dark);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--line);
}

.lang-pill {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
}

.lang-pill.active {
  background: var(--brand);
  color: #ffffff;
}

.lang-pill:not(.active):hover {
  background: rgba(148, 163, 184, 0.2);
}

.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

@media (min-width: 901px) {
  .menu-btn {
    display: none;
  }
}

.menu-btn .icon {
  width: 20px;
  height: 20px;
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

.formgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}

/* fadeIn animation removed - was blocking FCP */

/* Боковая панель - премиальный стиль */
.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--line);
  position: fixed;
  left: -280px;
  top: 0;
  height: 100vh;
  z-index: 1000;
  width: 280px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none;
}

.sidebar.open {
  left: 0;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.sidebar::before {
  display: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 0 0;
}

.sidebar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  opacity: 0.5;
  transition: all 0.2s;
  flex-shrink: 0;
}

.sidebar-close:hover {
  opacity: 1;
  background: var(--chip);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
  position: relative;
}

.brand::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: var(--line);
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  display: block;
  flex-shrink: 0;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease;
}

.brand:hover img {
  transform: rotate(5deg) scale(1.05);
}

.brand .t1 {
  font-weight: 800;
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: var(--text);
  font-family: var(--font-heading);
}

.brand .t2 {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1;
  letter-spacing: 0.5px;
}

/* Улучшенная навигация */
.nav {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
  flex: 1;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 16px 16px 6px;
  margin-top: 4px;
}

.nav-separator {
  height: 1px;
  background: var(--line);
  margin: 8px 12px;
}

.nav button,
.nav .nav-products-btn,
.nav .nav-logistics-btn,
.nav .nav-geography-btn {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
  min-height: 40px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
}

.nav button::before,
.nav .nav-products-btn::before,
.nav .nav-logistics-btn::before,
.nav .nav-geography-btn::before {
  display: none;
}

.nav button:hover,
.nav .nav-products-btn:hover,
.nav .nav-logistics-btn:hover,
.nav .nav-geography-btn:hover {
  background: var(--chip);
}

.nav button:hover::before,
.nav .nav-products-btn:hover::before,
.nav .nav-logistics-btn:hover::before,
.nav .nav-geography-btn:hover::before {
  display: none;
}

.nav button.active {
  background: rgba(155, 199, 39, 0.08);
  color: var(--brand-dark);
  font-weight: 600;
}

.nav button.active::before {
  display: none;
}

/* Nav links (for product/subpages — same look as buttons) */
.nav a.nav-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
  min-height: 40px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}
.nav a.nav-item::before {
  display: none;
}
.nav a.nav-item:hover {
  background: var(--chip);
  color: var(--text);
}
.nav a.nav-item:hover::before {
  display: none;
}
.nav a.nav-item.current {
  background: rgba(155, 199, 39, 0.06);
  border: 1px solid rgba(155, 199, 39, 0.15);
  color: var(--brand-dark);
  font-weight: 600;
}
.nav a.nav-item.current::before {
  display: none;
}

/* Products dropdown in sidebar */
.nav-products-wrap {
  position: relative;
}
.nav-products-btn {
  justify-content: space-between;
}
.nav-products-btn::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  transition: transform 0.2s ease;
}
.nav-products-wrap.open .nav-products-btn::after {
  transform: rotate(180deg);
}
.nav-dropdown {
  list-style: none;
  margin: 4px 0 0 0;
  padding: 4px 0 4px 12px;
  display: none;
  flex-direction: column;
  gap: 1px;
  border-left: 2px solid var(--line);
  margin-left: 14px;
}
.nav-products-wrap.open .nav-dropdown {
  display: flex;
}

/* Logistics dropdown in sidebar */
.nav-logistics-wrap {
  position: relative;
}
.nav-logistics-btn {
  justify-content: space-between;
}
.nav-logistics-btn::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  transition: transform 0.2s ease;
}
.nav-logistics-wrap.open .nav-logistics-btn::after {
  transform: rotate(180deg);
}
.nav-logistics-wrap.open .nav-dropdown {
  display: flex;
}

/* Geography dropdown in sidebar */
.nav-geography-wrap {
  position: relative;
}
.nav-geography-btn {
  justify-content: space-between;
}
.nav-geography-btn::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  transition: transform 0.2s ease;
}
.nav-geography-wrap.open .nav-geography-btn::after {
  transform: rotate(180deg);
}
.nav-geography-wrap.open .nav-dropdown {
  display: flex;
}

.nav-dropdown a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.nav-dropdown a:hover {
  color: var(--brand-dark);
  background: var(--chip);
}

/* Версия внизу */
.version {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
}

/* Верхняя панель - улучшенная */
.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar::before {
  display: none;
}

.menu-btn {
  background: var(--chip);
  border: 1px solid var(--line);
  color: var(--text);
  transition: all 0.3s ease;
}

.menu-btn:hover {
  transform: rotate(90deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Topbar Home Button */
.topbar-home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--chip);
  border: 1px solid var(--line);
  color: var(--brand);
  text-decoration: none;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.topbar-home:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(155, 199, 39, 0.3);
}
.topbar-home .icon {
  width: 18px;
  height: 18px;
}
@media (max-width: 480px) {
  .topbar-home {
    width: 36px;
    height: 36px;
  }
  .topbar-home .icon {
    width: 16px;
    height: 16px;
  }
}

/* Поиск - улучшенный */
.search {
  position: relative;
  flex: 1;
  max-width: 500px;
}

.search input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  background: var(--chip);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(155, 199, 39, 0.08);
  background: var(--bg);
}

.search .icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  transition: color 0.3s ease;
}

.search input:focus + .icon {
  color: var(--brand-dark);
}

/* Кнопки - премиальные */
.btn {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn::before {
  display: none;
}

.btn:hover::before {
  opacity: 1;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--brand);
}

.btn.primary {
  background: linear-gradient(135deg, #9BC727 0%, #78a11a 100%);
  border: none;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(122, 158, 31, 0.24);
}

.btn.primary:hover {
  box-shadow: 0 4px 16px rgba(155, 199, 39, 0.25);
  transform: translateY(-1px);
}

.btn.brand {
  background: linear-gradient(180deg, #fbfdf7 0%, #eef5df 100%);
  border: 1px solid rgba(122, 158, 31, 0.25);
  color: #4f6f16;
  font-weight: 600;
}

/* Карточки - улучшенные */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 252, 246, 0.92));
  border: 1px solid rgba(37, 71, 47, 0.12);
  border-radius: 14px;
  padding: 24px;
  box-shadow:
    0 4px 14px rgba(18, 40, 22, 0.07),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.card::before {
  display: none;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(122, 158, 31, 0.36);
  box-shadow:
    0 14px 28px rgba(19, 43, 24, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

/* Более выразительный стиль внутренних страниц продукта */
.product-page .card {
  border-radius: 18px;
  border-color: rgba(37, 71, 47, 0.16);
}

.product-page h1 {
  letter-spacing: 0.01em;
  text-shadow: 0 3px 10px rgba(122, 158, 31, 0.09);
}

.product-page .lead {
  font-size: 17px;
  color: #344351;
}

.product-hero,
.product-gallery img {
  box-shadow: 0 12px 26px rgba(15, 32, 19, 0.14);
}

/* KPI карточки - особый стиль */
.kpi-card {
  background: var(--bg);
  border: 1px solid var(--line);
}

.kpi-card .kpi {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
}

.kpi h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.kpi .val {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;
}

/* Обёртка карточек на главной: на десктопе — сетка 3 колонки на всю ширину, на мобильных — колонка */
.dashboard-product-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  align-self: stretch;
}
.dashboard-product-cards .product-card {
  grid-column: span 1 !important; /* перебить inline span 4 — на десктопе по 1 ячейке в сетке 3 колонки */
  min-width: 0;
  width: 100%;
}

/* Product cards (dashboard) */
.product-card {
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  backdrop-filter: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.product-card-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 80px;
}
.product-card-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  flex: 1;
}
.product-card-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--card);
}
.product-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.product-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
}
.product-card-title:hover {
  color: var(--brand-dark);
}
.product-card-cta {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand-dark);
  text-decoration: none;
}
.product-card-cta:hover {
  text-decoration: underline;
}

/* Dashboard hero image */
.dashboard-hero {
  margin-top: 8px;
}
.dashboard-hero-img-wrap {
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  max-width: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.dashboard-hero-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* SEO H1 */
.seo-h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 0;
  letter-spacing: 0.01em;
  line-height: 1.3;
  font-family: var(--font-heading);
}

/* SEO intro text block */
.seo-intro {
  padding: 20px 24px;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
}
.seo-intro p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
}
.seo-intro strong {
  color: var(--text);
}
.seo-intro a {
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 600;
}
.seo-intro a:hover {
  text-decoration: underline;
}

/* Why Agrokomplex Export */
.why-agrokomplex {
  margin-bottom: 24px;
}
.why-agrokomplex-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px 0;
  letter-spacing: 0.02em;
}
.why-agrokomplex-list {
  margin: 0;
  padding-left: 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
  list-style: none;
  padding-left: 0;
}
.why-agrokomplex-list li {
  margin-bottom: 0;
  padding-left: 24px;
  position: relative;
}
.why-agrokomplex-list li::before {
  content: '✔';
  position: absolute;
  left: 0;
  color: var(--brand-dark);
  font-weight: 700;
}
.why-agrokomplex-list a {
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 600;
}
.why-agrokomplex-list a:hover {
  text-decoration: underline;
}

/* Work with us */
.work-with-us {
  margin-top: 24px;
}
.work-with-us-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
.work-with-us-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.benefit-card {
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  backdrop-filter: none;
  padding: 20px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.benefit-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.benefit-card h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-dark);
  margin: 0 0 10px 0;
  letter-spacing: 0.03em;
}
.benefit-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* Бейджи */
.badge {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.badge.ok {
  /* Красный - подъем цены (положительное изменение) */
  color: #fecaca;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
  border-color: rgba(239, 68, 68, 0.3);
}

.badge.down {
  /* Зеленый - падение цены (отрицательное изменение) */
  color: #bbf7d0;
  background: linear-gradient(135deg, rgba(35, 197, 94, 0.2), rgba(35, 197, 94, 0.1));
  border-color: rgba(35, 197, 94, 0.3);
}

.badge.up {
  /* Красный - подъем цены (положительное изменение) */
  color: #fecaca;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
  border-color: rgba(239, 68, 68, 0.3);
}

.badge.zero {
  /* Желтый - без изменений (изменение = 0) */
  color: var(--muted);
  background: var(--chip);
  border-color: var(--line);
}

/* ВЕРТИКАЛЬНЫЕ БАРЫ / stocks */
.stocks-card {
  background: var(--bg);
  border: 1px solid var(--line);
}

/* Карточки для вкладок - премиальный стиль */
.prices-card,
.duties-card,
.news-card {
  background: var(--bg);
  border: 1px solid var(--line);
  position: relative;
}

.prices-card::before,
.duties-card::before,
.news-card::before {
  display: none;
}

.prices-card h4,
.duties-card h4,
.news-card h4 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-heading);
}

/* Улучшение для контента внутри карточек */
.news-card #news-list {
  margin-top: 8px;
}

.stocks-container {
  width: 100%;
  height: 320px;
  margin-top: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 40px;
  padding: 0 20px;
  position: relative;
  flex-wrap: wrap;
}

/* Бар с анимацией заполнения */
.stock-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
  flex: 1;
  min-width: 80px;
  max-width: 100px;
}

.bar-container {
  width: 50px;
  height: 240px;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: linear-gradient(180deg, 
    var(--brand) 0%,
    #1e7a38 50%,
    var(--accent) 100%
  );
  border-radius: 8px 8px 0 0;
  transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -2px 8px rgba(155, 199, 39, 0.2);
}

/* Показатель над баром */
.bar-value {
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--chip);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  min-width: 60px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Подпись под баром */
.bar-label {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
  text-align: center;
  padding: 8px 0;
  background: var(--chip);
  border-radius: 6px;
  width: 100%;
  line-height: 1.2;
}

/* Единица измерения справа от значения */
.bar-unit {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-left: 1px;
}

/* Таблицы - улучшенные */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: visible;
  background: var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  margin-top: 20px;
}

.table-wrap::-webkit-scrollbar {
  height: 8px;
}

.table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  background: var(--chip);
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-size: 12px;
}

.table td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  transition: all 0.3s ease;
}

.table tbody tr {
  transition: all 0.3s ease;
}

.table tbody tr:hover {
  background: var(--chip);
}

.table tbody tr:hover td {
  color: var(--text);
}

/* Новости - улучшенные */
.news-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.news-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.news-item:hover {
  transform: translateX(4px);
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.news-item:hover::before {
  transform: translateX(0);
}

.news-item .date {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

/* Форма контактов */
.formgrid label {
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.formgrid input,
.formgrid textarea {
  background: var(--chip);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 14px;
  border-radius: 12px;
  margin-top: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.formgrid input[type="search"],
.search input {
  -webkit-appearance: none;
  appearance: none;
}

.formgrid input:focus,
.formgrid textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(155, 199, 39, 0.08);
  background: var(--bg);
}

/* Toasts */
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 16px 24px;
  border-radius: 12px;
  display: none;
  z-index: 1000;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Mobile улучшения для баров */
@media (max-width: 1200px) {
  .stocks-container {
    gap: 30px;
  }
  
  .stock-bar {
    min-width: 70px;
  }
  
  .bar-container {
    width: 45px;
    height: 200px;
  }
}

/* Overlay for sidebar — global */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  backdrop-filter: blur(2px);
  transition: opacity 0.3s ease;
}

.overlay.show {
  display: block;
}

@media (max-width: 900px) {
  .new-hero {
    grid-template-columns: 1fr;
  }

  .new-hero-copy {
    padding: 26px 20px;
  }

  .new-hero-title {
    font-size: 31px;
  }

  .new-hero-media {
    min-height: 260px;
  }

  .new-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .new-products-layout {
    grid-template-columns: 1fr;
  }

  .new-trust-layout {
    grid-template-columns: 1fr;
  }

  .header-menu-inner {
    padding: 8px 12px;
  }

  .menu-btn {
    display: inline-flex;
  }

  .topbar {
    padding: 12px 16px;
  }

  .topbar-left {
    gap: 12px;
  }

  .topbar-slogan {
    font-size: 14px;
    white-space: normal;
    max-width: 280px;
  }

  .search {
    max-width: none;
    flex: 1;
  }

  .search input {
    font-size: 14px;
    padding: 12px 14px 12px 40px;
  }

  .kpi .val {
    font-size: 28px;
  }

  .card {
    padding: 20px;
    border-radius: 16px;
  }

  #loginBtn,
  #logoutBtn {
    padding: 10px 14px;
    font-size: 13px;
  }

  #loginBtn .icon,
  #logoutBtn .icon {
    width: 16px;
    height: 16px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 14px;
  }

  /* Барам на мобильных */
  .stocks-container {
    height: 280px;
    gap: 20px;
    padding: 0 15px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }

  .stock-bar {
    flex-shrink: 0;
  }

  /* Обёртка карточек продуктов — принудительно колонка при <900px (fix <760px) */
  .dashboard-product-cards {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .dashboard-product-cards .product-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto;
  }

  /* Одна колонка на планшетах и телефонах */
  .grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  .card[style*="grid-column"],
  .product-card,
  .kpi-card {
    grid-column: span 1 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Карточки продуктов — текст строго горизонтально, без поворота (iPhone) */
  #dashboard .product-card,
  .product-card {
    transform: none !important;
  }
  .product-card-inner {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    min-height: 72px;
    transform: none !important;
  }
  .product-card-text {
    writing-mode: horizontal-tb !important;
    -webkit-writing-mode: horizontal-tb !important;
    min-width: 120px;
    flex: 1 1 auto;
    transform: none !important;
  }
  .product-card-title,
  .product-card-cta {
    white-space: normal !important;
    text-align: left !important;
    display: block !important;
    transform: none !important;
  }
  .product-card-thumb {
    flex-shrink: 0 !important;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 600px;
  }

  .stock-bar {
    min-width: 60px;
  }
  
  .bar-container {
    width: 40px;
    height: 180px;
  }

  .bar-value {
    font-size: 12px;
    padding: 5px 10px;
    min-width: 55px;
    top: -30px;
  }

  .bar-label {
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  .header-menu-link,
  .header-menu-group summary {
    min-height: 36px;
    font-size: 14px;
    padding: 7px 12px;
  }

  .header-menu-dropdown {
    min-width: 200px;
  }

  .header-menu-list {
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 2px;
  }

  .grid {
    grid-template-columns: 1fr !important;
  }

  .product-card {
    grid-column: span 1 !important;
    width: 100%;
  }
  .product-card-inner {
    flex-direction: row;
    align-items: center;
  }
  .product-card-text {
    writing-mode: horizontal-tb;
    flex: 1;
    min-width: 0;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .topbar-left {
    width: 100%;
    order: 1;
  }

  #loginBtn,
  #logoutBtn {
    order: 2;
    width: auto;
    margin-left: auto;
  }

  .brand {
    padding: 16px 12px;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .brand .t1 {
    font-size: 16px;
  }

  .brand .t2 {
    font-size: 12px;
  }

  .nav {
    padding: 0 8px;
    margin-top: 16px;
  }

  .nav button,
  .nav .nav-products-btn,
  .nav .nav-logistics-btn,
  .nav .nav-geography-btn {
    padding: 12px 14px;
    font-size: 14px;
  }

  .version {
    padding: 12px;
    font-size: 11px;
  }

  .grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .card[style*="grid-column"] {
    grid-column: span 1 !important;
  }

  .kpi-card,
  .product-card {
    grid-column: span 1 !important;
  }

  .work-with-us-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kpi-card,
  .product-card {
    min-width: 0;
    width: 100%;
  }

  .kpi .val {
    font-size: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .kpi h3 {
    font-size: 12px;
  }

  .stocks-container {
    height: 280px;
    flex-direction: row;
    align-items: flex-end;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 0 12px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }
  
  .stock-bar {
    flex-direction: column;
    width: auto;
    max-width: none;
    min-width: 50px;
    gap: 12px;
    flex-shrink: 0;
  }
  
  .bar-container {
    width: 45px;
    height: 180px;
    flex-shrink: 0;
  }
  
  .bar-value {
    top: -30px;
    font-size: 12px;
    padding: 4px 8px;
    min-width: 50px;
  }
  
  .bar-label {
    width: 100%;
    text-align: center;
    padding: 6px 0;
    font-size: 11px;
  }

  .table {
    min-width: 700px;
    font-size: 13px;
  }

  .table th,
  .table td {
    padding: 12px 10px;
  }

  .news-item {
    padding: 16px;
  }

  .formgrid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  h4 {
    font-size: 18px;
  }
}

@media (max-width: 600px) {
  .new-hero-title {
    font-size: 26px;
  }

  .new-kpi-row {
    grid-template-columns: 1fr;
  }

  .new-about-block h3,
  .new-resource-block h3 {
    font-size: 18px;
  }

  .header-menu-inner {
    padding: 7px 8px;
  }

  .header-menu-link,
  .header-menu-group summary {
    font-size: 13px;
    padding: 6px 11px;
  }

  .topbar {
    padding: 10px 12px;
  }

  .search input {
    font-size: 13px;
    padding: 10px 12px 10px 36px;
  }

  .search .icon {
    left: 12px;
    width: 18px;
    height: 18px;
  }

  #loginBtn,
  #logoutBtn {
    padding: 8px 12px;
    font-size: 12px;
  }

  #loginBtn span,
  #logoutBtn span {
    display: none;
  }

  .sidebar {
    width: 260px;
    left: -260px;
  }

  .brand {
    padding: 14px 10px;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .brand .t1 {
    font-size: 15px;
  }

  .nav button,
  .nav .nav-products-btn,
  .nav .nav-logistics-btn,
  .nav .nav-geography-btn {
    padding: 10px 12px;
    font-size: 13px;
  }

  .grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .card[style*="grid-column: span"] {
    grid-column: span 1 !important;
  }

  .kpi-card,
  .product-card {
    grid-column: span 1 !important;
  }

  .kpi-card,
  .product-card {
    min-width: 0;
    width: 100%;
  }

  .kpi .val {
    font-size: 22px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .kpi h3 {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .card {
    padding: 16px;
    border-radius: 14px;
  }

  .btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  .table {
    min-width: 600px;
    font-size: 12px;
  }

  .table th,
  .table td {
    padding: 10px 8px;
  }

  .badge {
    font-size: 11px;
    padding: 4px 8px;
  }

  h4 {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .news-item {
    padding: 14px;
  }

  .news-item .date {
    font-size: 11px;
  }

  .formgrid {
    gap: 12px;
  }

  .formgrid label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .formgrid input,
  .formgrid textarea {
    padding: 10px;
    font-size: 13px;
  }

  .stocks-container {
    height: 260px;
    padding: 0 10px;
    gap: 10px;
  }
  
  .stock-bar {
    gap: 10px;
    min-width: 45px;
  }
  
  .bar-container {
    width: 40px;
    height: 160px;
  }

  .bar-value {
    font-size: 11px;
    padding: 4px 6px;
    min-width: 45px;
    top: -25px;
  }

  .bar-label {
    font-size: 11px;
    width: 100%;
    text-align: center;
  }

  .news-item {
    padding: 14px;
  }

  .news-item .date {
    font-size: 11px;
  }

  .formgrid {
    gap: 12px;
  }

  .formgrid label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .formgrid input,
  .formgrid textarea {
    padding: 10px;
    font-size: 13px;
  }

  .stocks-container {
    height: 260px;
    padding: 0 10px;
    gap: 10px;
  }
  
  .stock-bar {
    gap: 10px;
    min-width: 45px;
  }
  
  .bar-container {
    width: 40px;
    height: 160px;
  }

  .bar-value {
    font-size: 11px;
    padding: 4px 6px;
    min-width: 45px;
    top: -25px;
  }

  .bar-label {
    font-size: 11px;
    width: 100%;
    text-align: center;
  }

  .formgrid input,
  .formgrid textarea,
  .search input {
    font-size: 16px; /* Предотвращает зум на iOS */
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 8px 10px;
  }

  .topbar-left {
    gap: 8px;
  }

  .search {
    min-width: 0;
  }

  .search input {
    font-size: 12px;
    padding: 8px 10px 8px 32px;
  }

  .search .icon {
    left: 10px;
    width: 16px;
    height: 16px;
  }

  .menu-btn {
    padding: 8px;
    width: 36px;
    height: 36px;
  }

  .menu-btn .icon {
    width: 18px;
    height: 18px;
  }

  #loginBtn,
  #logoutBtn {
    padding: 8px 10px;
    min-width: 36px;
  }

  .sidebar {
    width: 240px;
    left: -240px;
  }

  .brand {
    padding: 12px 8px;
    gap: 10px;
  }

  .brand img {
    width: 32px;
    height: 32px;
  }

  .brand .t1 {
    font-size: 14px;
  }

  .brand .t2 {
    font-size: 11px;
  }

  .nav {
    margin-top: 12px;
    gap: 4px;
  }

  .nav button,
  .nav .nav-products-btn,
  .nav .nav-logistics-btn,
  .nav .nav-geography-btn {
    padding: 10px 12px;
    font-size: 12px;
    gap: 10px;
  }

  .version {
    padding: 10px 8px;
    font-size: 10px;
  }

  .grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .card[style*="grid-column"] {
    grid-column: span 1 !important;
  }

  .kpi-card,
  .product-card {
    grid-column: span 1 !important;
  }

  .card {
    padding: 14px;
    border-radius: 12px;
  }

  .work-with-us-grid {
    grid-template-columns: 1fr;
  }

  .why-agrokomplex-list {
    grid-template-columns: 1fr;
  }

  .kpi-card,
  .product-card {
    min-width: 0;
    width: 100%;
  }

  .kpi .val {
    font-size: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .kpi h3 {
    font-size: 10px;
    margin-bottom: 6px;
  }

  .btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .table {
    min-width: 550px;
    font-size: 11px;
  }

  .table th,
  .table td {
    padding: 8px 6px;
  }

  .badge {
    font-size: 10px;
    padding: 3px 6px;
  }

  h4 {
    font-size: 15px;
    margin-bottom: 10px;
  }

  .news-item {
    padding: 12px;
  }

  .news-item .date {
    font-size: 10px;
    margin-bottom: 6px;
  }

  .formgrid {
    gap: 12px;
  }

  .formgrid label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .formgrid input,
  .formgrid textarea {
    padding: 10px;
    font-size: 13px;
  }

  .stocks-container {
    height: 240px;
    padding: 0 8px;
    gap: 8px;
  }
  
  .stock-bar {
    gap: 8px;
    min-width: 40px;
  }
  
  .bar-container {
    width: 35px;
    height: 140px;
  }

  .bar-value {
    font-size: 10px;
    padding: 3px 6px;
    min-width: 40px;
    top: -22px;
  }
  
  .bar-label {
    font-size: 10px;
    width: 100%;
    text-align: center;
  }

  .bar-unit {
    font-size: 9px;
  }

  .toast {
    left: 10px;
    right: 10px;
    transform: translateX(0);
    padding: 12px 16px;
    font-size: 13px;
  }
}

/* Анимации для появления элементов — без блокировки FCP */
@media (prefers-reduced-motion: no-preference) {
  .card, .kpi-card, .product-card, .news-item, .table-wrap, .stock-bar {
    animation: fadeInUp 0.6s ease both;
  }

  @keyframes fadeInUp {
    from {
      opacity: 0.8;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Задержки для анимации */
  .card:nth-child(1) { animation-delay: 0.05s; }
  .card:nth-child(2) { animation-delay: 0.1s; }
  .card:nth-child(3) { animation-delay: 0.15s; }
  .card:nth-child(4) { animation-delay: 0.2s; }
  .stock-bar:nth-child(1) { animation-delay: 0.25s; }
  .stock-bar:nth-child(2) { animation-delay: 0.3s; }
  .stock-bar:nth-child(3) { animation-delay: 0.35s; }
  .stock-bar:nth-child(4) { animation-delay: 0.4s; }
  .stock-bar:nth-child(5) { animation-delay: 0.45s; }
  .stock-bar:nth-child(6) { animation-delay: 0.5s; }
}

/* ── Mobile UX Improvements ── */

/* Promo banner sticky on mobile */
@media (max-width: 768px) {
  .promo-banner {
    border-radius: 0;
    margin: -16px -16px 16px -16px;
    width: calc(100% + 32px);
  }
}

/* Improved touch targets */
@media (max-width: 900px) {
  .nav button,
  .nav .nav-products-btn,
  .nav .nav-logistics-btn,
  .nav .nav-geography-btn,
  .nav a.nav-item {
    min-height: 48px;
  }

  /* Smoother sidebar animation */
  .sidebar {
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Better overlay */
  .overlay {
    transition: opacity 0.35s ease;
    opacity: 0;
  }
  .overlay.show {
    opacity: 1;
  }
}

/* Product CTA buttons responsive */
@media (max-width: 480px) {
  .product-cta-buttons {
    flex-direction: column !important;
  }
  .product-cta-buttons .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Quick Request Form responsive */
@media (max-width: 600px) {
  .formgrid {
    grid-template-columns: 1fr;
  }
}

/* Promo cards responsive */
.promo-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

@media (max-width: 480px) {
  .promo-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Badge color fixes for light theme */
.badge.ok {
  color: #dc2626;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
  border-color: rgba(239, 68, 68, 0.2);
}

.badge.down {
  color: #16a34a;
  background: linear-gradient(135deg, rgba(35, 197, 94, 0.1), rgba(35, 197, 94, 0.05));
  border-color: rgba(35, 197, 94, 0.2);
}

.badge.up {
  color: #dc2626;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
  border-color: rgba(239, 68, 68, 0.2);
}

.badge.zero {
  color: var(--muted);
  background: var(--chip);
  border-color: var(--line);
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* ---- Product Links Grid (grouped navigation) ---- */
.product-links-nav {
  margin: 28px 0 0 0;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(37, 71, 47, 0.06), rgba(37, 71, 47, 0.02));
  border: 1px solid rgba(37, 71, 47, 0.12);
  border-radius: 14px;
}
.product-links-nav .product-links-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 16px 0;
}
.product-links-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.product-links-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-links-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(37, 71, 47, 0.1);
}
.product-links-nav a {
  color: var(--brand);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
  transition: color 0.15s;
}
.product-links-nav a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .product-links-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .product-links-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .product-links-nav {
    padding: 16px;
  }
}

/* FAB space on mobile — prevent overlap with content */
@media (max-width: 768px) {
  .main {
    padding-bottom: 80px;
  }
}
