/**
 * Lista pública de alojamentos — CSS centralizado (site raiz /assets/css/)
 * Depende de: site-viewport-base.css + checkinall-public-shell.css (tokens :root)
 */
:root {
  --bk-card: var(--bg-card, #fff);
  --bk-border: var(--border, #ebebeb);
  --bk-text: var(--text, #222);
  --bk-muted: var(--text-muted, #717171);
  --ap-radius: 12px;
  --ap-shadow: var(--shadow, 0 2px 12px rgba(0, 0, 0, 0.08));
}

* {
  box-sizing: border-box;
}

body.alojamentos-publico {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg, #f7f7f7);
  color: var(--bk-text);
  line-height: 1.45;
  font-size: 14px;
}

/* Voltar à lista (ficha) */
.ci-listing-back {
  padding: 0.65rem 0 0;
  font-size: 0.9rem;
}

.ci-listing-back a {
  color: var(--accent, #e61e4d);
  font-weight: 600;
  text-decoration: none;
}

.ci-listing-back a:hover {
  text-decoration: underline;
}

.ap-search-band {
  background: linear-gradient(180deg, rgba(230, 30, 77, 0.06) 0%, transparent 85%);
  padding: 1rem 1rem 1.35rem;
}

.ap-search-inner {
  max-width: 1140px;
  margin: 0 auto;
}

.ap-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #ebebeb);
  padding: 0.5rem;
  border-radius: var(--radius-full, 9999px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.6);
}

@media (max-width: 768px) {
  .ap-search-form {
    border-radius: 12px;
    flex-direction: column;
  }
}

.ap-field {
  flex: 1 1 140px;
  min-width: 0;
  background: transparent;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0 0.25rem;
}

.ap-field:focus-within {
  border-color: rgba(230, 30, 77, 0.35);
  background: rgba(230, 30, 77, 0.03);
}

.ap-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.35rem 0.5rem 0;
  color: var(--text, #222);
}

.ap-field input,
.ap-field select {
  width: 100%;
  border: 0;
  padding: 0.15rem 0.5rem 0.5rem;
  font-size: 0.95rem;
  background: transparent;
  outline: none;
  color: var(--text, #222);
}

.ap-btn-search {
  flex: 0 0 auto;
  align-self: stretch;
  min-width: 110px;
  background: var(--accent, #e61e4d);
  color: #fff;
  border: 0;
  border-radius: var(--radius-full, 9999px);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0 1.35rem;
  font-family: inherit;
  transition: background 0.2s;
}

.ap-btn-search:hover {
  background: var(--accent-hover, #c4184a);
}

.ap-breadcrumb {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: var(--bk-muted);
}

.ap-breadcrumb a {
  color: var(--accent, #e61e4d);
  text-decoration: none;
  font-weight: 500;
}

.ap-breadcrumb a:hover {
  text-decoration: underline;
}

.ap-layout {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1rem 2.5rem;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
  align-items: start;
}

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

.ap-sidebar {
  background: var(--bk-card);
  border: 1px solid var(--bk-border);
  border-radius: var(--ap-radius);
  padding: 1rem;
  box-shadow: var(--ap-shadow);
}

@media (max-width: 900px) {
  .ap-sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
  }
}

.ap-sidebar h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.ap-filter-block {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--bk-border);
}

.ap-filter-block:last-child {
  border-bottom: 0;
}

.ap-filter-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.ap-filter-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ap-filter-row input[type="number"],
.ap-filter-row input[type="text"] {
  width: 100%;
  max-width: 100px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--bk-border);
  border-radius: 4px;
}

.ap-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.ap-check input {
  accent-color: var(--accent, #e61e4d);
}

.ap-note {
  font-size: 0.78rem;
  color: var(--bk-muted);
  margin-top: 0.5rem;
}

.ap-main-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ap-results-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
}

.ap-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ap-sort select {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--bk-border);
  border-radius: 4px;
  font-size: 0.9rem;
  background: #fff;
}

.ap-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Cartão estilo Booking: galeria | conteúdo | avaliação+preço */
.ap-card--bk {
  display: grid;
  grid-template-columns: minmax(200px, 28%) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  background: var(--bk-card);
  border: 1px solid #c5d9f0;
  border-radius: var(--ap-radius);
  overflow: hidden;
  box-shadow: var(--ap-shadow);
  transition: box-shadow 0.15s ease;
}

.ap-card--bk:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.ap-card-gallery-wrap {
  background: #e8eef5;
  min-height: 100%;
}

.ap-card-gallery {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 200px;
}

.ap-gallery-stage {
  position: relative;
  flex: 1;
  min-height: 160px;
  background: linear-gradient(145deg, #dfe8f2, #cfd9e6);
}

.ap-gallery-main-link {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 160px;
  text-decoration: none;
  color: inherit;
}

.ap-gallery-main-img {
  width: 100%;
  height: 100%;
  min-height: 160px;
  max-height: 220px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.ap-gallery-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 160px;
  max-height: 220px;
  font-size: 2.25rem;
  color: var(--bk-muted);
}

.ap-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 56px;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.88);
  color: #222;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
  z-index: 3;
  transition: background 0.15s;
}

.ap-gallery-nav:hover {
  background: #fff;
}

.ap-gallery-prev {
  left: 6px;
}

.ap-gallery-next {
  right: 6px;
}

.ap-fav--gallery {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
}

.ap-gallery-cap-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

.ap-cap-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.ap-cap-ic {
  font-size: 0.85rem;
  opacity: 0.95;
}

.ap-gallery-thumbs {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  overflow-x: auto;
}

.ap-gallery-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 40px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #ddd;
  opacity: 0.82;
  transition: opacity 0.15s, border-color 0.15s;
}

.ap-gallery-thumb:hover {
  opacity: 1;
}

.ap-gallery-thumb.is-active {
  opacity: 1;
  border-color: #006ce4;
}

.ap-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ap-card-core {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(148px, 22%);
  gap: 0 1rem;
  padding: 0.65rem 0.85rem 0.75rem 1rem;
  align-items: start;
}

.ap-card-main {
  min-width: 0;
  padding-right: 0.25rem;
}

.ap-card-aside {
  border-left: 1px solid var(--bk-border);
  padding-left: 1rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.ap-aside-divider {
  height: 1px;
  background: var(--bk-border);
  margin: 0.15rem 0;
}

.ap-aside-book {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  margin-top: auto;
}

.ap-price--aside {
  text-align: left;
}

.ap-price--aside .amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bk-text);
}

.ap-price--aside .currency-eur {
  font-weight: 700;
  margin-right: 2px;
}

.ap-btn-see--aside {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  font-size: 0.88rem;
}

.ap-card-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
}

