/* ==========================================================================
   SERVICES CONTAINER & GRID LAYOUT
   ========================================================================== */

.adev-services-container {
  width: 100%;
  box-sizing: border-box;
}

/* Сетка для макета Карточки (когда слайдер отключен) */
.adev-services-container.layout-cards:not(.swiper) {
  display: grid;
  gap: 30px;
}

/* Десктопные колонки (от 1 до 6) */
.adev-services-container.adev-grid-desktop-1 {
  grid-template-columns: repeat(1, 1fr);
}
.adev-services-container.adev-grid-desktop-2 {
  grid-template-columns: repeat(2, 1fr);
}
.adev-services-container.adev-grid-desktop-3 {
  grid-template-columns: repeat(3, 1fr);
}
.adev-services-container.adev-grid-desktop-4 {
  grid-template-columns: repeat(4, 1fr);
}
.adev-services-container.adev-grid-desktop-5 {
  grid-template-columns: repeat(5, 1fr);
}
.adev-services-container.adev-grid-desktop-6 {
  grid-template-columns: repeat(6, 1fr);
}

/* ==========================================================================
   СТИЛИ ГРУППИРОВКИ ПО КАТЕГОРИЯМ (АККОРДЕОН)
   ========================================================================== */
.adev-services-category-group {
  margin-bottom: 50px;
}
.adev-services-category-group:last-child {
  margin-bottom: 0;
}
.adev-services-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}
.adev-services-category-title {
  font-size: 28px;
  font-weight: 700;
  color: #111111;
  margin: 0;
  line-height: 1.2;
}

/* Режим Аккордеона для группы */
.adev-services-category-group.has-accordion .adev-services-category-head {
  cursor: pointer;
  padding: 15px 0;
  margin-bottom: 0;
}
.adev-services-accordion-icon {
  font-size: 22px;
  color: #111;
  transition: transform 0.3s ease;
}
.adev-services-category-group.has-accordion.active .adev-services-accordion-icon {
  transform: rotate(180deg);
}
.adev-services-category-group.has-accordion .adev-services-category-body {
  padding-top: 25px;
}

/* ==========================================================================
   CARD STRUCTURE & ANIMATION VARS
   ========================================================================== */

.adev-service {
  --adev-transition-duration: 0.3s;
  --adev-transition-timing: ease;

  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: transparent;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  box-sizing: border-box;
  position: relative;
  height: 100%; /* Для одинаковой высоты карточек */
  transition: all var(--adev-transition-duration) var(--adev-transition-timing);
}

/* Ссылка на всю карточку */
.adev-service__full-link {
  position: absolute;
  inset: 0;
  z-index: 5; /* Ниже кнопки и ссылок категорий, но поверх фото */
}

/* Слой затенения карточки (Overlay) */
.adev-service__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none; /* Не блокирует клики */
  background-color: var(--adev-card-overlay-bg, transparent);
  transition: background-color var(--adev-transition-duration) var(--adev-transition-timing);
  border-radius: inherit; /* Наследует скругление карточки */
}
.adev-service:hover .adev-service__overlay {
  background-color: var(--adev-card-overlay-bg-hover, var(--adev-card-overlay-bg, transparent));
}

/* Анимации работают только для карточек */
.layout-cards .adev-service.has-anim-lift:hover,
.layout-wide .adev-service.has-anim-lift:hover {
  transform: translateY(var(--adev-hover-lift, -8px));
}
.layout-cards .adev-service.has-anim-scale_up:hover,
.layout-wide .adev-service.has-anim-scale_up:hover {
  transform: scale(var(--adev-hover-scale, 1.03));
}
.layout-cards .adev-service.has-anim-scale_down:hover,
.layout-wide .adev-service.has-anim-scale_down:hover {
  transform: scale(var(--adev-hover-scale, 0.97));
}

/* ==========================================================================
   IMAGE & HOVER EFFECTS
   ========================================================================== */

.adev-service__image-wrapper {
  position: relative;
  overflow: hidden;
  width: var(--adev-img-width, 100%);
}

.adev-service__image {
  display: block;
  overflow: hidden;
  width: 100%;
}

.adev-service__image img {
  width: 100%;
  height: var(--adev-img-height, 280px);
  object-fit: cover;
  display: block;
  transition: transform var(--adev-transition-duration) var(--adev-transition-timing);
}

.adev-service.has-zoom:hover .adev-service__image img {
  transform: scale(var(--adev-hover-img-zoom, 1.08));
}

/* ==========================================================================
   ТЕКСТ ПОВЕРХ КАРТИНКИ (CONTENT OVER IMAGE)
   ========================================================================== */
