/* ============================================================
   MODULE: Tour Trung Quốc — chỉ dùng biến từ tokens.css
   ============================================================ */

.tour-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.tour-filters select,
.tour-filters input {
  width: 100%;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  background: var(--color-surface);
  color: var(--color-text);
}
.tour-result-count {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-3);
}

/* --- Tabs: Danh sách Tour / Gợi ý theo mùa (tách riêng, không gộp 1 màn hình) --- */
.tour-tabs { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); border-bottom: 1px solid var(--color-border); }
.tour-tab {
  background: none; border: none; padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm); font-weight: 600; color: var(--color-text-muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tour-tab.is-active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tour-tab-panel { display: none; }
.tour-tab-panel.is-active { display: block; }

/* --- Chế độ xem: Danh sách / Lưới --- */
.view-toggle { display: inline-flex; border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; }
.view-btn {
  background: var(--color-surface); border: none; padding: 6px 12px;
  font-size: var(--font-size-sm); cursor: pointer; color: var(--color-text-muted);
}
.view-btn.is-active { background: var(--color-primary); color: var(--color-text-on-primary); }

.tour-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}
/* Chế độ Danh sách: mỗi tour 1 hàng GỌN, nhìn 1 lượt ra nhiều tour cùng lúc. */
.tour-grid--list { grid-template-columns: 1fr; gap: var(--space-1); }
.tour-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); text-decoration: none; color: inherit;
  font-size: var(--font-size-sm);
}
.tour-row:hover { border-color: var(--color-primary); background: var(--color-surface-alt); }
.tour-row--nolink { cursor: default; opacity: 0.85; }
.tour-row__days {
  flex-shrink: 0; width: 34px; text-align: center; font-weight: 700;
  color: var(--color-primary); font-family: var(--font-family-mono);
}
.tour-row__title {
  flex: 1 1 240px; min-width: 0; font-weight: 600; color: var(--color-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tour-row__tag {
  flex-shrink: 0; font-size: var(--text-caption); color: var(--color-text-muted);
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tour-row__dates { flex-shrink: 0; width: 130px; color: var(--color-text-muted); font-size: var(--text-caption); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tour-row__status { flex-shrink: 0; }
.tour-row__price { flex-shrink: 0; width: 100px; text-align: right; font-weight: 700; color: var(--color-primary); font-family: var(--font-family-mono); }
@media (max-width: 760px) {
  .tour-row__tag, .tour-row__dates { display: none; }
}
.tour-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tour-card__img {
  height: 90px;
  background: linear-gradient(135deg, var(--color-secondary), #6fa9b8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-on-primary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-align: center;
  padding: var(--space-2);
}
.tour-card__body { padding: var(--space-3); flex: 1; display: flex; flex-direction: column; }
.tour-card__tag {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--color-primary);
  background: rgba(192,57,43,0.08);
  padding: 2px var(--space-2);
  border-radius: 999px;
  margin-bottom: var(--space-2);
  width: fit-content;
}
.tour-card__title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin: 0 0 var(--space-1);
  line-height: 1.4;
}
.tour-card__meta {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}
.tour-card__dates {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: pre-line;
  margin-bottom: var(--space-2);
}
.tour-card__price { font-size: var(--font-size-lg); color: var(--color-primary); font-weight: 700; margin-top: auto; }
.tour-card__footer { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }

.tour-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px var(--space-2);
  border-radius: 999px;
}
.tour-status--open { background: rgba(76,140,74,0.12); color: var(--color-success); }
.tour-status--full { background: rgba(179,38,30,0.1); color: var(--color-error); }
.tour-status--note { background: rgba(201,138,46,0.12); color: var(--color-warning); }

.tour-load-more {
  display: block;
  margin: var(--space-4) auto 0;
}

/* --- Gợi ý du lịch --- */
.tour-suggest-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.tour-suggest-card {
  display: block;
  background: linear-gradient(135deg, var(--color-surface), var(--color-surface-alt));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  color: var(--color-text);
}
.tour-suggest-card:hover { text-decoration: none; box-shadow: var(--shadow-card); }
.tour-suggest-card__badge { font-size: 0.7rem; color: var(--color-primary); font-weight: 600; margin-bottom: var(--space-1); }
.tour-suggest-card__title { font-size: var(--font-size-sm); font-weight: 600; margin-bottom: var(--space-1); }
.tour-suggest-card__price { font-size: var(--font-size-sm); color: var(--color-text-muted); }

/* --- Bảng lọc nhanh (số ngày / ngân sách / loại hình) --- */
.quick-filter-panel {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.qf-label { font-size: var(--font-size-sm); font-weight: 600; margin-bottom: var(--space-2); }
.qf-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-3); }
.chip-btn {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 999px;
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-sm);
  cursor: pointer;
  margin: 0 var(--space-1) var(--space-1) 0;
}
.chip-btn.is-active { background: var(--color-secondary); border-color: var(--color-secondary); color: var(--color-text-on-primary); }
.range-inputs { display: flex; align-items: center; gap: var(--space-2); }
.range-inputs input {
  width: 100%; padding: var(--space-2);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}
.tag-toggle {
  display: inline-block;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-sm);
  cursor: pointer;
  margin: 0 var(--space-1) var(--space-1) 0;
}
.tag-toggle.is-active { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-text-on-primary); }

.tour-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-2);
}
.tour-result-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

/* --- Xem lịch trình chi tiết: LINK MỞ TRỰC TIẾP (không còn mở rộng 2 bước) --- */
.tour-card__highlights {
  margin: 0 0 var(--space-2);
  padding-left: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}
.tour-detail-link {
  font-size: var(--font-size-sm);
  white-space: nowrap;
}
.tour-detail-link--muted {
  color: var(--color-text-faint);
  font-style: italic;
  font-size: var(--font-size-sm);
}

/* --- Gợi ý du lịch theo tháng / theo mùa --- */
.guide-month-strip {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}
@media (max-width: 860px) { .guide-month-strip { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 500px) { .guide-month-strip { grid-template-columns: repeat(4, 1fr); } }
.guide-month-cell {
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-1);
  cursor: pointer;
  background: var(--color-surface);
}
.guide-month-cell:hover { border-color: var(--color-secondary); }
.guide-month-cell.is-active { background: var(--color-secondary); border-color: var(--color-secondary); }
.guide-month-cell.is-active .guide-month-cell__m,
.guide-month-cell.is-active .guide-month-cell__lbl { color: var(--color-text-on-primary); }
.guide-month-cell__m { font-size: 0.65rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; }
.guide-month-cell__icon { font-size: 1.25rem; margin: 2px 0; }
.guide-month-cell__lbl { font-size: 0.6rem; color: var(--color-text-muted); line-height: 1.2; }

.guide-month-detail {
  display: none;
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
}

.guide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.guide-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.guide-card__head {
  padding: var(--space-3);
  color: #fff;
}
.guide-card__icon { font-size: 1.5rem; }
.guide-card__title { font-weight: 700; font-size: var(--font-size-lg); }
.guide-card__time { font-size: var(--font-size-sm); opacity: 0.9; }
.guide-card__body { padding: var(--space-3); }
.guide-card__body p { color: var(--color-text-muted); font-size: var(--font-size-sm); }
.guide-spots { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.guide-spot-chip {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 999px;
  padding: var(--space-1) var(--space-2);
  font-size: 0.75rem;
  cursor: pointer;
}
.guide-spot-chip:hover { background: var(--color-surface-alt); }
