/* Phase 1 elevation — Tag display + filter chip rail + refine modal
 *
 * Layered on top of the existing /hotels listing filter rail (kept intact
 * per "don't rebuild what's working"). Adds:
 *
 *   • bt-active-filters — chip rail above results showing currently
 *     applied filters with × dismiss buttons (Site UI Elevation §5
 *     "Filter Selection / chip-based")
 *   • bt-filter-bar — primary entry-point pills (Where / When / Who /
 *     Style / Refine) for surfaces that prefer the bar pattern over the
 *     persistent rail
 *   • bt-refine-modal — full-screen on mobile, side panel on desktop,
 *     comprehensive filter interface with chip selection (Site UI
 *     Elevation §5 "Refine Modal")
 *   • Tag display refinements applied to existing .amenity-tags on
 *     hotel cards so they pick up the new bt-tag visual language
 *     without touching the card-render JS
 */

/* ────────────────────────────────────────────────────────────────────────
 * Active filter chip rail
 * ──────────────────────────────────────────────────────────────────────── */

.bt-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) 0;
  margin: 0;
  list-style: none;
}

.bt-active-filters:empty {
  display: none;
}

.bt-active-filters__label {
  font-family: var(--font-ui-sans);
  font-weight: var(--weight-medium);
  font-size: var(--size-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-mid);
  margin-right: var(--space-sm);
}

.bt-active-filters__clear {
  margin-left: auto;
  background: none;
  border: none;
  font-family: var(--font-ui-sans);
  font-size: var(--size-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--gold);
  cursor: pointer;
  padding: var(--space-xxs) var(--space-xs);
  position: relative;
}

.bt-active-filters__clear::after {
  content: '';
  position: absolute;
  left: var(--space-xs);
  right: var(--space-xs);
  bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-base) var(--ease-out);
}

.bt-active-filters__clear:hover::after {
  transform: scaleX(1);
}

/* Active-filter chip — used inside .bt-active-filters. Visually similar
 * to .bt-chip--selected but lighter weight since it sits over the
 * existing dark page surface, not inside a refine modal. */
.bt-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--gold-subtle);
  color: var(--gold);
  border: 1px solid rgba(196, 160, 82, 0.35);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui-sans);
  font-weight: var(--weight-medium);
  font-size: var(--size-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}

.bt-filter-chip__category {
  opacity: 0.7;
  font-weight: var(--weight-regular);
  text-transform: none;
  letter-spacing: var(--tracking-normal);
  font-size: 10px;
  padding-right: var(--space-xxs);
  border-right: 1px solid rgba(196, 160, 82, 0.4);
  margin-right: var(--space-xxs);
}

.bt-filter-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  margin-left: var(--space-xxs);
  background: none;
  border: none;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: opacity var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.bt-filter-chip__remove::before {
  content: '×';
}

.bt-filter-chip__remove:hover {
  opacity: 1;
  background: rgba(196, 160, 82, 0.18);
}

/* Result count summary — pairs with the chip rail */
.bt-filter-summary {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--weight-regular);
  font-size: var(--size-md);
  color: var(--text);
  margin: 0;
}

.bt-filter-summary strong {
  font-style: normal;
  font-weight: var(--weight-medium);
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ────────────────────────────────────────────────────────────────────────
 * Primary entry-point bar (Where / When / Who / Style / Refine)
 * Used on surfaces that want the spec's top-bar pattern. The /hotels
 * listing keeps its persistent rail; this bar is for the elevated
 * homepage and journeys discovery.
 * ──────────────────────────────────────────────────────────────────────── */

.bt-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-soft);
  max-width: 880px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.bt-filter-bar__search {
  flex: 1 1 220px;
  min-width: 200px;
  border: none;
  background: transparent;
  font-family: var(--font-ui-sans);
  font-size: var(--size-base);
  color: var(--text-on-cream-primary);
  padding: var(--space-xs) var(--space-md);
  outline: none;
}

.bt-filter-bar__search::placeholder {
  color: var(--text-on-cream-tertiary);
  font-style: italic;
}

