/* =============================================
   UpTrail Tour Highlight Selector
   PC Desktop: Flex expansion 7:1 chuẩn demo.html 100%
   Mobile/Tablet: Carousel cuộn tự do 1:1, căn giữa tuyệt đối 100%
   ============================================= */

.tour-highlight-selector,
.tour-highlight-selector * {
  box-sizing: border-box;
}

.tour-highlight-selector {
  --highlight-ink: #17332d;
  --highlight-green: #1f5a49;
  --highlight-gold: #c9923e;
  position: relative;
  display: block !important;
  width: 100% !important;
  padding: clamp(3rem, 5vw, 5rem) max(1rem, calc((100vw - 1200px) / 2));
  overflow: hidden;
  color: var(--highlight-ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(201, 146, 62, .16), transparent 22rem),
    repeating-linear-gradient(135deg, transparent 0 26px, rgba(23, 51, 45, .032) 26px 27px),
    #f8f6ef;
}

.tour-highlight-selector::before {
  position: absolute;
  right: -10rem;
  bottom: -13rem;
  width: 38rem;
  height: 38rem;
  border: 1px solid rgba(31, 90, 73, .11);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.tour-highlight-selector__heading,
.tour-highlight-selector__toolbar,
.tour-highlight-selector__options {
  position: relative;
  z-index: 1;
  width: min(100%, 1200px);
  margin-right: auto;
  margin-left: auto;
}

.tour-highlight-selector__heading {
  display: grid;
  gap: .6rem;
  max-width: 850px;
  margin-bottom: 1.8rem;
}

.tour-highlight-selector__heading p {
  margin: 0;
  color: #6d7d96;
  font-family: Inter, system-ui, sans-serif;
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .16em;
}

.tour-highlight-selector__heading h2 {
  margin: 0;
  color: var(--highlight-ink);
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(2rem, 4.5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.02em;
  word-spacing: .02em;
  text-transform: uppercase;
}
@media (min-width: 1025px) {
  .tour-highlight-selector__heading {
    max-width: 940px;
    gap: .78rem;
  }

  .tour-highlight-selector__heading h2 {
    font-size: clamp(2.1rem, 4vw, 3.55rem);
    line-height: 1.16;
    letter-spacing: .025em;
    word-spacing: .1em;
  }
}
.tour-highlight-selector__heading > span {
  color: #55716b;
  font-size: .86rem;
  font-weight: 650;
}

.tour-highlight-selector__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  margin-bottom: .85rem;
}

.tour-highlight-selector__toolbar button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  color: var(--highlight-green);
  font: inherit;
  font-size: 1.15rem;
  background: rgba(255, 255, 255, .76);
  border: 1px solid rgba(23, 51, 45, .15);
  border-radius: 50%;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.tour-highlight-selector__toolbar button:not(:disabled):hover {
  color: #fff;
  background: var(--highlight-green);
  transform: translateY(-2px);
}

.tour-highlight-selector__toolbar button:disabled {
  opacity: .36;
  cursor: not-allowed;
}

.tour-highlight-selector__toolbar p {
  display: flex;
  gap: .25rem;
  min-width: 50px;
  margin: 0 .15rem;
  color: #71807c;
  font-family: Inter, system-ui, sans-serif;
  font-size: .7rem;
  font-weight: 750;
}

.tour-highlight-selector__toolbar strong { color: var(--highlight-ink); }

/* =============================================
   GIAO DIỆN PC DESKTOP (> 1024px): ĐỒNG BỘ 100% GỐC DEMO.HTML
   ============================================= */

@media (min-width: 1025px) {
  .tour-highlight-selector [data-is-clone="true"] {
    display: none !important;
  }

  .tour-highlight-selector__options {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 960px !important;
    height: 420px !important;
    overflow: hidden !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border-radius: 12px !important;
    border: none !important;
  }

  .tour-highlight-selector__option {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    overflow: hidden !important;
    cursor: pointer !important;
    flex: 1 1 0% !important;
    min-width: 24px !important;
    min-height: 100px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: 2px solid #292929 !important;
    background-color: #18181b !important;
    opacity: 1 !important;
    transform: none !important;
    backface-visibility: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.30) !important;
    z-index: 1 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    text-align: left !important;
    width: auto !important;
    will-change: flex-grow, flex-basis;
    transition: flex-grow 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                flex-basis 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.35s ease-in-out,
                box-shadow 0.35s ease-in-out !important;
  }

  .tour-highlight-selector__option.is-active {
    flex: var(--highlight-active-grow, 5.5) 1 0% !important;
    border-color: #ffffff !important;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42) !important;
    z-index: 10 !important;
  }

  .tour-highlight-selector__option:hover {
    border-color: #888888 !important;
  }

  .tour-highlight-selector__option.is-active:hover {
    border-color: #ffffff !important;
  }

  /* Large galleries keep every card in one row and reduce the active ratio. */
  .tour-highlight-selector.is-overflowing .tour-highlight-selector__options {
    max-width: 960px !important;
    overflow: hidden !important;
  }

  .tour-highlight-selector.is-overflowing .tour-highlight-selector__option {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    contain: paint;
    transition: flex-grow 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                flex-basis 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.35s ease-in-out,
                box-shadow 0.35s ease-in-out !important;
  }

  .tour-highlight-selector.is-overflowing .tour-highlight-selector__option.is-active {
    flex: var(--highlight-active-grow, 3.5) 1 0% !important;
    min-width: 0 !important;
  }

  .tour-highlight-selector__option.is-portrait.is-active,
  .tour-highlight-selector.is-overflowing .tour-highlight-selector__option.is-portrait.is-active {
    flex: 0 0 var(--highlight-active-width, 236px) !important;
    border-color: transparent !important;
  }

  .tour-highlight-selector__option.is-portrait.is-active:hover {
    border-color: transparent !important;
  }

  .tour-highlight-selector.is-overflowing .tour-highlight-selector__shade,
  .tour-highlight-selector.is-overflowing .tour-highlight-selector__copy strong,
  .tour-highlight-selector.is-overflowing .tour-highlight-selector__copy > span,
  .tour-highlight-selector.is-overflowing .tour-highlight-selector__copy small {
    transition-duration: 0.65s !important;
    transition-timing-function: ease-in-out !important;
  }
}

