/* ============================================================
   Bohemia Design System — Hotel Listings & Filter
   ============================================================ */

/* ----- FILTER BAR ----- */
.filter-bar {
  position: sticky;
  top: 68px;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--bh-border-light);
  border-radius: var(--bh-radius-xl);
  padding: var(--bh-sp-4) var(--bh-sp-5);
  margin-bottom: var(--bh-sp-6);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  transition: box-shadow var(--bh-dur-norm) ease;
}

.filter-bar.is-stuck {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
  border-color: var(--bh-stone-200);
}

/* Form layout */
#hotel-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bh-sp-3);
  align-items: stretch;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}

/* Filter group */
.filter-group {
  flex: 1 1 160px;
  min-width: 0;
  position: relative;
}

.filter-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bh-stone-400);
  margin-bottom: 4px;
  padding-left: 2px;
}

.filter-group .filter-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-group .filter-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--bh-stone-400);
  pointer-events: none;
  flex-shrink: 0;
}

.filter-group select,
.filter-group input[type="text"] {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--bh-stone-400);
  border-radius: var(--bh-radius-md);
  font-size: var(--bh-text-sm);
  color: var(--bh-text-primary);
  background: white;
  font-family: var(--bh-font-body);
  transition: border-color var(--bh-dur-fast) ease, box-shadow var(--bh-dur-fast) ease;
  appearance: none;
  -webkit-appearance: none;
}

.filter-group select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235C5850' 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: 12px;
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
  outline: none;
  border-color: var(--bh-garnet-600);
  box-shadow: 0 0 0 3px rgba(184, 43, 74, 0.1);
}

.filter-group input[type="text"]::placeholder {
  color: var(--bh-stone-300);
}

/* Filter actions */
.filter-actions {
  display: flex;
  align-items: flex-end;
  gap: var(--bh-sp-2);
  flex-shrink: 0;
}

.submit-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bh-garnet-600);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--bh-radius-md);
  font-size: var(--bh-text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--bh-dur-fast) var(--bh-ease-out);
  white-space: nowrap;
  font-family: var(--bh-font-body);
}

.submit-button:hover {
  background: var(--bh-garnet-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 43, 74, 0.3);
}

.submit-button svg {
  width: 16px;
  height: 16px;
}

.filter-reset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border: 1px solid var(--bh-stone-400);
  border-radius: var(--bh-radius-md);
  font-size: var(--bh-text-sm);
  font-weight: 600;
  color: var(--bh-stone-500);
  background: white;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--bh-dur-fast) ease;
  white-space: nowrap;
  font-family: var(--bh-font-body);
}

.filter-reset:hover {
  background: var(--bh-stone-50);
  border-color: var(--bh-stone-300);
  color: var(--bh-stone-700);
}

/* Mobile filter toggle */
.filter-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: white;
  border: 1px solid var(--bh-stone-400);
  border-radius: var(--bh-radius-lg);
  font-size: var(--bh-text-sm);
  font-weight: 600;
  color: var(--bh-stone-600);
  cursor: pointer;
  margin-bottom: var(--bh-sp-4);
  transition: all var(--bh-dur-fast) ease;
  font-family: var(--bh-font-body);
}

.filter-toggle svg {
  width: 18px;
  height: 18px;
}

.filter-toggle:hover {
  background: var(--bh-stone-50);
  border-color: var(--bh-stone-300);
}

.filter-toggle .filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bh-garnet-600);
  color: white;
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: var(--bh-radius-full);
}

/* ----- RESULTS HEADER ----- */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--bh-sp-4);
}

.results-header .results-count {
  font-size: var(--bh-text-sm);
  color: var(--bh-stone-500);
}

.results-header .results-count strong {
  color: var(--bh-text-primary);
  font-weight: 700;
}

/* ----- HOTEL GRID ----- */
.hotels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--bh-sp-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ----- HOTEL CARD (grid item) ----- */
.hotel-grid-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--bh-radius-lg);
  border: 1px solid var(--bh-border-light);
  background: var(--bh-surface-card);
  overflow: hidden;
  transition: all var(--bh-dur-norm) var(--bh-ease-out);
  text-decoration: none;
  color: inherit;
}

.hotel-grid-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
  border-color: var(--bh-stone-200);
}

/* Card image */
.hotel-grid-card .card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.hotel-grid-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--bh-ease-out);
}

