section.services-home > .main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
}

/* Шапка (и поиск) */
section.services-home .services-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

section.services-home .section-title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  color: #132134;
  text-transform: none; /* Убираем старый uppercase */
  text-align: left;
  line-height: 1.25;
}

/* Поиск справа от заголовка */
section.services-home .services-tabs-search {
  flex: 0 0 430px;
  max-width: 430px;
  padding: 0;
}

section.services-home .services-tabs-search #searchform {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

section.services-home .services-tabs-search #searchform label {
  position: relative;
  margin: 0;
  flex-grow: 1;
}

/* Иконка лупы в поле поиска */
section.services-home .services-tabs-search #searchform label > span.icon-search {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

section.services-home .services-tabs-search #searchform label > span.icon-search::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.25 14.25C11.5637 14.25 14.25 11.5637 14.25 8.25C14.25 4.93629 11.5637 2.25 8.25 2.25C4.93629 2.25 2.25 4.93629 2.25 8.25C2.25 11.5637 4.93629 14.25 8.25 14.25Z' stroke='%2364748B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M15.75 15.75L12.4875 12.4875' stroke='%2364748B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Инпут поиска */
section.services-home .services-tabs-search #searchform input[type="text"],
section.services-home .services-tabs-search #searchform input[type="search"] {
  height: 46px;
  width: 100%;
  padding: 10px 16px 10px 44px;
  font-size: 14px;
  color: #132134;
  background-color: #f4f6f9;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

section.services-home .services-tabs-search #searchform input[type="text"]:focus,
section.services-home .services-tabs-search #searchform input[type="search"]:focus {
  outline: none;
  background-color: #ffffff;
  border-color: #2563eb;
}

/* Синяя кнопка "Искать" */
section.services-home .services-tabs-search #searchform input[type="submit"] {
  height: 46px;
  padding: 0 24px;
  max-width: none;
  width: auto;
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
  background-color: #2563eb;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

section.services-home .services-tabs-search #searchform input[type="submit"]:hover {
  background-color: #1d4ed8;
}

/* === СЕТКА КАРТОЧЕК УСЛУГ (3 КОЛОНКИ) === */
section.services-home .services-tabs-content {
  display: none;
  padding: 0;
}

section.services-home .services-tabs-content.active {
  display: block;
}

section.services-home .services-menu {
  width: 100%;
}

section.services-home .services-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Карточка услуги */
section.services-home .services-list > li {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 22px 48px 22px 24px;
  background-color: #ffffff;
  border: 1px solid #e5e9f0;
  border-radius: 12px;
  box-shadow: 0px 16px 23.2px 0px #00000008;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

section.services-home .services-list > li:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(19, 33, 52, 0.05);
}

/* Заголовок-ссылка внутри карточки */
section.services-home .services-list > li > a {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: #132134;
  line-height: 1.35;
  text-decoration: none;
}

section.services-home .services-list > li > a:hover {
  color: #2563eb;
}