/* --- Shared Image Layer --- */
.tour-highlight-selector__media,
.tour-highlight-selector__image,
.tour-highlight-selector__image-fallback {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.tour-highlight-selector__media {
  z-index: 0 !important;
  overflow: hidden !important;
  background: linear-gradient(145deg, #17231f, #0d1311) !important;
}

.tour-highlight-selector__image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  transform: none !important;
  filter: none !important;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.tour-highlight-selector__option.is-portrait.is-active .tour-highlight-selector__image {
  object-fit: contain !important;
}

.tour-highlight-selector__option.is-portrait.is-active .tour-highlight-selector__media {
  background: transparent !important;
}

@media (min-width: 1025px) {
  .tour-highlight-selector__option.is-active .tour-highlight-selector__image {
    transform: scale(1.02) !important;
  }
  .tour-highlight-selector__option:hover .tour-highlight-selector__image {
    transform: scale(1.02) !important;
  }
}

.tour-highlight-selector__image-fallback {
  background: #18181b !important;
}

/* --- Gradient Shade --- */
.tour-highlight-selector__shade {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: -40px !important;
  height: 140px !important;
  pointer-events: none !important;
  z-index: 1 !important;
  box-shadow: inset 0 -140px 0px -140px #000,
              inset 0 -140px 0px -90px #000 !important;
  transition: all 0.7s ease-in-out !important;
}

.tour-highlight-selector__option.is-active .tour-highlight-selector__shade {
  bottom: 0 !important;
  box-shadow: inset 0 -140px 140px -140px #000,
              inset 0 -140px 140px -90px #000 !important;
}

/* --- Altitude Meta --- */
.tour-highlight-selector__meta {
  position: absolute !important;
  top: 1rem !important;
  left: 1rem !important;
  z-index: 2 !important;
  display: flex !important;
  gap: .4rem !important;
}

.tour-highlight-selector__number {
  display: none !important;
}

.tour-highlight-selector__altitude {
  display: inline-flex !important;
  align-items: center !important;
  padding: 0.3rem 0.6rem !important;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: 0.65rem !important;
  font-weight: 750 !important;
  color: #fff !important;
  background: rgba(32, 32, 32, 0.85) !important;
  border: 1px solid #444 !important;
  border-radius: 999px !important;
}

/* --- Text & Content --- */
.tour-highlight-selector__copy {
  position: absolute !important;
  left: 1.25rem !important;
  right: 1.25rem !important;
  bottom: 1.25rem !important;
  z-index: 2 !important;
  pointer-events: none !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  gap: 0.25rem !important;
  width: calc(100% - 2.5rem) !important;
  max-width: 100% !important;
}

.tour-highlight-selector__copy strong {
  color: #ffffff !important;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  opacity: 0 !important;
  transform: translateX(25px) !important;
  transition: opacity 0.7s ease-in-out,
              transform 0.7s ease-in-out !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.tour-highlight-selector__copy > span {
  color: #d1d5db !important;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: 0.88rem !important;
  line-height: 1.4 !important;
  opacity: 0 !important;
  transform: translateX(25px) !important;
  transition: opacity 0.7s ease-in-out,
              transform 0.7s ease-in-out !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.tour-highlight-selector__copy small {
  display: inline-block !important;
  margin-top: 0.2rem !important;
  padding: 0.2rem 0.45rem !important;
  color: #fff2c9 !important;
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  background: rgba(201, 146, 62, 0.3) !important;
  border-radius: 4px !important;
  width: fit-content !important;
  opacity: 0 !important;
  transform: translateX(25px) !important;
  transition: opacity 0.7s ease-in-out,
              transform 0.7s ease-in-out !important;
}

/* PC Active Text */
.tour-highlight-selector__option.is-active .tour-highlight-selector__copy strong {
  opacity: 1 !important;
  transform: translateX(0) !important;
  white-space: normal !important;
  word-break: break-word !important;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem) !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  width: 100% !important;
}

.tour-highlight-selector__option.is-active .tour-highlight-selector__copy > span {
  opacity: 1 !important;
  transform: translateX(0) !important;
  white-space: normal !important;
  word-break: break-word !important;
  font-size: 0.86rem !important;
  line-height: 1.4 !important;
  width: 100% !important;
}

.tour-highlight-selector__option.is-active .tour-highlight-selector__copy small {
  opacity: 1 !important;
  transform: translateX(0) !important;
}

/* =============================================
   GIAO DIỆN MOBILE & TABLET (<= 1024px)
   ============================================= */

@media (max-width: 1024px) {
  .tour-highlight-selector {
    padding: 2rem 0.5rem !important;
  }

  .tour-highlight-selector__heading {
    margin-bottom: 1rem !important;
  }

  .tour-highlight-selector__heading h2 {
    font-size: clamp(1.5rem, 5.5vw, 2.2rem) !important;
  }

  .tour-highlight-selector [data-is-clone="true"] {
    display: flex !important;
  }

  .tour-highlight-selector__shade {
    display: none !important;
  }

  .tour-highlight-selector__altitude {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(18, 18, 18, 0.82) !important;
  }

  .tour-highlight-selector__toolbar {
    margin-bottom: 0.5rem !important;
  }

  /* Khung cuộn mượt tự nhiên 1:1 */
  .tour-highlight-selector__options {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    height: 380px !important;
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: none !important;
    scroll-behavior: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 12px !important;
    padding: 1rem calc(50% - 100px) !important;
    scrollbar-width: none !important;
  }

  .tour-highlight-selector__options::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  /* Thẻ ảnh cố định 200px */
  .tour-highlight-selector__option {
    flex: 0 0 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    height: 300px !important;
    border-radius: 14px !important;
    border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
    background-color: #18181b !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
    opacity: 0.55 !important;
    transform: scale(0.98) !important;
    transform-origin: center center !important;
    will-change: transform, opacity !important;
    transition: transform 0.55s ease-in-out,
                opacity 0.55s ease-in-out,
                border-color 0.5s ease-in-out,
                box-shadow 0.55s ease-in-out !important;
  }

  /* Thẻ active ở giữa tâm màn hình */
  .tour-highlight-selector__option.is-active {
    opacity: 1 !important;
    transform: scale(1) !important;
    border-color: #ffffff !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
    z-index: 10 !important;
  }

  /* Fill the mobile card edge-to-edge; a small crop is preferable to black bars. */
  .tour-highlight-selector__option.is-portrait.is-active .tour-highlight-selector__image {
    object-fit: cover !important;
    transform: scale(1.01) !important;
  }

  .tour-highlight-selector__copy {
    left: 0.75rem !important;
    right: 0.75rem !important;
    bottom: 0.75rem !important;
    width: calc(100% - 1.5rem) !important;
  }

  .tour-highlight-selector__copy strong {
    font-size: 0.95rem !important;
    line-height: 1.25 !important;
  }

  .tour-highlight-selector__copy > span {
    font-size: 0.78rem !important;
    line-height: 1.35 !important;
  }
}
.tour-highlight-selector__option[aria-haspopup="dialog"] {
  cursor: zoom-in;
}

html.tour-highlight-lightbox-open,
html.tour-highlight-lightbox-open body {
  overflow: hidden !important;
}

.tour-highlight-lightbox,
.tour-highlight-lightbox * {
  box-sizing: border-box;
}

.tour-highlight-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: clamp(12px, 2vw, 28px);
  color: #123b32;
  background: transparent;
}

.tour-highlight-lightbox[open] {
  display: grid;
  place-items: center;
}

.tour-highlight-lightbox::backdrop {
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.8), transparent 36%),
    rgba(225, 238, 235, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tour-highlight-lightbox__panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  width: min(1440px, 100%);
  height: 100%;
  min-height: 0;
}

.tour-highlight-lightbox__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: env(safe-area-inset-top, 0px);
}