.adev-service.has-content-overlay {
  justify-content: flex-end;
}
.adev-service.has-content-overlay .adev-service__image-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  border-radius: 0;
}
.adev-service.has-content-overlay .adev-service__image img {
  height: 100%;
}
.adev-service.has-content-overlay .adev-service__content {
  position: relative;
  z-index: 2;
  background: transparent;
}

/* ==========================================================================
   CONTENT INNER ELEMENTS
   ========================================================================== */

.adev-service__content {
  display: flex;
  flex-direction: column;
  padding: 24px;
  flex-grow: 1; /* Прижимает кнопку к низу */
  position: relative;
  z-index: 2; /* Контент СТРОГО поверх overlay */
}

.adev-service__title {
  margin: 0 0 8px 0;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  position: relative;
  z-index: 10;
}

.adev-service__title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--adev-transition-duration) var(--adev-transition-timing);
  position: relative;
  z-index: 10;
}

.adev-service__cat {
  font-size: 13px;
  color: #888888;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.adev-service__cat a {
  color: inherit;
  text-decoration: none;
  position: relative;
  z-index: 10; /* Кликабельно поверх .adev-service__full-link */
}

.adev-service__description {
  color: #666666;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.adev-service__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 10px 15px;
  border-radius: 8px;
  background: #111111;
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--adev-transition-duration) var(--adev-transition-timing);
  margin-top: auto;
  position: relative;
  z-index: 10; /* Кликабельно поверх .adev-service__full-link */
}

/* ==========================================================================
   МАКЕТ 2: ШИРОКИЕ КАРТОЧКИ (LAYOUT WIDE)
   ========================================================================== */

.layout-wide:not(.swiper) {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.layout-wide:not(.swiper) .adev-service {
  flex-direction: row;
}
.layout-wide:not(.swiper) .adev-service__image-wrapper {
  width: var(--adev-img-width, 340px);
  flex-shrink: 0;
}
.layout-wide:not(.swiper) .adev-service__image img {
  height: 100%;
  min-height: var(--adev-img-height, 250px);
}

/* ==========================================================================
   МАКЕТ 3: ПРОСТОЙ СПИСОК (LAYOUT LIST) - Чистый текст
   ========================================================================== */

.layout-list:not(.swiper) {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.layout-list .adev-service {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  border: none;
  border-bottom: 1px solid #e5e5e5;
  border-radius: 0;
  padding: 18px 0;
  background: transparent;
  box-shadow: none !important;
  transform: none !important;
  height: auto;
}
.layout-list .adev-service:last-child {
  border-bottom: none;
}
.layout-list .adev-service__content {
  padding: 0;
  flex-direction: row;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  gap: 20px;
}
.layout-list .adev-service__title {
  margin: 0;
  font-size: 18px;
}
.layout-list .adev-service__cat {
  margin-bottom: 0;
  margin-top: 5px;
}
.layout-list .adev-service__button {
  margin-top: 0;
  padding: 10px 20px;
}

/* ==========================================================================
   КНОПКА "ВСЕ УСЛУГИ"
   ========================================================================== */
.adev-services-all-btn-wrapper {
  margin-top: 40px;
  text-align: center;
}
.adev-services-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 30px;
  background-color: #111111;
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.3s ease;
}

/* ==========================================================================
   SWIPER SLIDER MECHANICS
   ========================================================================== */

.adev-services-swiper.swiper {
  position: relative;
  overflow: hidden;
  padding-bottom: 20px;
  padding-top: 20px;
  margin-top: -20px;
}

/* Обеспечиваем одинаковую высоту слайдов */
.adev-services-swiper .swiper-wrapper {
  align-items: stretch;
}
.adev-services-swiper .swiper-slide {
  height: auto;
}

.adev-services-swiper .swiper-button-prev,
.adev-services-swiper .swiper-button-next {
  color: #111111;
  width: 44px;
  height: 44px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: 0.3s;
}

.adev-services-swiper .swiper-button-prev::after,
.adev-services-swiper .swiper-button-next::after {
  font-size: 18px;
}

.adev-services-swiper .swiper-pagination {
  position: relative;
  bottom: 0;
  margin-top: 25px;
}

.adev-services-swiper .swiper-pagination-bullet-active {
  background: #111111;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (TABLET & MOBILE)
   ========================================================================== */

@media (max-width: 1024px) {
  .adev-services-container.layout-cards:not(.swiper) {
    grid-template-columns: repeat(1, 1fr) !important;
  }
  .adev-services-container.adev-grid-tablet-1 {
    grid-template-columns: repeat(1, 1fr) !important;
  }
  .adev-services-container.adev-grid-tablet-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .adev-services-container.adev-grid-tablet-3 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .adev-services-container.adev-grid-tablet-4 {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  .adev-services-container.adev-grid-tablet-5 {
    grid-template-columns: repeat(5, 1fr) !important;
  }
  .adev-services-container.adev-grid-tablet-6 {
    grid-template-columns: repeat(6, 1fr) !important;
  }

  .layout-wide:not(.swiper) .adev-service {
    flex-direction: row;
  }
  .layout-wide:not(.swiper) .adev-service__image-wrapper {
    width: 260px;
  }
}

@media (max-width: 767px) {
  .adev-services-container.layout-cards:not(.swiper) {
    grid-template-columns: 1fr !important;
  }
  .adev-services-container.adev-grid-mobile-1 {
    grid-template-columns: repeat(1, 1fr) !important;
  }
  .adev-services-container.adev-grid-mobile-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .adev-services-container.adev-grid-mobile-3 {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* Адаптив для широких карточек */
  .layout-wide:not(.swiper) .adev-service {
    flex-direction: column;
  }
  .layout-wide:not(.swiper) .adev-service__image-wrapper {
    width: 100%;
  }
  .layout-wide .adev-service__image img {
    height: 220px;
  }

  /* Адаптив для простого списка */
  .layout-list .adev-service__content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .layout-list .adev-service__button {
    margin-top: 5px;
  }

  .adev-services-swiper .swiper-button-prev,
  .adev-services-swiper .swiper-button-next {
    display: none;
  }
}

/* ==========================================================================
   ДОБАВЛЕНО: СТИЛИ ДЛЯ БОКОВОГО ФИЛЬТРА (САЙДБАР)
   ========================================================================== */

.adev-catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

.adev-catalog-sidebar {
  width: 100%;
  box-sizing: border-box;
}

.adev-filter-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 40px;
  border: 1px solid #f0f0f0;
  border-radius: 16px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  box-sizing: border-box;
  background: #ffffff;
}

.adev-filter-widget {
  margin-bottom: 30px;
}

.adev-filter-widget:last-child {
  margin-bottom: 0;
}

.adev-filter-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 15px 0 !important;
  line-height: 1.2;
}

/* Поиск */
.adev-search-wrapper {
  position: relative;
  width: 100%;
}

.adev-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #999;
  pointer-events: none;
}

.adev-live-search {
  width: 100% !important;
  padding: 12px 12px 12px 38px !important;
  border: 1px solid #e5e5e5 !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  outline: none !important;
  background: #ffffff !important;
  color: #333333 !important;
  transition: all 0.3s ease;
  box-sizing: border-box;
  height: auto !important;
}

.adev-live-search:focus {
  border-color: #fc5f9e;
  box-shadow: 0 0 0 1px #fc5f9e;
}

/* Опции Категорий (Радиокнопки) */
.adev-filter-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.adev-radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 15px;
  color: #555555;
  transition: color 0.2s ease;
  margin: 0 !important;
  padding: 0 !important;
}

