/* Browse Rooms — filter card layout (Phase 0 extract from search.php) */

.search-filter-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 100%;
  box-sizing: border-box;
}

.search-row-booking {
  order: 1;
}

.search-advanced-toggle {
  order: 2;
}

.search-advanced {
  order: 3;
}

.search-filter-actions {
  order: 4;
}

.search-filter-card *,
.search-filter-card {
  box-sizing: border-box;
}

.search-row {
  display: grid;
  gap: 0.65rem;
  width: 100%;
}

.search-ff {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
  max-width: 100%;
}

.search-ff > span {
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.55);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.search-ff input,
.search-ff select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  font-size: 0.875rem;
}

.search-ff input[type="date"] {
  display: block;
  -webkit-appearance: none;
  appearance: none;
}

.search-ff select:disabled {
  opacity: 0.65;
  background: #f1f5f9;
}

.search-row-booking {
  grid-template-columns: 1fr;
}

.search-row-location,
.search-row-geo {
  grid-template-columns: 1fr;
}

.search-row-specs {
  grid-template-columns: 1fr 1fr;
}

.search-advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  border: 1px solid hsl(var(--border));
  background: #fff;
  color: hsl(var(--foreground));
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.search-advanced-toggle__chevron {
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}

.search-advanced-toggle[aria-expanded="true"] .search-advanced-toggle__chevron {
  transform: rotate(180deg);
}

.search-advanced {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
}

.search-advanced.is-open {
  display: flex;
}

.search-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.search-submit-btn {
  width: 100%;
  justify-content: center;
  min-height: 2.75rem;
}