.bt-filter-bar__divider {
  width: 1px;
  height: 24px;
  background: var(--border-default);
}

.bt-filter-bar__pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  font-family: var(--font-ui-sans);
  font-weight: var(--weight-medium);
  font-size: var(--size-sm);
  letter-spacing: var(--tracking-wide);
  color: var(--navy);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.bt-filter-bar__pill:hover {
  background: var(--surface-secondary);
}

.bt-filter-bar__pill--accent {
  background: var(--navy);
  color: var(--cream);
  padding: var(--space-xs) var(--space-lg);
}

.bt-filter-bar__pill--accent:hover {
  background: var(--navy-deep);
}

.bt-filter-bar__pill svg {
  width: 14px;
  height: 14px;
}

/* ────────────────────────────────────────────────────────────────────────
 * Refine modal — full-screen mobile, 40% side panel desktop
 * ──────────────────────────────────────────────────────────────────────── */

.bt-refine {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: var(--surface-overlay);
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out);
}

.bt-refine--open {
  opacity: 1;
  pointer-events: auto;
}

.bt-refine__panel {
  width: min(560px, 95vw);
  max-width: 100%;
  height: 100vh;
  background: var(--surface-primary);
  color: var(--text-on-cream-primary);
  overflow-y: auto;
  padding: var(--space-2xl) var(--space-xl) var(--space-3xl);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-editorial);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.bt-refine--open .bt-refine__panel {
  transform: translateX(0);
}

.bt-refine__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
}

.bt-refine__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--weight-medium);
  font-size: var(--size-2xl);
  line-height: var(--leading-tight);
  color: var(--navy);
  margin: 0;
}

.bt-refine__close {
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--navy);
  transition: var(--transition-fast);
}

.bt-refine__close:hover {
  background: var(--surface-secondary);
}

.bt-refine__close::before {
  content: '×';
  font-size: 22px;
  line-height: 1;
}

.bt-refine__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.bt-refine__section-title {
  font-family: var(--font-ui-sans);
  font-weight: var(--weight-medium);
  font-size: var(--size-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0;
}

.bt-refine__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.bt-refine__footer {
  position: sticky;
  bottom: 0;
  background: linear-gradient(
    to top,
    var(--surface-primary) 70%,
    rgba(250, 248, 245, 0)
  );
  padding: var(--space-lg) 0 var(--space-md);
  margin-top: auto;
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
}

.bt-refine__count {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--size-md);
  color: var(--text-on-cream-secondary);
}

.bt-refine__count strong {
  font-style: normal;
  font-weight: var(--weight-medium);
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.bt-refine__actions {
  display: flex;
  gap: var(--space-sm);
}

@media (max-width: 768px) {
  .bt-refine__panel {
    width: 100vw;
    padding: var(--space-xl) var(--space-md) var(--space-2xl);
  }
}

/* ────────────────────────────────────────────────────────────────────────
 * Tag display refinement for existing hotel-card .amenity-tags
 * The card-render JS in client/js/hotels.js already emits
 *   <div class="amenity-tags"><span>Spa</span><span>Pool</span>...</div>
 * These rules give those spans the bt-tag look without touching JS.
 * ──────────────────────────────────────────────────────────────────────── */

.amenity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xxs);
  margin-top: var(--space-xs);
}

.amenity-tags span {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--gold-subtle);
  color: var(--gold);
  border: 1px solid rgba(196, 160, 82, 0.3);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui-sans);
  font-weight: var(--weight-medium);
  font-size: 10px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ────────────────────────────────────────────────────────────────────────
 * Property-detail tag taxonomy display (full taxonomy grouped by
 * category, used on hotel detail pages per Site UI §4 "Tag Display ─
 * On Property Detail Pages")
 * ──────────────────────────────────────────────────────────────────────── */

.bt-tag-taxonomy {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.bt-tag-taxonomy__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.bt-tag-taxonomy__category {
  font-family: var(--font-ui-sans);
  font-weight: var(--weight-medium);
  font-size: var(--size-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-mid);
  margin: 0;
}

.bt-tag-taxonomy__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}
