/**
 * Largura da listagem /accommodation/ proporcional à viewport.
 * Carregado depois de /assets/css/alojamentos_publico.css
 */
body.alojamentos-publico {
  --ap-content-pad-x: clamp(0.75rem, 2.8vw, 2.25rem);
  --ap-content-max: min(1920px, calc(100vw - 2 * var(--ap-content-pad-x)));
}

body.alojamentos-publico .ap-search-band {
  padding-left: var(--ap-content-pad-x);
  padding-right: var(--ap-content-pad-x);
}

body.alojamentos-publico .ap-search-inner {
  max-width: var(--ap-content-max);
  width: 100%;
}

body.alojamentos-publico .ap-breadcrumb {
  max-width: var(--ap-content-max);
  width: 100%;
  padding-left: var(--ap-content-pad-x);
  padding-right: var(--ap-content-pad-x);
}

body.alojamentos-publico .ap-layout {
  max-width: var(--ap-content-max);
  width: 100%;
  padding-left: var(--ap-content-pad-x);
  padding-right: var(--ap-content-pad-x);
  grid-template-columns: minmax(220px, 18vw) minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.75rem);
}

body.alojamentos-publico .ap-disclaimer {
  max-width: var(--ap-content-max);
  width: 100%;
  padding-left: var(--ap-content-pad-x);
  padding-right: var(--ap-content-pad-x);
}

@media (max-width: 900px) {
  body.alojamentos-publico .ap-layout {
    grid-template-columns: 1fr;
  }
}

/* ——— Proporção fixa das imagens na galeria dos cartões (lista /accommodation/) ———
   Sobrescreve /assets/css/alojamentos_publico.css: área principal 3:2, recorte uniforme. */
body.alojamentos-publico .ap-card-gallery-wrap {
  display: flex;
  flex-direction: column;
}

body.alojamentos-publico .ap-card-gallery {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: auto;
}

body.alojamentos-publico .ap-gallery-stage {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 3 / 2;
  min-height: 0;
}

body.alojamentos-publico .ap-gallery-main-link {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

body.alojamentos-publico .ap-gallery-main-img {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  object-fit: cover;
  object-position: center;
}

body.alojamentos-publico .ap-gallery-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
}

body.alojamentos-publico .ap-gallery-thumbs {
  flex-shrink: 0;
  flex-grow: 0;
  margin-top: auto;
}

body.alojamentos-publico .ap-gallery-thumb {
  width: 56px;
  aspect-ratio: 3 / 2;
  height: auto;
  min-height: 0;
}

body.alojamentos-publico .ap-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 960px) {
  body.alojamentos-publico .ap-gallery-stage {
    aspect-ratio: 3 / 2;
    min-height: 0;
  }

  body.alojamentos-publico .ap-gallery-main-img,
  body.alojamentos-publico .ap-gallery-placeholder {
    min-height: 0;
    max-height: none;
  }
}

/* —— Listagem index_new.php: overlay de loading ao pesquisar —— */
body.ap-list-new-ui .ap-disclaimer-new {
  display: block;
  margin-top: 0.5rem;
}

.ap-new-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.ap-new-loading-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.ap-new-loading-overlay[hidden] {
  display: none !important;
}

.ap-new-loading-card {
  text-align: center;
  padding: 1.75rem 2rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  max-width: 22rem;
}

.ap-new-loading-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 1rem;
  border: 3px solid #e8e8e8;
  border-top-color: #e61e4d;
  border-radius: 50%;
  animation: ap-new-spin 0.75s linear infinite;
}

@keyframes ap-new-spin {
  to {
    transform: rotate(360deg);
  }
}

.ap-new-loading-msg {
  margin: 0;
  font-size: 1rem;
  color: #222;
  font-weight: 500;
}