.search-clear-btn {
  font-size: 0.8125rem;
  color: rgba(15, 23, 42, 0.55);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.search-filter-amenities {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.search-filter-amenities__label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.55);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.search-amenity-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.search-amenity-option {
  margin: 0;
}

.search-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.search-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: #fff;
  color: hsl(var(--foreground) / 0.75);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search-filter-chip span {
  max-width: 12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-filter-chip i {
  font-size: 0.625rem;
  color: hsl(var(--foreground) / 0.45);
}

.search-filter-chip:hover {
  border-color: hsl(var(--primary) / 0.35);
  background: hsl(var(--primary) / 0.06);
}

.search-ff input[type="hidden"] {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.search-ff--guests .home-guest-picker__btn {
  width: 100%;
}

@media (min-width: 640px) {
  .search-row-booking {
    grid-template-columns: 1fr 1fr;
  }

  .search-row-location,
  .search-row-geo {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .search-advanced-toggle {
    display: none;
  }

  .search-advanced {
    display: flex !important;
    order: 1;
  }

  .search-row-booking {
    grid-template-columns: 1.1fr 1.1fr 1.2fr 1fr;
    order: 2;
  }

  .search-row-location {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .search-row-geo {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .search-row-specs {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }

  .search-submit-btn {
    width: auto;
    min-width: 8.5rem;
  }

  .search-filter-actions {
    order: 3;
  }
}

/* ── Phase 1: mobile collapsed summary + bottom sheet ── */
.search-filter-shell {
  position: relative;
}

.search-filter-compact-row {
  display: none;
}

.search-filter-sheet-overlay,
.search-filter-sheet-header,
.search-filter-sheet-footer {
  display: none;
}

.search-filter-compact {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  cursor: pointer;
}

.search-filter-compact__icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: hsl(var(--primary));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-filter-compact__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.search-filter-compact__where {
  font-size: 0.875rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-filter-compact__meta {
  font-size: 0.75rem;
  color: hsl(var(--foreground) / 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-filter-compact__badge {
  flex-shrink: 0;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: hsl(var(--primary));
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-filter-compact__filters-btn {
  flex-shrink: 0;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: #fff;
  color: hsl(var(--foreground) / 0.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.search-filter-sheet-header {
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid hsl(var(--border) / 0.85);
}

.search-filter-sheet-header__title {
  font-family: var(--font-heading, 'Poppins', sans-serif);
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.search-filter-sheet-header__close {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: #fff;
  color: hsl(var(--foreground) / 0.65);
  cursor: pointer;
}

.search-filter-sheet-footer {
  display: none;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  background: linear-gradient(to top, #fff 75%, rgba(255, 255, 255, 0));
}

.search-filter-filters-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.85rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground) / 0.75);
  cursor: pointer;
}

.search-row-destination {
  grid-template-columns: 1fr;
}

.search-destination-wrap {
  position: relative;
  width: 100%;
}

.search-destination-wrap i {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--foreground) / 0.35);
  pointer-events: none;
  font-size: 0.8rem;
}

.search-ff--destination input {
  padding-left: 2rem !important;
}

.search-submit-btn--sheet {
  flex: 1;
  min-height: 2.75rem;
}

@media (max-width: 767px) {
  .search-filter-shell {
    padding: 0.55rem !important;
    border-radius: 999px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .search-filter-compact-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .search-filter-body {
    display: none;
  }

  body.search-filter-sheet-open {
    overflow: hidden;
  }

  body.search-filter-sheet-open .mobile-bottom-nav,
  body.search-filter-sheet-open .es-bottom-nav,
  body.search-filter-sheet-open .chat-toggle,
  body.search-filter-sheet-open .esky-chat-fab {
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.search-filter-sheet-open .search-filter-shell.is-sheet-open {
    position: fixed;
    inset: 0;
    z-index: 10050;
    pointer-events: none;
  }

  body.search-filter-sheet-open .search-filter-shell.is-sheet-open .search-filter-compact-row {
    display: none;
  }

  body.search-filter-sheet-open .search-filter-shell.is-sheet-open .search-filter-sheet-overlay {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  body.search-filter-sheet-open .search-filter-shell.is-sheet-open .search-filter-body {
    display: block;
    position: absolute;
    z-index: 1;
    left: max(0.75rem, env(safe-area-inset-left, 0px));
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    top: max(0.75rem, env(safe-area-inset-top, 0px));
    bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: 28rem;
    margin: auto;
    height: fit-content;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1rem 0.9rem;
    border-radius: 1.15rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #fff;
    box-shadow:
      0 24px 56px rgba(15, 23, 42, 0.22),
      0 8px 20px rgba(15, 23, 42, 0.1);
    animation: searchFilterModalIn 0.22s ease-out;
    box-sizing: border-box;
    pointer-events: auto;
  }

  body.search-filter-sheet-open .search-filter-shell.is-sheet-open {
    padding: 0 !important;
  }

  body.search-filter-sheet-open .search-filter-shell.is-sheet-open .search-filter-body .search-row,
  body.search-filter-sheet-open .search-filter-shell.is-sheet-open .search-filter-body .search-advanced {
    width: 100%;
    max-width: 100%;
  }

  .search-filter-sheet-header,
  .search-filter-sheet-footer {
    display: flex;
  }

  body.search-filter-sheet-open .search-filter-shell.is-sheet-open .search-filter-sheet-footer {
    position: static;
    margin-top: 0.65rem;
    padding-top: 0.75rem;
    border-top: 1px solid hsl(var(--border) / 0.85);
    background: #fff;
  }

  .search-filter-actions .search-submit-btn:not(.search-submit-btn--sheet) {
    display: none;
  }

  .search-advanced-toggle {
    display: none;
  }

  body.search-filter-sheet-open .search-filter-shell.is-sheet-open .search-advanced:not(.is-open) {
    display: none;
  }

  .search-row-booking {
    grid-template-columns: 1fr 1fr;
  }

  .search-filter-card .search-row-booking > .search-ff--guests,
  .search-filter-card .search-row-destination,
  .search-filter-card .search-row-booking > label.search-ff:last-child {
    grid-column: 1 / -1;
  }

  .search-filter-card .search-ff--guests,
  .search-filter-card .search-ff--guests .home-guest-picker {
    overflow: visible;
    z-index: 4;
  }

  body.search-filter-sheet-open .search-filter-shell.is-sheet-open .home-guest-picker__panel {
    z-index: 2;
  }

  body.search-filter-sheet-open .search-filter-card .home-guest-picker__btn {
    padding: 0.875rem 1rem !important;
    border-radius: 1rem !important;
    background: #f1f5f9 !important;
    font-size: 0.9375rem !important;
    min-height: 3rem !important;
  }

  .search-filter-chips {
    margin-top: 0.5rem;
    padding: 0 0.15rem;
  }
}

@media (min-width: 768px) {
  .search-filter-compact-row,
  .search-filter-sheet-overlay,
  .search-filter-sheet-header,
  .search-filter-sheet-footer,
  .search-submit-btn--sheet {
    display: none !important;
  }

  .search-filter-body {
    display: flex !important;
    flex-direction: column;
    gap: 0.75rem;
  }
}

@keyframes searchFilterModalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Phase 4: sticky Edit search + quick filter chips (mobile) ── */
.search-sticky-sentinel {
  height: 1px;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.search-sticky-bar {
  display: none;
}

.search-sticky-bar__inner {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.search-sticky-bar__edit {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  cursor: pointer;
}

.search-sticky-bar__icon {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: hsl(var(--primary));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.search-sticky-bar__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.search-sticky-bar__where {
  font-size: 0.8125rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-sticky-bar__meta {
  font-size: 0.6875rem;
  color: hsl(var(--foreground) / 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-sticky-bar__badge {
  flex-shrink: 0;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: hsl(var(--primary));
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-quick-chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0.1rem 0.15rem 0.2rem;
}

.search-quick-chips::-webkit-scrollbar {
  display: none;
}

.search-quick-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: #fff;
  color: hsl(var(--foreground) / 0.72);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.search-quick-chip.is-active {
  border-color: hsl(var(--primary) / 0.45);
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

@media (max-width: 767px) {
  .search-sticky-bar.is-visible {
    display: block;
    position: sticky;
    top: 0;
    z-index: 44;
    margin: 0 -0.25rem 0.65rem;
    padding: 0.45rem 0.25rem 0.35rem;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  }

  body.search-filter-sheet-open .search-sticky-bar {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .search-sticky-sentinel,
  .search-sticky-bar {
    display: none !important;
  }
}
