/* responsive.css — только адаптив, десктоп не меняем */
*{ box-sizing: border-box; }
img,video{ max-width:100%; height:auto; display:block; }

/* телефоны */
@media (max-width: 768px){

  /* шапка компактная и без щелей */
  header, .header, .navbar{
    position: sticky; top:0; z-index:1000;
    background:#fff;
    border-bottom:1px solid #eee;
  }
  header .inner, .header .inner, .navbar .inner{
    display:flex; align-items:center; justify-content:space-between;
    min-height:56px; padding:0 12px;
  }
  .logo img{ max-height:40px; }

  /* герой: кнопка ровная */
  .hero .btn, .btn-primary{
    display:inline-flex; align-items:center; justify-content:center;
    padding:12px 20px; line-height:1.1; white-space:nowrap;
    width:100%; max-width:320px; margin:0;
  }

  /* заголовки не рвутся: уменьшаем размер вместо переносов */
  .page-title, .hero__title, h1{
    font-size: clamp(22px, 7vw, 32px);
    line-height:1.1;
    text-align:center;
    white-space:nowrap;
  }

  /* хлебные крошки — одна строка с троеточием */
  .breadcrumbs{
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
    font-size:14px;
  }

  /* карточки: одна колонка, картинки по центру */
  .grid-3, .cards, .cards-row{
    display:grid; grid-template-columns:1fr; gap:16px;
  }
  .card{ text-align:center; padding:16px; }
  .card__media, .thumb, .image{ display:flex; justify-content:center; }
  .card img{ margin:auto; max-width:160px; height:auto; }

  /* аккуратные поля по краям */
  .container, main, section{ padding-inline:12px; }
  p{ font-size: clamp(14px, 3.8vw, 16px); }
}

/* планшеты */
@media (min-width:769px) and (max-width:1024px){
  .grid-3, .cards, .cards-row{ grid-template-columns:1fr 1fr; gap:20px; }
}
/* ===== MOBILE FIX PACK (<=768px) — ПК не трогаем ===== */
@media (max-width: 768px){

  /* 0) Общие мелочи */
  html, body { margin:0; overflow-x:hidden; }
  img{ max-width:100%; height:auto; display:block; }

  /* 1) Шапка: полная ширина, без скруглений, сверху не «торчит» фон */
  header, .header, .navbar{
    position: sticky; top:0; z-index:1000;
    width:100%;
    background:#fff;
    border:0; border-radius:0; box-shadow:0 1px 0 rgba(0,0,0,.06);
  }
  header .inner, .header .inner, .navbar .inner{
    display:flex; align-items:center; justify-content:space-between;
    min-height:56px; padding:0 14px;
  }
  .logo img{ max-height:36px; }

  /* 2) Отступы секций */
  section, .section{ padding-left:14px; padding-right:14px; }

  /* 3) Hero: заголовок/текст читаемые, томат не наезжает, кнопка ровная */
  .hero{ padding: 10px 14px 20px; }
  .hero h1, .hero__title{
    font-size: clamp(24px, 7vw, 32px);
    line-height:1.1; margin:0 0 10px; max-width:26ch;
  }
  .hero p{ font-size: clamp(14px, 3.8vw, 16px); margin: 6px 0 14px; max-width:35ch; }
  .hero .btn{
    display:inline-flex; align-items:center; justify-content:center;
    width:100%; max-width:320px; padding:12px 18px; line-height:1.1; white-space:nowrap;
  }
  .hero .btn::before, .hero .btn::after{ transform:none !important; } /* чтобы «тень/границы» не съезжали */
  /* декоративная картинка в hero — ниже текста и без абсолютов */
  .hero img, .hero__img{
    position: static !important; transform:none !important;
    margin:12px auto 0; max-width:45vw; height:auto;
  }

  /* 4) Хлебные крошки и заголовки разделов — аккуратнее, не ломаются */
  .breadcrumbs{
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:14px;
    padding:0 14px;
  }
  .section-title, .page-title, h1.title{
    font-size: clamp(22px, 7vw, 32px); line-height:1.15; text-align:center; margin-bottom:12px;
  }

  /* 5) Блок «Наші переваги» (твои карточки) */
  .adv-cards{
    display:grid; grid-template-columns:1fr; gap:16px; padding:0;
  }
  .adv-card{
    display:flex; flex-direction:column; align-items:center; text-align:center;
    padding:16px;
  }
  .adv-card > img{
    margin:0 auto 10px !important; position:static !important; transform:none !important; float:none !important;
    max-width:180px; height:auto;
  }

  /* 6) Блок с цифрами (4 РОКИ / 300 ТОНН / 15 ГА) — в столбик */
  .stats, .numbers, .facts{ display:grid; grid-template-columns:1fr; gap:12px; text-align:center; }
  .stats > *, .numbers > *, .facts > *{ padding:8px 0; }

  /* 7) «Асортимент категорій» — карточки по одной, изображения не гигантские */
  .category-cards, .catalog-cards, .products-grid{ display:grid; grid-template-columns:1fr; gap:16px; }
  .category-card img, .catalog-card img, .product-card img{
    margin:auto; max-width:180px; height:auto; object-fit:contain;
  }

  /* 8) Чтобы заголовки не пр прилипали под fixed-меню при якорях */
  :target, .section-title, .page-title, h1.title{ scroll-margin-top:72px; }
}