.tour-highlight-lightbox__header strong {
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.tour-highlight-lightbox__close,
.tour-highlight-lightbox__arrow {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(31, 90, 73, 0.16);
  border-radius: 50%;
  background: #eef4f1;
  color: #123b32;
  font: 32px/1 sans-serif;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.tour-highlight-lightbox__close:hover,
.tour-highlight-lightbox__close:focus-visible,
.tour-highlight-lightbox__arrow:hover,
.tour-highlight-lightbox__arrow:focus-visible {
  color: #17332d;
  background: #e8bd52;
}

.tour-highlight-lightbox__close:focus-visible,
.tour-highlight-lightbox__arrow:focus-visible {
  outline: 2px solid #1f5a49;
  outline-offset: 3px;
}

.tour-highlight-lightbox__stage {
  position: relative;
  min-height: 0;
  padding-inline: 64px;
}

.tour-highlight-lightbox__arrow {
  position: absolute;
  z-index: 1;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 38px;
  box-shadow: 0 6px 24px rgba(14, 47, 39, 0.15);
}

.tour-highlight-lightbox__arrow[hidden] {
  display: none;
}

.tour-highlight-lightbox__arrow--previous { left: 0; }
.tour-highlight-lightbox__arrow--next { right: 0; }

.tour-highlight-lightbox__image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.tour-highlight-lightbox__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 16px;
  min-height: 1.5em;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  text-align: center;
  color: #3e6258;
  font-size: 14px;
}

.tour-highlight-lightbox__status { margin: 0; }
.tour-highlight-lightbox__status:empty { display: none; }
.tour-highlight-lightbox__counter { font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  .tour-highlight-lightbox__stage { padding-inline: 0; }
  .tour-highlight-lightbox__arrow { width: 44px; height: 44px; background: rgba(238, 244, 241, 0.94); }
  .tour-highlight-lightbox__arrow--previous { left: 4px; }
  .tour-highlight-lightbox__arrow--next { right: 4px; }
}

.tour-highlight-selector__option:focus-visible,
.tour-highlight-selector__toolbar button:focus-visible {
  outline: 2px solid rgba(23, 51, 45, .82) !important;
  outline-offset: 3px !important;
}

@media (prefers-reduced-motion: reduce) {
  .tour-highlight-selector__option,
  .tour-highlight-selector__image,
  .tour-highlight-selector__copy strong,
  .tour-highlight-selector__copy > span,
  .tour-highlight-selector__copy small,
  .tour-highlight-selector__toolbar button {
    transition: none !important;
  }

  .tour-highlight-selector__options {
    scroll-behavior: auto !important;
  }
}
