/* 居屋大全屋苑卡片：沿用 estate.php 手機版版型 */
:root {
  --hos-estate-primary: #e2540a;
  --hos-estate-primary-dark: #c44708;
  --hos-estate-text: #222222;
  --hos-estate-text-soft: #888888;
  --hos-estate-border: #e8e8e8;
  --hos-estate-chip-border: #dfdfdf;
  --hos-estate-bg: #ffffff;
  --hos-estate-bg-muted: #f5f5f5;
  --hos-estate-badge: #fff3e8;
  --hos-estate-shadow: rgba(0, 0, 0, 0.08);
}

.hos-estate-list {
  width: 100%;
}

/* 頂部地區搜尋／chip 篩選 */
.hos-estate-loc-bar {
  margin: 0 0 0.75rem;
  padding: 0.5rem;
  background: var(--hos-estate-bg-muted);
  border: 1px solid var(--hos-estate-border);
  border-radius: 0.5rem;
  box-sizing: border-box;
}

.hos-estate-loc-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.375rem;
}

.hos-estate-loc-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 2.5rem;
  padding: 0.4rem 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: var(--hos-estate-text);
  background: var(--hos-estate-bg);
  border: 1px solid var(--hos-estate-chip-border);
  border-radius: 0.375rem;
  cursor: pointer;
  box-sizing: border-box;
}

.hos-estate-loc-chip.is-active,
.hos-estate-loc-chip:hover,
.hos-estate-loc-chip:focus {
  color: #ffffff;
  background: var(--hos-estate-primary);
  border-color: var(--hos-estate-primary);
  outline: none;
}

@media (min-width: 768px) {
  .hos-estate-loc-chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1025px) {
  .hos-estate-loc-chips {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.hos-estate-list .hos-estate-group-title {
  margin: 0 0 0.5rem;
  padding: 0.75rem 0.5rem 0.35rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--hos-estate-text);
}

.hos-estate-list .hos-estate-group + .hos-estate-group {
  margin-top: 0.75rem;
}

/* 手機／平板：兩欄；桌面：三欄 */
.hos-estate-list .estate-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 0.375rem;
  row-gap: 0.5rem;
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}

@media (min-width: 1025px) {
  .hos-estate-list .estate-card-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 0.5rem;
    row-gap: 0.625rem;
  }
}

.hos-estate-list .estate-card {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  background: var(--hos-estate-bg);
  border: 1px solid var(--hos-estate-border);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0.0625rem 0.25rem var(--hos-estate-shadow);
  box-sizing: border-box;
  position: relative;
}

.hos-estate-list .estate-card-img {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  background-color: var(--hos-estate-bg-muted);
  position: relative;
  z-index: 2;
}

.hos-estate-list .hos-estate-img-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

.hos-estate-list .estate-card-img img {
  width: 100%;
  height: 8.75rem;
  min-height: 8.75rem;
  object-fit: cover;
  display: block;
}

.hos-estate-list .estate-card-body {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 8px;
  box-sizing: border-box;
}

.hos-estate-list .estate-card-top {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 6px;
}

/* 字級對齊 estate.php 手機版卡片 */
.hos-estate-list .estate-card-title-wrap h3,
.hos-estate-list .estate-card-title-wrap h3 a {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--hos-estate-text);
  text-decoration: none;
  word-break: break-word;
}

.hos-estate-list .estate-card-address {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  color: #666666;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.hos-estate-list .estate-card-address-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-right: 0;
  vertical-align: middle;
}

.hos-estate-list .estate-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  justify-content: flex-start;
}

.hos-estate-list .estate-count-badge.estate-count-badge-stack {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 5px;
  border: 1px solid var(--hos-estate-primary);
  background: var(--hos-estate-bg);
  color: var(--hos-estate-primary);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}

.hos-estate-list .estate-count-badge-stack .estate-count-badge-label {
  font-size: 12px;
  line-height: 1.2;
  font-weight: bold;
}

.hos-estate-list .estate-count-badge-stack .estate-count-badge-num {
  display: inline;
  font-size: 15px;
  line-height: 1.2;
  font-weight: bold;
  margin-top: 0;
  padding-top: 0;
}

.hos-estate-list .estate-count-badge-stack.is-empty {
  opacity: 0.55;
  pointer-events: none;
}

.hos-estate-list .estate-card-divider {
  margin: 8px 0 6px;
  border: 0;
  border-top: 1px solid #eeeeee;
}

.hos-estate-list .estate-card-meta {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px 2px;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.hos-estate-list .estate-meta-item {
  flex: 1 1 calc(50% - 2px);
  min-width: 0;
  max-width: calc(50% - 2px);
  box-sizing: border-box;
  overflow: hidden;
}

.hos-estate-list .estate-meta-item p {
  margin: 0 0 1px;
  font-size: 11px;
  color: #888888;
  line-height: 1.2;
  word-break: break-all;
}

.hos-estate-list .estate-meta-item span {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #2a2a2a;
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.hos-estate-list .estate-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hos-estate-list .estate-card-badges a,
.hos-estate-list .estate-card-title-wrap a {
  position: relative;
  z-index: 2;
}

.hos-estate-list .empty-msg {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--hos-estate-text-soft);
  font-size: 1rem;
}

@media (min-width: 768px) {
  .hos-estate-list .estate-card-img img {
    height: 9.5rem;
    min-height: 9.5rem;
  }
}

@media (max-width: 767px) {
  .hos-estate-list .hos-estate-group-title {
    font-size: 1rem;
    padding-left: 0.25rem;
  }
}