/* ===== Tablets (769–1024px): 2 колонки вместо 3 ===== */
@media (min-width: 769px) and (max-width: 1024px){
  .adv-cards, .category-cards, .catalog-cards, .products-grid{
    display:grid; grid-template-columns:1fr 1fr; gap:20px;
  }
}
/* ===== MOBILE FIX (<=768px). ПК не меняем ===== */
@media (max-width: 768px){

  /* 0) Без горизонтальной прокрутки */
  html, body { overflow-x: hidden; }
  img { max-width: 100%; height: auto; display: block; }

  /* 1) HERO: томат не наезжает на заголовок, кнопка ровная */
  .hero { padding: 10px 14px 20px; position: relative; }
  .hero h1, .hero__title{
    font-size: clamp(24px, 7vw, 32px);
    line-height: 1.1; margin: 0 0 10px; max-width: 26ch;
  }
  .hero p{ font-size: clamp(14px, 3.8vw, 16px); margin: 6px 0 14px; max-width: 35ch; }
  .hero .btn{
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%; max-width: 320px; padding: 12px 18px; line-height: 1.1; white-space: nowrap;
  }
  /* декоративное изображение в hero – НЕ absolute */
  .hero img, .hero__img{
    position: static !important; transform: none !important;
    margin: 12px auto 0; max-width: 44vw; height: auto;
  }

  /* 2) «Наші переваги» – карточки по центру */
  .adv-cards{
    display: grid !important; grid-template-columns: 1fr; gap: 16px; padding: 0 12px;
  }
  .adv-cards .adv-card{
    display: flex !important; flex-direction: column; align-items: center; text-align: center;
    padding: 16px;
  }
  .adv-cards .adv-card > img{
    margin: 0 auto 10px !important;
    position: static !important; transform: none !important; float: none !important;
    max-width: 180px; height: auto;
  }

  /* 3) «Асортимент категорій» – центр и одна колонка */
  .category-cards, .catalog-cards, .products-grid, .cards.catalog, .cards.categories{
    display: grid !important; grid-template-columns: 1fr !important; gap: 16px !important;
    padding: 0 12px;
  }
  .category-card, .catalog-card, .product-card, .cards.catalog .card, .cards.categories .card{
    margin-left: auto; margin-right: auto; text-align: center;
  }
  .category-card img, .catalog-card img, .product-card img{
    margin: auto; display: block; max-width: 180px; height: auto; object-fit: contain;
  }

  /* 4) Блок с коробками (чтоб НЕ было 2 в ряд и не расширял страницу) */
  .pack-cards, .package-cards, .boxes, .packing, .packaging-cards, .cards.packages{
    display: grid !important; grid-template-columns: 1fr !important; gap: 16px !important;
    padding: 0 12px;
  }
  .pack-cards .card, .package-cards .card, .boxes .card, .packing .card, .packaging-cards .card{
    margin-left: auto; margin-right: auto; text-align: center;
  }

  /* Заголовки разделов/хлебные крошки — аккуратные */
  .section-title, .page-title, h1.title { font-size: clamp(22px, 7vw, 32px); line-height: 1.15; text-align: center; }
  .breadcrumbs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
}

