/* PROEXPERT — мобильная оптимизация (реальный CSS, не зависит от Tailwind в патчах) */
@media (max-width: 767px) {
  html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 4.5rem;
  }

  body {
    overflow-x: clip;
  }

  #root {
    min-width: 0;
    overflow-x: clip;
  }

  .container {
    width: 100%;
    max-width: 100%;
  }

  .slick-slider,
  .slick-list {
    overflow: hidden;
    max-width: 100%;
  }

  .slick-slide > div {
    height: 100%;
  }

  main img:not([width]),
  main video {
    max-width: 100%;
    height: auto;
  }

  footer ul a,
  footer nav a {
    min-height: 44px;
  }

  .slick-prev {
    left: 0.25rem;
  }

  .slick-next {
    right: 0.25rem;
  }
}

@media (max-width: 389px) {
  header .container {
    padding-left: 0.625rem;
    padding-right: 0.625rem;
  }
}

/* ——— Главная (.pe-home) ——— */
@media (max-width: 767px) {
  /* Hero */
  .pe-home > section:first-of-type > .container {
    padding-top: 1.25rem !important;
    padding-bottom: 1rem !important;
  }

  .pe-home > section:first-of-type h1 {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.75rem !important;
  }

  .pe-home > section:first-of-type .grid.max-w-md,
  .pe-home > section:first-of-type .flex.max-w-xl {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.375rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .pe-home > section:first-of-type .grid.max-w-md > div,
  .pe-home > section:first-of-type .flex.max-w-xl > div {
    width: 100% !important;
    flex: none !important;
  }

  /* Блок «Основные направления» — 3 карточки */
  .pe-home .grid.grid-cols-1 {
    gap: 0.5rem !important;
  }

  .pe-home .grid.grid-cols-1 > .group {
    transform: none !important;
  }

  .pe-home .grid.grid-cols-1 > .group .relative.z-10 {
    padding: 0.5rem 0.625rem !important;
  }

  .pe-home .grid.grid-cols-1 > .group .relative.z-10 > .shrink-0 > div.inline-flex {
    margin-bottom: 0.25rem !important;
    padding: 0.125rem 0.5rem !important;
  }

  .pe-home .grid.grid-cols-1 > .group h2 {
    font-size: 1.05rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.125rem !important;
  }

  .pe-home .grid.grid-cols-1 > .group .relative.z-10 > .shrink-0 > p {
    font-size: 0.75rem !important;
    line-height: 1.25 !important;
    margin-bottom: 0.125rem !important;
  }

  /* Список марок (авто) и буллеты (запчасти) */
  .pe-home .grid.grid-cols-1 > .group:first-child .shrink-0 > p.text-gray-500,
  .pe-home .grid.grid-cols-1 > .group:first-child .shrink-0 > p[class*="line-clamp"],
  .pe-home .grid.grid-cols-1 > .group:nth-child(2) .shrink-0 > div.flex {
    display: none !important;
  }

  /* Фото в карточке — ~50% высоты */
  .pe-home .grid.grid-cols-1 > .group .relative.z-10 > div.relative.w-full {
    height: 3.25rem !important;
    min-height: 0 !important;
    max-height: 3.25rem !important;
    flex: none !important;
    margin-top: 0.375rem !important;
    aspect-ratio: auto !important;
  }

  .pe-home .grid.grid-cols-1 > .group .relative.z-10 > div.relative.w-full img {
    object-fit: cover !important;
  }

  /* Блок кнопки под фото */
  .pe-home .grid.grid-cols-1 > .group .relative.z-10 > div:last-child {
    margin-top: 0.375rem !important;
  }

  .pe-home .grid.grid-cols-1 > .group a[class*="min-h-"] {
    min-height: 2.25rem !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
  }

  .pe-home .grid.grid-cols-1 > .group a[class*="min-h-"] svg {
    width: 1rem !important;
    height: 1rem !important;
  }

  /* Обёртка «Основные направления» */
  .pe-home div[class*="max-md:rounded-2xl"][class*="max-md:border"] {
    padding: 0.5rem !important;
    margin-bottom: 1rem !important;
  }

  .pe-home .slick-dots li button:before {
    font-size: 9px;
  }

  .pe-home .slick-dots {
    bottom: -0.25rem;
  }

  .pe-home .slick-prev,
  .pe-home .slick-next {
    width: 2.25rem;
    height: 2.25rem;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .pe-home .animate-\[shimmer_3s_ease-in-out_infinite\] {
    animation: none;
  }
}
