/* ════════════════════════════════
   category_detail.css
════════════════════════════════ */

.page-header {
  background: var(--dark);
  color: var(--text-light);
  padding: 2.5rem 2rem 2rem;
  margin-top: 72px;
}
.page-header h1 {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: .05em;
}
.page-header .subtitle {
  margin-top: .4rem;
  font-size: .875rem;
  color: rgba(255,255,255,.5);
}
.page-header .subtitle span {
  color: var(--primary);
  font-weight: 600;
}


/* ── 篩選器 (Filter Bar) - 樣式統一重構 ── */
.filter-bar {
  display: flex; /* 改用 flex 或調整 grid */
  flex-wrap: wrap;
  gap: 30px;
  background: var(--page-bg, var(--light-bg));
  padding: 20px 24px;
}

.filter-form{
  display: flex;
  flex-wrap: wrap;
  gap: 16px; 
  align-items: center; 
  justify-content: center;
  width: 100%;
}

/* 篩選群組：橫向排列標籤 */
.filter-group {
  display: flex;
  flex-direction: row; 
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
}

/* 標籤文字 (原本的 label) */
.filter-group label, 
.filter-group__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 6px;
  min-width: 36px;
  letter-spacing: .04em;
}

/* 標籤容器 */
.filter-group__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 6px 32px 6px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  background-color: #fff;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

/* 5. 確保在 IE/Edge 也能隱藏預設箭頭 */
.filter-select::-ms-expand {
  display: none;
}


.filter-select:focus {
  border-color: var(--primary);
}

/* ── 標籤 (Tag) 樣式 ── */
.tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid #ddd;
  font-size: 0.85rem;
  color: var(--text-dark);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.tag--active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--text-on-primary) !important;
}

/* ── 搜尋區域 (原本的 actions 改為搜尋框樣式) ── */
.filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-search__input {
  padding: 5px 12px;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  font-size: 0.85rem;
  outline: none;
  background: #fff;
  transition: border-color 0.2s;
}

.filter-search__input:focus {
  border-color: var(--primary);
}

.filter-search__btn {
  padding: 5px 16px;
  background: var(--dark);
  color: var(--text-on-dark);
  border: none;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.filter-search__btn:hover {
  background: var(--primary);
  color: var(--text-on-primary);
}

/* ── 數字區間樣式 (若仍有保留需求) ── */
.range-row {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.range-row input {
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 6px;
  padding: .3rem .5rem;
  font-size: .85rem;
  width: 80px;
}

/* 清除/重設按鈕樣式對齊 */
.btn-reset, .filter-search__clear {
  color: #999;
  font-size: 1rem;
  text-decoration: none;
  padding: 5px;
}
.btn-reset:hover {
  color: var(--primary);
}


/* ── 物件列表 ── */
.property-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 20px;
}
.property-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 8px;
  display: flex;
  overflow: hidden;
  transition: box-shadow .2s;
  text-decoration: none;
  color: inherit;
}
.property-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.1);
}
.card-image {
  width: 140px;
  min-height: 100px;
  flex-shrink: 0;
  position: relative;
}
.card-image img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .35s ease;
}
.property-card:hover .card-image img { transform: scale(1.04); }

/* ── 左上角租售標籤 ── */
.prop-card__badge {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #fff;
  z-index: 10;
  display: inline-block; /* 確保它是可視區塊 */
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.prop-card__price_list { 
  font-family: var(--font-body); 
  font-size: 16px; 
  font-weight: 600; 
}

.prop-card__price--original {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.85em;
    margin-right: 8px;
}

.prop-card__price--sale {
    color: #e74c3c;
    font-weight: 700;
}

/* 排隊法 (~) */
.prop-item ~ .prop-item {
    display: none;
}

/* 序號法 (nth) */
/* .prop-item:nth-of-type(n+2) {
    display: none;
}
.prop-item:nth-child(n+2) {
    display: none;
  } */

.card-body {
  padding: 5px 10px;
  display: flex; flex-direction: column;
  gap: 2px; flex: 1; min-width: 0;
}
.card-title {
  font-family: var(--font-head);
  font-size: 1.05rem; font-weight: 700;
  line-height: 1.35; color: var(--text-dark);
}
.card-area { font-size: .8rem; color: var(--text-muted); }

.card-meta {
  display: flex; flex-wrap: wrap;
  gap: .4rem .9rem;
  font-size: .8rem; color: var(--text-dark);
}
.card-meta span::before { content: attr(data-label) '：'; color: var(--text-muted); }

/* ── 無結果 ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
}

.empty-state p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.back-link-container{
  display: flex;
  padding: 20px 0 30px;
  font-size: 18px;
  color: var(--primary);
  justify-content: space-evenly;
}

/* ── 平板 1024px ── */
@media (max-width: 1024px) {
  .property-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  .card-image { width: 120px; }
  .card-body { padding: 0.8rem; gap: 0.3rem; }
  .card-title { font-size: 0.95rem; }
  .card-price { font-size: 1.05rem; }
}

/* ── 手機 768px：上圖下文 ── */
@media (max-width: 768px) {
  .filter-bar {
    padding: 20px 16px;
    grid-template-columns: repeat(2, 1fr);
    
  }

  .property-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    padding: 10px;
  }

  /* 上圖下文 */
  .property-card {
    flex-direction: column;
  }
  .card-image {
    width: 100%;
    height: 140px;
    min-height: unset;
  }
  .card-body {
    padding: 0.6rem 0.75rem;
    gap: 0.25rem;
  }
  .card-title {
    font-size: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .card-area  { font-size: 0.72rem; }
  .card-price { font-size: 0.95rem; margin-top: 0; }
  .card-meta  { font-size: 0.7rem; gap: 0.2rem 0.5rem; }
  .card-meta span:nth-child(n+3) { display: none; }
}


/* ── 小螢幕手機 (640px 以下) ── */
@media (max-width: 640px) {
  .property-list {
    grid-template-columns: repeat(1, 1fr);
  }

  .property-card {
    flex-direction: row;
    height: 100px;
    align-items: stretch;
  }

  .filter-form{
    justify-content: start;
  }

  .filter-bar {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .filter-actions {
    margin-left: 0;
  }

  .card-body{
    padding: 5px 15px;
    gap: 2px;
  }
  .card-image {
    width:45%;
    height: 100px;
    min-height: 100px;   
  }

  .card-title {
    font-size: 0.8rem;
  }

  
}