/* ===== Планшеты (769–1024px): 2 колонки вместо 3 ===== */
@media (min-width: 769px) and (max-width: 1024px){
  .adv-cards, .category-cards, .catalog-cards, .products-grid,
  .pack-cards, .package-cards, .boxes, .packaging-cards{
    display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 20px !important;
  }
}
/* ===== MOBILE ULTRA-FIX (<=768px). ПК НЕ МЕНЯЕМ ===== */
@media (max-width: 768px){

  /* Без горизонтальной прокрутки и расползаний */
  html, body { overflow-x: hidden !important; }
  img { max-width: 100% !important; height: auto !important; display: block !important; }

  /* ---------- 1) HERO: томат не лезет на заголовок ---------- */
  [class*="hero"]{
    padding: 10px 14px 20px !important;
    position: relative !important;
  }
  [class*="hero"] h1, [class*="hero"] .title{
    font-size: clamp(24px, 7vw, 32px) !important;
    line-height: 1.15 !important;
    margin: 0 0 10px !important;
    max-width: 26ch !important;
    white-space: normal !important;
  }
  [class*="hero"] p{
    font-size: clamp(14px, 3.8vw, 16px) !important;
    margin: 6px 0 14px !important;
    max-width: 35ch !important;
  }
  [class*="hero"] .btn{
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 320px !important;
    padding: 12px 18px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }
  /* любые декоративные картинки в hero — не absolute */
  [class*="hero"] img,
  [class*="hero"] [class*="img"],
  [class*="hero"] [class*="image"]{
    position: static !important;
    transform: none !important;
    float: none !important;
    margin: 12px auto 0 !important;
    max-width: 44vw !important;
    height: auto !important;
  }

  /* ---------- 2) «Наші переваги» ---------- */
  .adv-cards{
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 0 12px !important;
  }
  .adv-cards .adv-card{
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 16px !important;
  }
  .adv-cards .adv-card > img{
    margin: 0 auto 10px !important;
    position: static !important;
    transform: none !important;
    float: none !important;
    max-width: 180px !important;
    height: auto !important;
  }

  /* ---------- 3) Асортимент категорій — по ОДНОЙ и по центру ---------- */
  .category-cards, .catalog-cards, .products-grid, .cards.catalog, .cards.categories{
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 0 12px !important;
  }
  .category-card, .catalog-card, .product-card,
  .cards.catalog .card, .cards.categories .card{
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
  }
  .category-card img, .catalog-card img, .product-card img{
    margin: auto !important;
    display: block !important;
    max-width: 180px !important;
    height: auto !important;
    object-fit: contain !important;
  }

  /* ---------- 4) Карточки с коробками — обязательно одна под одной ---------- */
  .pack-cards, .package-cards, .boxes, .packing, .packaging-cards, .cards.packages{
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 0 12px !important;
  }
  .pack-cards .card, .package-cards .card, .boxes .card,
  .packing .card, .packaging-cards .card{
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
  }

  /* ---------- 5) Универсальная защита: любые "cards/grid" на мобилке — в 1 колонку ---------- */
  [class*="cards"], [class*="grid"], [class*="list"]:not(nav){
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* чтобы якорные заголовки не уходили под фикс-меню */
  :target, .section-title, .page-title, h1.title{ scroll-margin-top: 72px !important; }
}

/* ===== Планшеты (769–1024px): делаем 2 колонки там, где было 3 ===== */
@media (min-width: 769px) and (max-width: 1024px){
  .adv-cards, .category-cards, .catalog-cards, .products-grid,
  .pack-cards, .package-cards, .boxes, .packaging-cards{
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
  }
}

/* ===== Home Catalog CTA (mobile only, keep desktop untouched) ===== */
@media (max-width: 768px){
  .home-catalog-cta{ width: 100% !important; max-width: 360px !important; }
}
