/* Страница Услуги — scoped, не ломает .service-card на главной */
/* Надёжное скрытие заголовка материала Joomla на странице услуг */
.item-page .page-header:has(+ * .uslugi-page),
.item-page:has(.uslugi-page) > .page-header,
.com-content-article:has(.uslugi-page) > .page-header {
  display: none !important;
}

.uslugi-page {
  color: var(--felix-black);
}

.uslugi-page .font-bebas {
  font-family: var(--felix-font-heading);
}

.uslugi-page__heading,
.uslugi-page h1.font-bebas,
.uslugi-page > section:first-child h1 {
  font-family: var(--felix-font-heading);
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--felix-black);
  margin: 0;
}

@media (min-width: 640px) {
  .uslugi-page > section:first-child h1 {
    font-size: 2.25rem;
  }
}

@media (min-width: 1024px) {
  .uslugi-page > section:first-child h1 {
    font-size: 42px;
  }
}

.uslugi-page > section:first-child {
  padding-top: 0.5rem;
}

@media (min-width: 640px) {
  .uslugi-page > section:first-child {
    padding-top: 1rem;
  }
}

.uslugi-grid,
.uslugi-page .grid.grid-cols-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .uslugi-page .grid.grid-cols-1 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .uslugi-page .grid.grid-cols-1.lg\:grid-cols-services,
  .uslugi-page .lg\:grid-cols-services,
  .uslugi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row dense;
    /* half-row: 185*2 + 19 = 388 (Figma full card); 185*4 + 19*3 = 795 (tall) */
    grid-auto-rows: 185px;
    gap: 19px 24px;
    overflow: visible;
    /* room for photos popping below the plate */
    padding-bottom: 2.5rem;
  }
}

.uslugi-card {
  position: relative;
  display: flex;
  min-height: 13rem;
  overflow: hidden;
  border-radius: var(--felix-radius-card);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
}

/* Десктоп: цветная плашка (::before), фото может чуть выезжать за неё */
@media (min-width: 1024px) {
  .uslugi-card {
    min-height: 0;
    overflow: visible;
    border-radius: 0;
    background-color: transparent !important;
    /* default = full Figma card (2 half-rows) */
    grid-row: span 2;
  }

  .uslugi-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: var(--felix-radius-card);
    pointer-events: none;
  }

  .uslugi-card.bg-felix-green::before {
    background-color: var(--felix-green);
  }

  .uslugi-card.bg-felix-brown::before {
    background-color: var(--felix-brown);
  }

  .uslugi-card.bg-felix-yellow::before {
    background-color: var(--felix-yellow);
  }

  .uslugi-card.bg-felix-peach::before {
    background-color: var(--felix-peach);
  }

  .uslugi-card.lg\:col-span-2 {
    grid-column: span 2 / span 2;
  }

  .uslugi-card.lg\:row-span-2 {
    grid-row: span 2 / span 2;
  }

  .uslugi-card:not(.uslugi-card--half) {
    z-index: 1;
  }

  .uslugi-card.uslugi-card--half {
    z-index: 0;
  }

  /* tall: oncology / trauma — above neighbors so ears can overlap the plate */
  .uslugi-card.lg\:row-span-4 {
    grid-row: span 4 / span 4;
    z-index: 3;
  }

  /* half-height text cards */
  .uslugi-card.uslugi-card--half {
    grid-row: span 1;
    padding: 1.25rem 1.5rem;
    align-items: center;
  }

  /* Figma: green half-cards have arrow on the right */
  .uslugi-card.uslugi-card--half.bg-felix-green .uslugi-arrow {
    left: auto;
    right: 24px;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
  }
}

