.card.hotel-result-card,
.central-experience-card.booking-tour-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid #cdd3dc;
  border-radius: 13px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 5px #17284a0d;
}
.card.hotel-result-card .photo-frame,
.booking-tour-card .hoi-an-activity-poster { position: relative; aspect-ratio: 16 / 10; padding: 0; }
.booking-tour-card .hoi-an-activity-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hotel-result-card .hotel-rating,
.booking-tour-card .booking-rating {
  position: absolute;
  z-index: 1;
  bottom: -12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 8px 2px 2px;
  background: white;
  border: 1px solid #224bd8;
  border-radius: 30px;
  color: #183ebd;
  font: 600 .76rem/1.2 system-ui, sans-serif;
  box-shadow: 0 2px 4px #17284a24;
  pointer-events: none;
}
.hotel-result-card .hotel-rating[hidden] { display: none; }
.hotel-result-card .hotel-score,
.booking-tour-card .booking-rating b { background: #224bd8; color: white; border-radius: 24px; padding: 4px 7px; }
.hotel-result-card .card-body,
.central-experience-card.booking-tour-card > div { flex: 1; display: flex; flex-direction: column; align-items: stretch; padding: 22px 15px 12px; }
.hotel-result-card .card-actions { flex-direction: column; align-items: stretch; gap: 8px; }
.hotel-result-card .hotel-price strong,
.booking-tour-card .booking-tour-price { display: block; color: #15213b; font-size: 1.45rem; line-height: 1.2; }
.hotel-result-card .hotel-stars { color: #8a5100; }
.booking-tour-card .booking-tour-info { margin-top: auto; padding-top: 6px; }
.hotel-result-card .booking-detail,
.booking-tour-card a.booking-detail {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #2451e8;
  color: white;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}
.booking-detail:hover { filter: brightness(.9); }
.booking-detail:focus-visible { outline: 2px solid #17284a; outline-offset: 2px; }
.hotel-result-card .book { white-space: normal; }

.discover-hotel-track .home-hotel-booking {
  flex: 0 0 calc((100% - 2 * 17px) / 3);
  max-width: none;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cdd3dc;
  border-radius: 13px;
  background: #fff;
}
.home-hotel-booking .hotel-photo { position: relative; display: block; aspect-ratio: 16 / 10; overflow: visible; border-radius: 0; }
.home-hotel-booking .hotel-photo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.home-hotel-booking .booking-rating {
  position: absolute;
  z-index: 1;
  bottom: -12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 8px 2px 2px;
  border: 1px solid #224bd8;
  border-radius: 24px;
  background: #fff;
  color: #183ebd;
  font: 600 .76rem/1.2 system-ui, sans-serif;
}
.home-hotel-booking .booking-rating b { padding: 4px 7px; border-radius: 24px; background: #224bd8; color: #fff; font: inherit; }
.home-hotel-booking > .hotel-snapshot-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 0;
  padding: 20px 14px 12px;
}
.home-hotel-booking .hotel-reference-rate { margin-top: auto; }
.home-hotel-booking .booking-detail,
.home-hotel-booking .hotel-trip-button {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 7px 10px;
  border-radius: 10px;
  color: #fff;
  font-size: .83rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.home-hotel-booking .booking-detail { background: #2451e8; }
.home-hotel-booking .hotel-trip-button { background: #145447; }
@media (max-width: 960px) {
  .discover-hotel-track .home-hotel-booking { flex-basis: calc((100% - 17px) / 2); }
}
@media (max-width: 640px) {
  .discover-hotel-track .home-hotel-booking { flex-basis: 85%; }
}

/* Collection cards share the same responsive columns across the site. */
main :is(.hotel-grid, .guide-grid, .story-grid, .hoi-an-activity-grid):not(.home-story-track) {
  grid-template-columns: repeat(var(--collection-columns, 1), minmax(0, 1fr));
  gap: 18px;
}

main :is(.hotel-grid, .guide-grid, .story-grid, .hoi-an-activity-grid) > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

main .story-grid > .story-card > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

main :is(.hotel-grid, .guide-grid, .story-grid, .hoi-an-activity-grid) :is(a, button):focus-visible {
  outline: 2px solid #224bd8;
  outline-offset: -3px;
}

main :is(.hotel-grid, .story-grid, .hoi-an-activity-grid) :is(.booking-detail, .hotel-trip-button) {
  min-height: 44px;
  text-align: center;
}

@media (min-width: 641px) {
  main { --collection-columns: 2; }
}

@media (min-width: 1001px) {
  main { --collection-columns: 3; }
}

@media (min-width: 1200px) {
  main { --collection-columns: 4; }

  .discover-home #vietnam .discover-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .discover-home [data-home-story-carousel] .home-story-track:has(> :nth-child(4)) {
    grid-auto-columns: calc((100% - 3 * var(--story-gap)) / 4);
  }

  .discover-home .discover-shortlist .discover-hotel-track > .discover-hotel-card {
    flex: 0 0 calc((100% - 51px) / 4);
    max-width: none;
  }
}

@media (max-width: 640px) {
  .discover-home .discover-shortlist .discover-hotel-track > .home-hotel-booking {
    flex-basis: 100%;
  }
}

.hotel-result-row { display: contents; }

/* Mobile discovery rows reveal the next card without widening the page. */
@media (max-width: 640px) {
  [data-hotel-browser] #hotel-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  [data-hotel-browser] .hotel-result-row { display: grid; }

  [data-hotel-browser] .hotel-result-row,
  main[data-trip-blog] .hoi-an-discovery .hoi-an-activity-grid,
  main[data-trip-blog] .directory[id] .story-grid,
  .hoi-an-tour-page main :is(.hoi-an-collection, .hoi-an-discovery) .hoi-an-activity-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 78%;
    gap: 12px;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding-bottom: 10px;
  }

  [data-hotel-browser] .hotel-result-row > *,
  main[data-trip-blog] .hoi-an-discovery .hoi-an-activity-grid > *,
  main[data-trip-blog] .directory[id] .story-grid > *,
  .hoi-an-tour-page main :is(.hoi-an-collection, .hoi-an-discovery) .hoi-an-activity-grid > * {
    scroll-snap-align: start;
  }

  .tour-market .tour-product-track {
    grid-auto-columns: 78%;
  }
}

/* Shared property cards: photo, review and booking actions. */
.hotel-snapshot.home-hotel-booking{display:flex;flex-direction:column;min-width:0;overflow:hidden;border:1px solid #cdd3dc;border-radius:13px;background:#fff;padding:0}
.hotel-snapshot.home-hotel-booking .hotel-photo{margin:0;flex:none;min-height:0}
.hotel-snapshot.home-hotel-booking .hotel-photo img{aspect-ratio:16/10;min-height:0}
.hotel-snapshot.home-hotel-booking .booking-rating{white-space:nowrap;max-width:calc(100% - 24px);font-size:12px}
.hotel-snapshot.home-hotel-booking .hotel-snapshot-copy h3{font-size:18px;line-height:1.4;margin:6px 0 12px}
.hotel-snapshot.home-hotel-booking .hotel-reference-rate{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline;padding-top:12px}
.hotel-snapshot.home-hotel-booking[data-hotel-snapshot]{padding:0!important}
.hotel-snapshot.home-hotel-booking[data-hotel-snapshot] .hotel-photo{height:auto;aspect-ratio:16/10;overflow:visible;border-radius:0}
.hotel-snapshot.home-hotel-booking[data-hotel-snapshot] .hotel-photo img{height:100%;aspect-ratio:16/10;border-radius:0}
.hotel-snapshot.home-hotel-booking .hotel-reference-rate>strong{font-size:18px;line-height:1.35}

/* A clear booking action, with the guide available as a quieter text link. */
main :is(.home-hotel-booking, .booking-tour-card) a.booking-affiliate,
main .hotel-result-card .card-actions a.book {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin: 8px 0 0;
  border: 1px solid #2451e8;
  border-radius: 10px;
  background: #2451e8;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  white-space: normal;
}
main :is(.home-hotel-booking, .hotel-result-card) a.booking-detail,
main .booking-tour-card:has(.booking-affiliate) a.booking-detail {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 6px 8px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #244b42;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  box-shadow: none;
}
main :is(.booking-affiliate, .hotel-result-card .book):hover { background: #193ec0; }
main :is(.booking-affiliate, .booking-detail, .hotel-result-card .book):focus-visible {
  outline: 3px solid #163d33;
  outline-offset: 2px;
}
main .hotel-result-card .card-actions { gap: 0; }
main .booking-tour-card .booking-tour-info { margin-top: auto; }
main .booking-tour-card > div > p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* Override the legacy snapshot stylesheet and its bundled home copy. */
main .home-hotel-booking .hotel-trip-button.booking-affiliate {
  background: #2451e8 !important;
  border-color: #2451e8 !important;
  font-size: 14px !important;
  padding: 10px 12px !important;
}
main .home-hotel-booking .hotel-trip-button.booking-affiliate:hover {
  background: #193ec0 !important;
  border-color: #193ec0 !important;
}