.hotel-grid-card:hover .card-image img {
  transform: scale(1.05);
}

/* Card body */
.hotel-grid-card .card-body {
  display: flex;
  flex-direction: column;
  gap: var(--bh-sp-2);
  padding: var(--bh-sp-4) var(--bh-sp-4) var(--bh-sp-5);
  flex: 1;
}

/* Stars */
.hotel-grid-card .card-stars {
  color: var(--bh-gold-400);
  font-size: var(--bh-text-sm);
  letter-spacing: 1px;
  line-height: 1;
}

/* Title */
.hotel-grid-card .card-title {
  margin: 0;
  font-family: var(--bh-font-display);
  font-size: var(--bh-text-lg);
  font-weight: 700;
  color: var(--bh-text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Location */
.hotel-grid-card .card-location {
  font-size: var(--bh-text-sm);
  color: var(--bh-stone-400);
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.hotel-grid-card .card-location svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--bh-stone-300);
}

/* Card footer — rating + price */
.hotel-grid-card .card-footer {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: var(--bh-sp-3);
  border-top: 1px solid var(--bh-stone-100);
}

/* Rating */
.hotel-grid-card .card-rating {
  display: flex;
  align-items: center;
  gap: var(--bh-sp-2);
}

.hotel-grid-card .card-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bh-garnet-600);
  color: white;
  font-family: var(--bh-font-mono);
  font-size: var(--bh-text-xs);
  font-weight: 700;
  min-width: 36px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--bh-radius-sm);
  line-height: 1;
}

.hotel-grid-card .card-score.score-high {
  background: var(--bh-forest-500);
}

.hotel-grid-card .card-rating-info {
  display: flex;
  flex-direction: column;
}

.hotel-grid-card .card-rating-label {
  font-size: var(--bh-text-xs);
  font-weight: 600;
  color: var(--bh-stone-600);
  line-height: 1.2;
}

.hotel-grid-card .card-reviews {
  font-size: 11px;
  color: var(--bh-stone-400);
  line-height: 1.2;
}

/* Price */
.hotel-grid-card .card-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hotel-grid-card .card-price-label {
  font-size: var(--bh-text-xs);
  color: var(--bh-stone-400);
  line-height: 1.2;
}

.hotel-grid-card .card-price-value {
  font-family: var(--bh-font-heading);
  font-size: var(--bh-text-lg);
  font-weight: 700;
  color: var(--bh-text-primary);
  line-height: 1.2;
}

/* ----- MAP SECTION ----- */
.map-section {
  margin-bottom: var(--bh-sp-6);
}

.map-section h2 {
  font-size: var(--bh-text-lg);
  margin-bottom: var(--bh-sp-2);
}

.hotels-results {
  color: var(--bh-stone-400);
  font-size: var(--bh-text-sm);
  margin-bottom: var(--bh-sp-3);
}

/* ----- HOTELS LISTING SECTION ----- */
.hotels-listing {
  margin-bottom: var(--bh-sp-8);
}

.hotels-listing > h2 {
  font-size: var(--bh-text-xl);
  margin-bottom: var(--bh-sp-1);
}

/* ----- AJAX CONTAINER ----- */
.ajax-switch-elems {
  margin-bottom: var(--bh-sp-4);
}

.ajax-switch-elems .pagination {
  margin-bottom: 0;
}

/* ----- OLD CLASSES (kept for backward compatibility in AJAX) ----- */
.hotels-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--bh-sp-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .hotels-grid,
  .hotels-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .filter-toggle {
    display: flex;
  }

  .filter-bar {
    position: relative;
    top: auto;
    padding: var(--bh-sp-4);
    display: none;
  }

  .filter-bar.is-open {
    display: block;
  }

  #hotel-filter-form {
    flex-direction: column;
    gap: var(--bh-sp-3);
  }

  .filter-group {
    flex: 1 1 100%;
  }

  .filter-actions {
    flex-direction: row;
    width: 100%;
  }

  .filter-actions .submit-button {
    flex: 1;
  }

  .filter-actions .filter-reset {
    flex: 0 0 auto;
  }

  .hotels-grid,
  .hotels-list {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--bh-sp-3);
  }

  .hotel-grid-card .card-title {
    font-size: var(--bh-text-base);
  }
}

@media (max-width: 480px) {
  .hotels-grid,
  .hotels-list {
    grid-template-columns: 1fr;
  }
}