.uslugi-title {
  position: relative;
  z-index: 10;
  font-family: var(--felix-font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
}

@media (min-width: 640px) {
  .uslugi-title {
    font-size: 1.5rem;
  }
}

.uslugi-title.uslugi-title--dark,
.uslugi-title--dark {
  color: var(--felix-black) !important;
}

.uslugi-photo {
  pointer-events: none;
  position: absolute;
  z-index: 1;
  bottom: 0;
  right: 0;
  height: 82%;
  width: auto;
  max-width: 85%;
  object-fit: contain;
  object-position: bottom right;
  filter: drop-shadow(0 12px 10px rgb(0 0 0 / 0.06));
}

@media (min-width: 1024px) {
  /*
   * Figma: animals slightly pop out past the colored plate (ears/paws).
   * Plate is ::before; card overflow:visible. Mild scale only for still-padded PNGs.
   * .uslugi-photo--tight = homepage crops (therapy…diagnostics).
   */
  .uslugi-photo {
    right: -10%;
    bottom: -12%;
    height: 95%;
    max-width: 105%;
    transform-origin: bottom right;
    transform: scale(1.15);
  }

  .uslugi-photo.lg\:max-w-\[55\%\],
  .uslugi-photo.lg\:max-w-\[60\%\] {
    max-width: 62%;
    right: -4%;
    bottom: -6%;
  }

  .uslugi-photo.lg\:h-\[95\%\] {
    height: 92%;
  }

  .uslugi-photo.uslugi-photo--tight {
    right: -10%;
    bottom: -10%;
    height: 96%;
    max-width: 95%;
    transform: none;
  }

  .uslugi-photo.uslugi-photo--tight.lg\:max-w-\[55\%\] {
    max-width: 72%;
    right: -2%;
    bottom: -8%;
    height: 86%;
  }

  .uslugi-photo.uslugi-photo--tight.lg\:max-w-\[60\%\] {
    max-width: 68%;
    right: 0;
    bottom: -10%;
    height: 82%;
  }

  /* Tall cards — ears/tail stick past the plate (like homepage oncology) */
  .uslugi-card.lg\:row-span-4 .uslugi-photo {
    left: 50%;
    right: auto;
    bottom: -2%;
    height: 68%;
    max-width: none;
    width: auto;
    max-height: 78%;
    transform: translateX(-50%) scale(1.08);
    transform-origin: bottom center;
    object-position: bottom center;
  }

  .uslugi-card.lg\:row-span-4 .uslugi-photo.uslugi-photo--tight {
    bottom: -2%;
    height: 70%;
    /* Figma photo ~908px on 416px plate ≈ 2.2× — ears must clear the plate */
    max-width: 200%;
    max-height: none;
    transform: translateX(-50%);
  }

  /* —— Per-service fine-tune (desktop): paws on next-row top, ear clearance —— */

  /* Терапия: выше + левее (упор в хирургию справа) */
  .uslugi-card[href*="terapiya"] .uslugi-photo {
    bottom: 2%;
    right: 14%;
    height: 90%;
    max-width: 78%;
  }

  /* Хирургия: чуть выше — лапы на верхний край ряда ниже */
  .uslugi-card[href*="khirurgiya"] .uslugi-photo {
    bottom: -3%;
    right: 2%;
    height: 80%;
    max-width: 70%;
  }

  /* Стационар: чуть выше, лапы к карточке ниже */
  .uslugi-card[href*="statsionar"] .uslugi-photo {
    bottom: 0;
    right: -4%;
    height: 88%;
    max-width: 92%;
  }

  /* Стоматология: выше + левее, чтобы ухо не срезалось */
  .uslugi-card[href*="stomatologiya"] .uslugi-photo {
    bottom: 0;
    right: 10%;
    height: 88%;
    max-width: 88%;
  }

  /* Диагностика: ниже — хвост под хвостом кота (онкология) */
  .uslugi-card[href*="diagnostika"] .uslugi-photo {
    bottom: -16%;
    right: 4%;
    height: 78%;
    max-width: 62%;
    z-index: 0;
  }

  /* Дерматология / Офтальмология / Кардиология — лапы на верхний край ряда ниже */
  .uslugi-card[href*="dermatologiya"] .uslugi-photo,
  .uslugi-card[href*="oftalmologiya"] .uslugi-photo,
  .uslugi-card[href*="kardiologiya"] .uslugi-photo {
    bottom: -8%;
    right: -4%;
    height: 92%;
    max-width: 100%;
    transform: scale(1.12);
    transform-origin: bottom right;
  }

  .uslugi-card[href*="kardiologiya"] .uslugi-photo {
    right: 4%; /* ухо не в край */
  }

  /* Неврология / Гастро — чуть выше, едва касаются карточек ниже */
  .uslugi-card[href*="nevrologiya"] .uslugi-photo,
  .uslugi-card[href*="gastroenterologiya"] .uslugi-photo {
    bottom: -4%;
    right: -6%;
    height: 90%;
    max-width: 100%;
    transform: scale(1.12);
    transform-origin: bottom right;
  }
}

.uslugi-arrow {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 10;
  display: flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--felix-peach);
  color: var(--felix-black);
  line-height: 1;
  transition: background-color 0.15s ease;
}

