/* =========================================================
   SECTION — Top Destinations (docs/sections/top-destinations.md)
   Product cards: css/components/tour-card.css (.tour-card--wide)
   ========================================================= */

.top-destinations {
  padding: 45px 0 70px;
  background: var(--color-white);
}

.top-destinations__inner {
  max-width: 1288px;   /* 5 × 245 tiles + 4 × 16 gaps */
  margin-inline: auto;
}

/* ---------- Header ---------- */
.top-destinations__header { text-align: center; }
.top-destinations__title {
  margin: 0 0 24px;
  font-size: 36px;
  line-height: 40px;
  font-weight: 400;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--color-black);
}
.top-destinations__text {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
  color: var(--color-slate);
}

/* ---------- Category buttons (links, not tabs — all look the same until hovered) ---------- */
.top-destinations__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 37px 0 30px;
}
.category-link {
  height: 48px;
  padding: 0 22px;
  border-color: var(--color-black);
  background: var(--color-white);
  color: var(--color-black);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}
.category-link:hover,
.category-link:focus-visible { border-color: var(--color-yellow); background: var(--color-yellow); color: var(--color-black); }

/* ---------- Destination tiles ---------- */
.destination-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.destination-tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-media);
  aspect-ratio: 245 / 342;
  background: var(--color-navy);
  color: var(--color-white);
}
.destination-tile::after {               /* navy fade behind the label */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31, 45, 66, 0) 55%, rgba(31, 45, 66, .95) 100%);
  pointer-events: none;
}
.destination-tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.destination-tile__name {
  position: absolute;
  z-index: 1;
  left: 8px;
  right: 8px;
  bottom: 24px;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}
.destination-tile:hover .destination-tile__img,
.destination-tile:focus-visible .destination-tile__img { transform: scale(1.08); }
.destination-tile:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 2px; }

/* ---------- Best Selling + 2 products ---------- */
.top-destinations__featured {
  display: grid;
  grid-template-columns: 506fr 371fr 371fr;
  gap: 20px;
  align-items: stretch;
}

.best-selling {
  position: relative;
  display: flex;
  min-height: 486px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--color-navy);
  color: var(--color-white);
}
.best-selling__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.best-selling::before {                  /* navy from the left/top so the copy stays readable */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(23, 39, 63, .92) 0%, rgba(23, 39, 63, .45) 45%, rgba(23, 39, 63, 0) 80%),
    linear-gradient(180deg, rgba(23, 39, 63, .35) 0%, rgba(23, 39, 63, 0) 45%);
}
.best-selling__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 36px 30px 30px;
}
.best-selling__title {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 38px;
  font-weight: 700;
  text-transform: uppercase;
}
.best-selling__text {
  max-width: 290px;
  margin: 0;
  font-size: 16px;
  line-height: 22px;
}
.best-selling__cta { margin-top: auto; }
.best-selling:hover .best-selling__img { transform: scale(1.05); }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
  .destination-tile__name { font-size: 14px; bottom: 18px; }
  .best-selling__title { font-size: 28px; line-height: 34px; }
}

/* Tiles become a swipeable row; Best Selling goes full width above the two cards */
@media (max-width: 991.98px) {
  .top-destinations__featured { grid-template-columns: 1fr 1fr; }
  .best-selling { grid-column: 1 / -1; min-height: 340px; }
  .destination-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 2 * 16px) / 3.2);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .destination-grid::-webkit-scrollbar { display: none; }
  .destination-grid__item { scroll-snap-align: start; }
}

@media (max-width: 767.98px) {
  .top-destinations { padding: 28px 0 50px; }
  .top-destinations__title { font-size: 28px; line-height: 34px; margin-bottom: 12px; }
  .top-destinations__links {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 10px;
    margin: 24px calc(-1 * var(--gutter)) 24px;
    padding: 0 var(--gutter) 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .top-destinations__links::-webkit-scrollbar { display: none; }
  .category-link { flex: 0 0 auto; height: 42px; padding: 0 16px; font-size: 14px; }
  .destination-grid { grid-auto-columns: calc((100% - 16px) / 2.3); margin-bottom: 20px; }
  .best-selling__title { font-size: 26px; line-height: 32px; }
}

@media (max-width: 575.98px) {
  .top-destinations__featured { gap: 10px; }  /* keeps the 2 product cards side by side */
  .best-selling { min-height: 300px; }
  .best-selling__content { padding: 26px 22px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .destination-tile__img, .best-selling__img { transition: none; }
}
