/* ==========================================================================
   UncleTrips — Hotel-specific listing components
   The page layout, filters, sheet, sort, map and search come from listing.css.
   A hotel card represents a PROPERTY (not a bookable product): class stars,
   guest rating out of 10, amenities and a nightly lead rate + stay total.
   ========================================================================== */

/* ------------------------------------------------------------ Hotel card */
.hotel-card {
  --hc-pad: 12px;
  --hc-img: 280px;
  position: relative;
  display: grid;
  grid-template-columns: var(--hc-img) minmax(0, 1fr) auto;
  grid-template-areas: "media body price";
  gap: var(--sp-5);
  padding: var(--hc-pad);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  transition: box-shadow var(--dur) var(--ease);
}

.hotel-card:hover {
  box-shadow: var(--sh-md);
}

.hotel-card-media {
  grid-area: media;
  position: relative;
  aspect-ratio: 280 / 190;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--c-grey-100);
}

.hotel-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--ease);
}

.hotel-card:hover .hotel-card-media img {
  transform: scale(1.03);
}

.hotel-card .wish-btn {
  inset-block-start: calc(var(--hc-pad) + 8px);
  inset-inline-end: auto;
  inset-inline-start: calc(var(--hc-pad) + var(--hc-img) - 48px);
  z-index: 3;
}

.hotel-card-body {
  grid-area: body;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding-block: 4px;
}

.hotel-card-kind {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.hotel-card-title {
  font-size: var(--fs-18);
  font-weight: var(--fw-bold);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hotel-card-title a:hover {
  color: var(--c-navy-600);
}

/* whole card is clickable through the name link */
.hotel-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hotel-card-location {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-14);
  color: var(--c-grey-600);
}

.hotel-card-location .icon {
  width: 16px;
  height: 16px;
  color: var(--c-text-muted);
}

/* Guest rating (out of 10) — distinct from class stars */
.guest-rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: var(--fs-14);
}

.guest-score {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--c-navy-100);
  color: var(--c-navy-800);
  font-weight: var(--fw-extrabold);
  font-variant-numeric: tabular-nums;
}

.guest-word {
  font-weight: var(--fw-bold);
  color: var(--c-navy-900);
}

.guest-reviews {
  color: var(--c-text-muted);
}

.amenity-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: var(--fs-13);
  color: var(--c-grey-600);
}

.amenity-list li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.amenity-list .icon {
  width: 16px;
  height: 16px;
  color: var(--c-navy-600);
}

/* Price: nightly lead rate + stay total */
.hotel-card-price {
  grid-area: price;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3);
  min-width: 150px;
  padding: 4px 4px 2px 0;
  text-align: end;
}

.hotel-card-stay {
  margin-block-start: 4px;
  font-size: var(--fs-13);
  color: var(--c-text-muted);
}

.hotel-card-stay strong {
  color: var(--c-navy-900);
  font-weight: var(--fw-bold);
}

.hotel-card-price .price-block {
  align-items: flex-end;
}

.hotel-card-cta {
  position: relative;
  z-index: 2;
}

/* ============================================================== < 1200 */
@media (max-width: 1199px) {
  .hotel-card {
    --hc-img: 220px;
    gap: var(--sp-4);
  }
}

/* ============================================================== < 768: vertical cards */
@media (max-width: 767px) {
  .hotel-card {
    --hc-pad: 0px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "media"
      "body"
      "price";
    gap: 0;
    overflow: hidden;
  }

  .hotel-card-media {
    aspect-ratio: 16 / 9;
    border-radius: 0;
  }

  .hotel-card .wish-btn {
    inset-block-start: 10px;
    inset-inline-start: auto;
    inset-inline-end: 10px;
    width: 38px;
    height: 38px;
    background: var(--c-white);
    color: var(--c-navy-800);
    box-shadow: var(--sh-sm);
  }

  .hotel-card .wish-btn[aria-pressed="true"] {
    color: var(--c-orange-500);
  }

  .hotel-card-body {
    gap: 5px;
    padding: var(--sp-3) var(--sp-4) 0;
  }

  .hotel-card-title {
    font-size: var(--fs-16);
  }

  .hotel-card-location,
  .guest-rating {
    font-size: var(--fs-13);
  }

  /* scannable: two amenities, one booking badge */
  .amenity-list li:nth-child(n + 3),
  .hotel-card .badge--neutral,
  .hotel-card-cta {
    display: none;
  }

  .hotel-card-price {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    min-width: 0;
    padding: var(--sp-2) var(--sp-4) var(--sp-4);
    text-align: start;
  }

  .hotel-card-price {
    flex-wrap: wrap;
    gap: 2px var(--sp-3);
  }

  .hotel-card-price .price-block {
    order: 2;
    flex: none;
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
    margin-inline-start: auto;
    white-space: nowrap; /* keep "From AED 1,150 / per night" on one line in any direction */
  }

  .hotel-card-price .price-block strong {
    font-size: var(--fs-18);
  }

  .hotel-card-stay {
    order: 1;
    flex: 1 1 auto;
    white-space: nowrap;
    margin: 0;
    font-size: var(--fs-12);
  }

  /* "per night" is essential on hotel prices (tour cards hide their unit on mobile) */
  .hotel-card .price-unit {
    display: inline;
  }

  .hotel-card-price .price-unit::before {
    content: "/ ";
  }

  /* toolbar: Map sizes to content so Sort keeps its label */
  .page-hotels .results-tools {
    flex-wrap: wrap;
  }

  .page-hotels .results-tools > [data-map-open],
  .page-hotels .results-tools > .filter-open {
    flex: 0 0 auto;
  }
}

/* Very narrow phones: Map becomes icon-only so Sort keeps its label */
@media (max-width: 400px) {
  .page-hotels [data-map-open] {
    padding-inline: 0.75rem;
  }

  .page-hotels [data-map-open] span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Smallest phones: Sort gets its own full-width row */
@media (max-width: 359px) {
  .page-hotels .results-tools > .sort-box {
    flex-basis: 100%;
  }

  .page-hotels .results-tools > .filter-open {
    flex: 1 1 auto;
  }
}
