/**
 * Index «Хозяева питомцев» (.another-pet / profiles-swiper).
 *
 * Carousel via Swiper: PC ≥1024 → 3, tablet → 2, phone → 1.
 * Equal heights: stretch + column flex on slides (card flex grows height).
 * Pre-init widths only — after init Swiper owns slide width/margins.
 *
 * Scope: body.page-index only. Do not edit custom.css / mobile-card-fixes.
 */

body.page-index .cotinder-lazy-profiles-swiper,
body.page-index .cotinder-lazy-profiles-swiper .another-pet {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.page-index .cotinder-lazy-profiles-swiper .another-pet__swiper,
body.page-index .tabs__content[data-target="comunity"] .another-pet .another-pet__swiper,
body.page-index .tabs__content[data-target="nko"] .another-pet .another-pet__swiper {
  overflow: hidden !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.page-index .cotinder-lazy-profiles-swiper .another-pet__swiper .swiper-wrapper,
body.page-index .tabs__content[data-target="comunity"] .another-pet .another-pet__swiper .swiper-wrapper,
body.page-index .tabs__content[data-target="nko"] .another-pet .another-pet__swiper .swiper-wrapper {
  display: flex !important;
  flex-wrap: nowrap !important;
  flex-direction: row !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
}

/*
 * Column direction is critical: card { flex:1 } must grow HEIGHT.
 * With default row, flex:1 expands WIDTH → one full-bleed card.
 */
body.page-index .cotinder-lazy-profiles-swiper .another-pet__swiper .swiper-slide,
body.page-index .tabs__content[data-target="comunity"] .another-pet .another-pet__swiper .swiper-slide,
body.page-index .tabs__content[data-target="nko"] .another-pet .another-pet__swiper .swiper-slide {
  height: auto !important;
  align-self: stretch !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
}

body.page-index .cotinder-lazy-profiles-swiper .another-pet .user-slide,
body.page-index .cotinder-lazy-profiles-swiper .another-pet .card.user-slide,
body.page-index .tabs__content[data-target="comunity"] .another-pet .user-slide,
body.page-index .tabs__content[data-target="comunity"] .another-pet .card.user-slide,
body.page-index .tabs__content[data-target="nko"] .another-pet .user-slide,
body.page-index .tabs__content[data-target="nko"] .another-pet .card.user-slide {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  align-self: stretch !important;
  box-sizing: border-box !important;
}

body.page-index .cotinder-lazy-profiles-swiper .another-pet .user-slide > .card-desc,
body.page-index .tabs__content[data-target="comunity"] .another-pet .user-slide > .card-desc,
body.page-index .tabs__content[data-target="nko"] .another-pet .user-slide > .card-desc {
  margin-top: auto !important;
}

/* Pre-init fallback widths (Swiper overwrites after init) */
body.page-index .cotinder-lazy-profiles-swiper .another-pet__swiper:not(.swiper-initialized) .swiper-wrapper,
body.page-index .tabs__content[data-target="comunity"] .another-pet .another-pet__swiper:not(.swiper-initialized) .swiper-wrapper,
body.page-index .tabs__content[data-target="nko"] .another-pet .another-pet__swiper:not(.swiper-initialized) .swiper-wrapper {
  transform: none !important;
  width: 100% !important;
}

@media (min-width: 1024px) {
  body.page-index .cotinder-lazy-profiles-swiper .another-pet__swiper:not(.swiper-initialized) .swiper-slide,
  body.page-index .tabs__content[data-target="comunity"] .another-pet .another-pet__swiper:not(.swiper-initialized) .swiper-slide,
  body.page-index .tabs__content[data-target="nko"] .another-pet .another-pet__swiper:not(.swiper-initialized) .swiper-slide {
    width: calc((100% - 40px) / 3) !important;
    max-width: calc((100% - 40px) / 3) !important;
    flex: 0 0 calc((100% - 40px) / 3) !important;
    margin-right: 20px !important;
  }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
  body.page-index .cotinder-lazy-profiles-swiper .another-pet__swiper:not(.swiper-initialized) .swiper-slide,
  body.page-index .tabs__content[data-target="comunity"] .another-pet .another-pet__swiper:not(.swiper-initialized) .swiper-slide,
  body.page-index .tabs__content[data-target="nko"] .another-pet .another-pet__swiper:not(.swiper-initialized) .swiper-slide {
    width: calc((100% - 20px) / 2) !important;
    max-width: calc((100% - 20px) / 2) !important;
    flex: 0 0 calc((100% - 20px) / 2) !important;
    margin-right: 20px !important;
  }
}

@media (max-width: 767.98px) {
  body.page-index .cotinder-lazy-profiles-swiper .another-pet__swiper:not(.swiper-initialized) .swiper-slide,
  body.page-index .tabs__content[data-target="comunity"] .another-pet .another-pet__swiper:not(.swiper-initialized) .swiper-slide,
  body.page-index .tabs__content[data-target="nko"] .another-pet .another-pet__swiper:not(.swiper-initialized) .swiper-slide {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    margin-right: 0 !important;
  }
}

body.page-index .cotinder-lazy-profiles-swiper .another-pet > .swiper-button-prev,
body.page-index .cotinder-lazy-profiles-swiper .another-pet > .swiper-button-next,
body.page-index .tabs__content[data-target="comunity"] .another-pet > .swiper-button-prev,
body.page-index .tabs__content[data-target="comunity"] .another-pet > .swiper-button-next,
body.page-index .tabs__content[data-target="nko"] .another-pet > .swiper-button-prev,
body.page-index .tabs__content[data-target="nko"] .another-pet > .swiper-button-next {
  display: flex !important;
  z-index: 2;
}