.ap-card-title--bk {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.25;
}

.ap-title-stars--inline {
  margin: 0;
}

.ap-type-line--bk {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
}

.ap-deal-hint {
  margin: 0.15rem 0 0;
  line-height: 1;
}

.ap-deal-ic {
  font-size: 0.95rem;
  filter: grayscale(0.2);
}

.ap-loc-line--bk {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

.ap-facility-list--bk {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.15rem;
  margin-top: 0.4rem;
  font-size: 0.76rem;
}

.ap-facility-list--bk li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ap-facility-list--bk li::before {
  content: "";
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

.ap-facility-list--bk li:nth-child(1)::before {
  content: "🏖";
  font-size: 0.85rem;
}

.ap-facility-list--bk li:nth-child(2)::before {
  content: "🏅";
  font-size: 0.8rem;
}

.ap-facility-list--bk li:nth-child(3)::before {
  content: "🏊";
  font-size: 0.85rem;
}

.ap-facility-list--bk li:not(:last-child)::after {
  content: none;
}

.ap-badge-row--bk {
  margin-top: 0.45rem;
}

.ap-room-block--bk {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
}

.ap-room-block--bk .ap-room-title {
  font-size: 0.88rem;
}

.ap-room-block--bk .ap-room-specs,
.ap-room-block--bk .ap-bed-line {
  font-size: 0.76rem;
  margin-top: 0.12rem;
}

.ap-amenities-compact {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--bk-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ap-desc--bk {
  margin: 0.35rem 0 0;
  font-size: 0.76rem;
  -webkit-line-clamp: 1;
}

.ap-rating-cluster--aside {
  max-width: none;
  width: 100%;
}

.ap-score--aside {
  border-radius: 6px;
  min-width: 2.6rem;
  text-align: center;
}

.ap-card--hotel .ap-card-title--bk a {
  color: #1a1a1a;
}

.ap-card:not(.ap-card--hotel) .ap-card-title--bk a {
  color: var(--accent, #e61e4d);
}

.ap-card:not(.ap-card--hotel) .ap-score--aside {
  background: var(--accent, #e61e4d);
}

.ap-card:not(.ap-card--hotel) .ap-comfort-line {
  color: var(--accent, #e61e4d);
}

.ap-fav {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

@media (max-width: 960px) {
  .ap-card--bk {
    grid-template-columns: 1fr;
  }

  .ap-gallery-stage {
    min-height: 200px;
  }

  .ap-gallery-main-img,
  .ap-gallery-placeholder {
    min-height: 200px;
    max-height: 280px;
  }

  .ap-card-core {
    grid-template-columns: 1fr;
    padding: 0.65rem 0.85rem 0.85rem;
  }

  .ap-card-aside {
    border-left: 0;
    border-top: 1px solid var(--bk-border);
    padding-left: 0;
    padding-top: 0.65rem;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .ap-rating-cluster--aside {
    flex: 1 1 auto;
    min-width: 140px;
  }

  .ap-aside-book {
    flex: 1 1 200px;
    align-items: flex-end;
    text-align: right;
  }

  .ap-price--aside {
    text-align: right;
  }

  .ap-btn-see--aside {
    max-width: 280px;
  }
}

.ap-card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ap-card-title:not(.ap-card-title--bk) {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent, #e61e4d);
}

.ap-card-title:not(.ap-card-title--bk) a {
  color: inherit;
  text-decoration: none;
}

.ap-card-title:not(.ap-card-title--bk) a:hover {
  text-decoration: underline;
}

.ap-card-title.ap-card-title--bk a {
  text-decoration: none;
}

.ap-card-title.ap-card-title--bk a:hover {
  text-decoration: underline;
}

.ap-score {
  background: var(--accent, #e61e4d);
  color: #fff;
  padding: 0.35rem 0.5rem;
  border-radius: 6px 6px 6px 0;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.ap-score small {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.9;
}

.ap-meta {
  font-size: 0.85rem;
  color: var(--bk-muted);
}

.ap-desc {
  font-size: 0.88rem;
  color: #444;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ap-card-footer {
  margin-top: auto;
  padding-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.ap-price {
  text-align: right;
}

.ap-price .nights {
  font-size: 0.78rem;
  color: var(--bk-muted);
}

.ap-price .amount {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bk-text);
}

.ap-price .currency {
  font-size: 0.85rem;
  font-weight: 600;
}

.ap-btn-see {
  background: var(--accent, #e61e4d);
  color: #fff;
  text-decoration: none;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
}

.ap-btn-see:hover {
  background: var(--accent-hover, #c4184a);
}

.ap-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bk-card);
  border-radius: var(--ap-radius);
  border: 1px dashed var(--bk-border);
  color: var(--bk-muted);
}

.ap-pagination {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.ap-pagination a,
.ap-pagination span {
  min-width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid var(--bk-border);
  background: #fff;
  color: var(--accent, #e61e4d);
}

.ap-pagination a:hover {
  background: #f0f4fa;
}

.ap-pagination .current {
  background: var(--accent, #e61e4d);
  color: #fff;
  border-color: var(--accent, #e61e4d);
  font-weight: 600;
}

.ap-disclaimer {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1rem 1.5rem;
  font-size: 0.78rem;
  color: var(--bk-muted);
}

.ap-toggle-filters {
  display: none;
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.6rem;
  background: var(--bk-card);
  border: 1px solid var(--bk-border);
  border-radius: var(--ap-radius);
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 900px) {
  .ap-toggle-filters {
    display: block;
  }

  .ap-sidebar.collapsed {
    display: none;
  }
}

/* ——— Detalhe do cartão (BD + mock #…#) ——— */
.ap-mock {
  color: var(--bk-muted);
  font-style: italic;
}

.ap-perk--real {
  color: #008234;
  font-style: normal;
}

.ap-card-title-block {
  min-width: 0;
  flex: 1 1 auto;
}

.ap-title-stars {
  margin-top: 0.25rem;
}

.ap-stars {
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: #ffb700;
}

.ap-star--empty {
  opacity: 0.35;
}

.ap-stars-fallback {
  font-size: 0.8rem;
}

.ap-type-line {
  margin: 0;
  font-size: 0.8rem;
  color: var(--bk-muted);
  text-transform: lowercase;
}

.ap-loc-line {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  color: var(--bk-text);
}

.ap-loc-dist {
  color: var(--bk-muted);
}

.ap-facility-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.82rem;
  color: var(--bk-muted);
}

.ap-facility-list li {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.ap-facility-list li:not(:last-child)::after {
  content: "·";
  margin: 0 0.45rem;
  color: #ccc;
  font-weight: 300;
}

.ap-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.ap-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
}

.ap-badge--promo {
  background: #008234;
  color: #fff;
}

.ap-badge--outline {
  background: var(--bk-card);
  color: var(--bk-text);
  border: 1px solid var(--bk-border);
}

.ap-room-block {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--bk-border);
}

.ap-room-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--bk-text);
}

.ap-room-specs,
.ap-bed-line {
  margin: 0.25rem 0 0;
  font-size: 0.84rem;
  color: #444;
}

.ap-breakfast-line {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
}

.ap-amenities-line {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--bk-muted);
}

.ap-amenities-label {
  font-weight: 600;
  color: var(--bk-text);
}

.ap-meta-cap {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.ap-rating-cluster {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.65rem;
  align-items: start;
  flex-shrink: 0;
  max-width: 11rem;
}

.ap-rating-words {
  grid-column: 1;
  grid-row: 1;
}

.ap-rating-label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--bk-text);
}

.ap-rating-count {
  display: block;
  font-size: 0.72rem;
  color: var(--bk-muted);
}

.ap-score--hotel {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  border-radius: 6px 6px 6px 6px;
  min-width: 2.75rem;
  text-align: center;
  padding: 0.4rem 0.45rem;
}

.ap-comfort-line {
  grid-column: 1;
  grid-row: 2;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent, #e61e4d);
}

/* Cartão estilo hotel (accent azul) */
.ap-card--hotel {
  background: linear-gradient(180deg, #f4f8fd 0%, var(--bk-card) 45%);
  border-color: #c5d9f0;
}

.ap-card--hotel .ap-card-title:not(.ap-card-title--bk) {
  color: #006ce4;
}

.ap-card--hotel .ap-comfort-line {
  color: #006ce4;
}

.ap-card--hotel .ap-score,
.ap-card--hotel .ap-score--hotel,
.ap-card--hotel .ap-score--aside {
  background: #003580;
}

.ap-btn-see--hotel {
  background: #006ce4;
}

.ap-btn-see--hotel:hover {
  background: #004494;
}

@media (max-width: 700px) {
  .ap-rating-cluster {
    max-width: none;
    width: 100%;
    margin-top: 0.35rem;
  }
}