.adev-radio-label:hover {
  color: #fc5f9e;
}

.adev-radio-label input[type="radio"] {
  display: none !important;
}

.adev-radio-btn {
  width: 18px;
  height: 18px;
  border: 2px solid #dddddd;
  border-radius: 50%;
  margin-right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-sizing: border-box;
  position: relative;
}

.adev-radio-label input:checked + .adev-radio-btn::after {
  content: '';
  width: 10px;
  height: 10px;
  background: #fc5f9e;
  border-radius: 50%;
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.adev-radio-label input:checked + .adev-radio-btn {
  border-color: #fc5f9e;
}

.adev-radio-label input:checked ~ .adev-radio-text {
  color: #111;
  font-weight: 600;
}

.adev-radio-text small {
  color: #999999;
  font-weight: normal;
  margin-left: 4px;
}

/* Заглушка результатов */
.adev-no-results-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: #fdfdfd;
  border: 1px dashed #e5e5e5;
  border-radius: 12px;
  text-align: center;
  color: #666666;
  width: 100%;
  box-sizing: border-box;
}

.adev-no-results-msg p {
  margin: 0 0 15px 0 !important;
  font-size: 16px;
}

.adev-reset-filter {
  background: #fc5f9e;
  color: #ffffff !important;
  border: none !important;
  padding: 10px 24px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-weight: 600 !important;
  transition: filter 0.2s ease !important;
  font-size: 14px !important;
}

.adev-reset-filter:hover {
  filter: brightness(1.1);
}

/* Адаптивность под планшеты и мобилки */
@media (max-width: 992px) {
  .adev-catalog-layout {
    grid-template-columns: 1fr !important;
    gap: 30px;
  }
  .adev-filter-sticky {
    position: static !important;
    padding: 20px;
  }
}