/* === ИКОНКИ УСЛУГ СЛЕВА === */
section.services-home .services-list > li > a::before {
  content: "";
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* Дефолтная иконка документа */
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='4' y='3' width='16' height='18' rx='2' stroke='%233B82F6' stroke-width='1.5'/%3E%3Cpath d='M8 8H16M8 12H16M12 16L10 18L12 20L14 18L12 16Z' stroke='%233B82F6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

section.services-home .services-list > li:nth-child(1) > a::before {
  background-image: url("../../img/declaration-icon.svg");
}

section.services-home .services-list > li:nth-child(2) > a::before {
  background-image: url("../../img/flame-icon.svg");
}

section.services-home .services-list > li:nth-child(3) > a::before {
  background-image: url("../../img/medicine-icon.svg");
}

section.services-home .services-list > li:nth-child(4) > a::before {
  background-image: url("../../img/technic-icon.svg");
}

section.services-home .services-list > li:nth-child(5) > a::before {
  background-image: url("../../img/award-icon.svg");
}

section.services-home .services-list > li:nth-child(6) > a::before {
  background-image: url("../../img/clipboard-check-icon.svg");
}

section.services-home .services-list > li:nth-child(7) > a::before {
  background-image: url("../../img/email-icon.svg");
}

section.services-home .services-list > li:nth-child(8) > a::before {
  background-image: url("../../img/leaf-icon.svg");
}

section.services-home .services-list > li:nth-child(9) > a::before {
  background-image: url("../../img/documents-icon.svg");
}

/* === СТРЕЛКА СПРАВА В КАРТОЧКЕ === */
/* Переопределяем старый .first-arrow, который генерируется в теме, или рисуем псевдоэлементом */
section.services-home .services-list > li > .first-arrow {
  position: absolute;
  left: auto;
  right: 22px;
  top: 26px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

/* Галочки */
section.services-home .services-list .sub-menu > li:before {
    top: 0px;
}

section.services-home .services-list > li > .first-arrow::before {
  content: "";
  display: block;
  width: 8px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='14' viewBox='0 0 8 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 13L7 7L1 1' stroke='%233B82F6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

section.services-home .services-list > li > .first-arrow-rotate {
  transform: rotate(90deg);
}

/* === ВЫПАДАЮЩИЙ СПИСОК ПОДМЕНЮ ВНУТРИ КАРТОЧКИ === */
section.services-home .services-list > li .sub-menu {
  display: none;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5e9f0;
  list-style: none;
}

section.services-home .services-list > li .sub-menu.sub-menu-opened {
  display: block;
}

section.services-home .services-list .sub-menu > li {
  position: relative;
  padding-left: 20px;
  margin: 8px 0;
}

section.services-home .services-list .sub-menu > li.menu-item-hidden {
  display: none;
}

section.services-home .services-list .sub-menu > li > a {
  font-size: 14px;
  color: #475569;
  margin: 0;
  transition: color 0.15s ease;
}

section.services-home .services-list .sub-menu > li > a:hover {
  color: #2563eb;
}

section.services-home .services-list .sub-menu > li.btn-more {
  padding: 0;
  margin: 12px 0 0;
  text-align: center;
}

/* === АДАПТИВ === */
@media screen and (max-width: 1320px) {
  section.services-home > .main-container {
    padding: 0 20px;
  }
}

@media screen and (max-width: 1024px) {
  section.services-home .services-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  section.services-home .services-tabs-search {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }
  section.services-home .services-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  section.services-home {
    padding: 32px 0 40px;
  }
  section.services-home .section-title {
    font-size: 28px;
  }
  section.services-home .services-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Уменьшаем внутренние отступы карточек на мобилках */
  section.services-home .services-list > li {
    padding: 16px 44px 16px 16px; /* 44px справа для стрелочки */
  }
  
  /* Стрелочка на мобилках прижимается к правому краю */
  section.services-home .services-list > li > .first-arrow {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
  }
  section.services-home .services-list > li > .first-arrow-rotate {
    transform: translateY(-50%) rotate(90deg);
  }
  
  /* Настройка переноса длинного текста (Сертификация и декларирование) */
  section.services-home .services-list > li > a {
    align-items: flex-start; /* Прижимаем иконку и текст к верхнему краю */
  }
  /* Немного опускаем иконку, чтобы она визуально была по центру первой строки текста */
  section.services-home .services-list > li > a::before {
    margin-top: -2px; 
  }
}

@media screen and (max-width: 576px) {
  section.services-home > .main-container {
    padding: 0 16px;
  }
  section.services-home .section-title {
    font-size: 26px;
  }
  /* Оставляем инпут и кнопку поиска на одной строке */
  section.services-home .services-tabs-search #searchform {
    flex-direction: row; 
    gap: 8px;
  }
  section.services-home .services-tabs-search #searchform label > span.icon-search {
    left: 12px;
  }
  section.services-home .services-tabs-search #searchform input[type="text"],
  section.services-home .services-tabs-search #searchform input[type="search"] {
    padding-left: 38px;
  }
  section.services-home .services-tabs-search #searchform input[type="submit"] {
    padding: 0 16px;
    margin-top: 0;
  }
}