@media (min-width: 640px) {
  .uslugi-arrow {
    bottom: 32px;
    left: 32px;
    width: 53px;
    height: 53px;
  }
}

.uslugi-arrow svg {
  display: block;
  flex-shrink: 0;
}

.uslugi-card:hover .uslugi-arrow {
  background-color: var(--felix-peach-hover, #e0b08e);
}

.uslugi-arrow.uslugi-arrow--dark,
.uslugi-arrow--dark {
  background-color: #eec09e !important;
}

.uslugi-card:hover .uslugi-arrow.uslugi-arrow--dark,
.uslugi-card:hover .uslugi-arrow--dark {
  background-color: var(--felix-peach-hover, #e0b08e) !important;
}

.uslugi-page .bg-felix-green { background-color: var(--felix-green); }
.uslugi-page .bg-felix-brown { background-color: var(--felix-brown); }
.uslugi-page .bg-felix-yellow { background-color: var(--felix-yellow); }
.uslugi-page .bg-felix-peach { background-color: var(--felix-peach); }

.uslugi-page .rounded-card {
  border-radius: var(--felix-radius-card);
}

.uslugi-page .text-white { color: #fff; }
.uslugi-page .text-white\/90 { color: rgb(255 255 255 / 0.9); }








.uslugi-page .mt-1 { margin-top: 0.25rem; }
.uslugi-page .mt-8 { margin-top: 2rem; }
.uslugi-page .pt-10 { padding-top: 2.5rem; }
.uslugi-page .py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.uslugi-page .pb-10 { padding-bottom: 2.5rem; }
/* убираем лишний горизонтальный padding только у внешних секций сетки */
.uslugi-page > section.pt-10,
.uslugi-page > section.py-10 {
  padding-left: 0;
  padding-right: 0;
}
.uslugi-page .sm\:px-10 { }
.uslugi-page .sm\:py-12 { }

@media (min-width: 640px) {
  .uslugi-page .sm\:pt-14 { padding-top: 3.5rem; }
  .uslugi-page .sm\:py-14 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .uslugi-page .sm\:pb-14 { padding-bottom: 3.5rem; }
  .uslugi-page .sm\:px-10 { padding-left: 2.5rem; padding-right: 2.5rem; }
  .uslugi-page .sm\:py-12 { padding-top: 3rem; padding-bottom: 3rem; }
  .uslugi-page .sm\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
}

.uslugi-page .text-2xl { font-size: 1.5rem; line-height: 2rem; }
.uslugi-page .text-xs { font-size: 0.75rem; line-height: 1rem; }
.uslugi-page .font-semibold { font-weight: 600; }
.uslugi-page .font-bold { font-weight: 700; }
.uslugi-page .font-medium { font-weight: 500; }
.uslugi-page .uppercase { text-transform: uppercase; }
.uslugi-page .tracking-wide { letter-spacing: 0.025em; }
.uslugi-page .relative { position: relative; }
.uslugi-page .z-10 { z-index: 10; }

/* full-bleed map breakout from felix-container */
.uslugi-page > section.h-\[420px\],
.uslugi-page .uslugi-map {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  height: 420px;
  padding: 0 !important;
}

@media (min-width: 640px) {
  .uslugi-page > section.h-\[420px\],
  .uslugi-page .uslugi-map {
    height: 480px;
  }
}

.uslugi-page > section.h-\[420px\] iframe,
.uslugi-page .uslugi-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* карта вплотную к футеру — без padding у main */
.is-inner main.felix-container:has(.uslugi-page) {
  padding-bottom: 0;
}

/* form: use homepage .felix-form styles v2 */
