/* Динамический каталог домов, загружаемый из Spring Boot API. */
.catalog-api-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

.catalog-api-state__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.catalog-api-state__text {
  margin: 0;
  max-width: 620px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.catalog-api-state__retry {
  padding: 0.8rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 1rem;
  background: linear-gradient(135deg, #e53935 0%, #d32f2f 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.catalog-api-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: catalog-api-spin 0.8s linear infinite;
}

@keyframes catalog-api-spin {
  to { transform: rotate(360deg); }
}

.catalog-card-action {
  width: 100%;
  margin-top: 1rem;
  padding: 1rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.catalog-card-action:hover {
  background: rgba(229, 57, 53, 0.8);
}

.catalog-carousel-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease;
}

.catalog-carousel-button:hover {
  background: rgba(255, 255, 255, 0.95);
}

.catalog-carousel-button--prev { left: 0.5rem; }
.catalog-carousel-button--next { right: 0.5rem; }

/*
 * Фиксированная область изображения карточки каталога.
 * Максимальный размер на широком экране: 472 x 335 px.
 * Высокая/широкая фотография вписывается целиком без обрезки.
 * Свободные области внутри рамки имеют чёрный фон.
 *
 * Ключевой момент: .catalog-carousel и img расположены absolute,
 * поэтому исходная высота файла (например 701 px) больше не может
 * растянуть рамку карточки.
 */
.catalog-img-wrap {
  position: relative !important;
  width: min(472px, 100%) !important;
  height: auto !important;
  aspect-ratio: 472 / 335 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 472px !important;
  max-height: 335px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  overflow: hidden !important;
  background: #000 !important;
  border-radius: 1.5rem 1.5rem 0 0 !important;
  flex: 0 0 auto !important;
}

.catalog-img-wrap .catalog-carousel {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  background: #000 !important;
}

.catalog-img-wrap .catalog-img {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #000 !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

.catalog-img-wrap .catalog-img.hidden {
  display: none !important;
}
