/* ================================================================
   Trip Builder page
   ================================================================ */
.tb {
  background: #fbf6ee;
  color: #123642;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  min-height: 100vh;
}

/* The [hidden] attribute must always win over component display rules. */
.tb [hidden] { display: none !important; }

/* ── Hero ── */
.tb-hero {
  margin-top: 68px;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.5rem, 7vw, 6.5rem) clamp(2.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid rgba(18, 54, 66, 0.1);
  background: linear-gradient(170deg, #f3ece0 0%, #fbf6ee 50%, #fff 100%);
}
.tb-hero-inner { max-width: 640px; }
.tb-hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #ef7b45;
  margin-bottom: 0.85rem;
}
.tb-hero-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2rem, 5.5vw, 3.8rem);
  font-weight: 400;
  line-height: 1.05;
  color: #123642;
  margin: 0 0 1rem;
}
.tb-hero-sub {
  font-size: clamp(0.92rem, 1.3vw, 1.05rem);
  font-weight: 300;
  line-height: 1.65;
  color: #5c7680;
}

/* ── Workspace (two-column) ── */
.tb-workspace {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 6vw, 5rem) clamp(5rem, 7vw, 6rem);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

/* ── Route of steps (signature): numbered stops on a dashed route line ── */
.tb-step {
  position: relative;
  padding: 0 0 clamp(1.75rem, 3vw, 2.5rem) 3.1rem;
  scroll-margin-top: 84px;
}
.tb-step:last-child { padding-bottom: 0; }
.tb-step::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 42px;
  bottom: 4px;
  border-left: 2px dashed rgba(18, 54, 66, 0.22);
}
.tb-step:last-child::before { display: none; }
.tb-step-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1rem;
  background: #fff;
  border: 2px solid #ef7b45;
  color: #08415c;
  box-shadow: 0 0 0 5px #fbf6ee;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.tb-step-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  min-height: 36px;
  margin-bottom: 1rem;
}
.tb-step-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 500;
  color: #123642;
  margin: 0;
}
.tb-step-hint {
  display: none;
  font-size: 0.78rem;
  font-weight: 400;
  color: #7a6e5f;
}
.tb-step--locked .tb-step-body { display: none; }
.tb-step--locked .tb-step-hint { display: inline; }
.tb-step--locked .tb-step-marker {
  background: #f3ece0;
  border-color: #d0c8bc;
  color: #9aa8ae;
}
.tb-step--locked .tb-step-title { color: #9aa8ae; }
.tb-step--done .tb-step-marker {
  background: #2fb6ae;
  border-color: #2fb6ae;
  color: #fff;
}
.tb-step:not(.tb-step--locked) .tb-step-body {
  animation: tb-rise 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes tb-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Card blocks ── */
.tb-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
}
.tb-card:last-child { margin-bottom: 0; }
.tb-field-gap { margin-top: 1.1rem; }

.tb-section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: #123642;
  margin: 0 0 1rem;
}

/* ── Input ── */
.tb-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5c7680;
  margin-bottom: 0.5rem;
}
.tb-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d0c8bc;
  border-radius: 8px;
  font-size: 1.05rem;
  font-family: inherit;
  background: #fbf6ee;
  color: #123642;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.tb-input:focus { border-color: #1c6e8c; }

/* ── Destination grid ── */
.tb-dest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.tb-dest-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  border: 2px solid transparent;
  background: #123642;
  padding: 0;
  transition: border-color 0.25s, transform 0.2s;
  font-family: inherit;
  outline: none;
}
.tb-dest-card:hover { transform: translateY(-2px); }
.tb-dest-card:focus-visible { border-color: #1c6e8c; outline: none; }
.tb-dest-card--active { border-color: #ef7b45; transform: translateY(-2px); }
.tb-dest-bg {
  position: absolute;
  inset: 0;
}
.tb-dest-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  transition: opacity 0.4s, transform 0.6s;
}
.tb-dest-card:hover .tb-dest-img,
.tb-dest-card--active .tb-dest-img { opacity: 0.4; transform: scale(1.05); }
.tb-dest-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18, 54, 66, 0.92) 0%, rgba(18, 54, 66, 0.1) 55%);
}
.tb-dest-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.1rem;
}
.tb-dest-name {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 0.2rem;
}
.tb-dest-blurb {
  font-size: 0.72rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Gallery header ── */
.tb-gallery-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.tb-back-btn {
  font-size: 0.78rem;
  font-weight: 500;
  color: #1c6e8c;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.tb-back-btn:hover { color: #123642; }

/* ── Gallery subheadings: quiet uppercase tags with a trailing rule ── */
.tb-gallery-subhead {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #1c6e8c;
  margin: 1.6rem 0 0.85rem;
}
.tb-gallery-subhead::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(18, 54, 66, 0.12);
}
.tb-gallery-subhead:first-of-type { margin-top: 0; }

/* ── Toggle button ── */
.tb-toggle {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid #1c6e8c;
  border-radius: 999px;
  background: #fff;
  color: #1c6e8c;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tb-toggle:hover { background: #eef6f9; }
.tb-toggle--added {
  background: #1c6e8c;
  color: #fff;
  border-color: #1c6e8c;
}
.tb-toggle--added:hover { background: #08415c; border-color: #08415c; }

/* ── Origin buttons ── */
.tb-origin-options {
  display: flex;
  gap: 0.75rem;
}
.tb-origin-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 2px solid #d0c8bc;
  border-radius: 8px;
  background: #fff;
  color: #123642;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.tb-origin-btn:hover { border-color: #1c6e8c; }
.tb-origin-btn--active {
  background: #1c6e8c;
  color: #fff;
  border-color: #1c6e8c;
}
#tb-origin-other-wrap { margin-top: 1rem; }

/* ── Destination region / sub-region filter tabs ── */
.tb-dest-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.tb-dest-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}
.tb-dest-subgroup { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tb-dest-tab, .tb-dest-chip {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: #123642;
  background: #fff;
  border: 1px solid #d0c8bc;
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.tb-dest-chip { font-size: 0.74rem; padding: 0.4rem 0.85rem; }
.tb-dest-tab:hover, .tb-dest-chip:hover { border-color: #1c6e8c; }
.tb-dest-tab--active, .tb-dest-chip--active {
  background: #1c6e8c;
  color: #fff;
  border-color: #1c6e8c;
}
.tb-dest-locked-label {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 500;
  color: #fff;
  background: #1c6e8c;
  border: 1px solid #1c6e8c;
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  margin-bottom: 0.75rem;
}

/* ── Origin summary ── */
.tb-summary-origin {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: #f8f6f2;
  border-radius: 8px;
}

/* ── Empty state ── */
.tb-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #5c7680;
  font-size: 0.9rem;
}

/* ── Trip ticket (summary sidebar) ── */
.tb-summary {
  position: sticky;
  top: 88px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 18px 40px -28px rgba(8, 65, 92, 0.45);
}
.tb-summary-head {
  position: relative;
  background: #08415c;
  padding: 1.15rem 1.6rem 1.35rem;
}
.tb-summary-eyebrow {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #6fd7ce;
  margin-bottom: 0.3rem;
}
.tb-summary-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: #fff;
  margin: 0;
}
/* Ticket notches at the tear line (clipped by the card's overflow) */
.tb-summary-head::before,
.tb-summary-head::after {
  content: "";
  position: absolute;
  bottom: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fbf6ee;
  z-index: 1;
}
.tb-summary-head::before { left: -9px; }
.tb-summary-head::after { right: -9px; }
.tb-summary-body {
  position: relative;
  padding: 1.4rem 1.6rem 1.6rem;
}
.tb-summary-body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  border-top: 2px dashed rgba(18, 54, 66, 0.16);
}
.tb-summary-departure,
.tb-summary-dest {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: #f8f6f2;
  border-radius: 8px;
}
.tb-sum-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a6e5f;
  margin-bottom: 0.2rem;
}
.tb-sum-value {
  font-size: 0.92rem;
  font-weight: 500;
  color: #123642;
}
.tb-sum-items {
  margin: 1.25rem 0;
}
.tb-sum-empty {
  font-size: 0.82rem;
  color: #7a6e5f;
  text-align: center;
  padding: 1.5rem 0.5rem;
}
.tb-sum-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.tb-sum-item:last-child { border-bottom: none; }
.tb-sum-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #eef1f3;
}
.tb-sum-info { flex: 1; min-width: 0; }
.tb-sum-item-desc {
  font-size: 0.8rem;
  font-weight: 400;
  color: #123642;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tb-sum-remove {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #e0d8ce;
  background: #fff;
  color: #7a6e5f;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
  font-family: inherit;
}
.tb-sum-remove:hover { color: #c62828; border-color: #c62828; }

/* ── CTA ── */
.tb-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  background: #ef7b45;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 12px 28px -10px rgba(239, 123, 69, 0.65);
  transition: transform 0.3s, box-shadow 0.3s, background 0.25s;
  box-sizing: border-box;
  margin-top: 1rem;
}
.tb-cta:hover {
  transform: translateY(-3px);
  background: #f2884f;
  box-shadow: 0 18px 34px -10px rgba(239, 123, 69, 0.7);
}
.tb-cta svg { transition: transform 0.3s; }
.tb-cta:hover svg { transform: translateX(4px); }

/* ── Focus visibility ── */
.tb-origin-btn:focus-visible,
.tb-toggle:focus-visible,
.tb-back-btn:focus-visible,
.tb-timeline-back:focus-visible,
.tb-sum-remove:focus-visible,
.tb-cta:focus-visible {
  outline: 3px solid #2fb6ae;
  outline-offset: 2px;
}

/* ── Responsive ── */
@media (max-width: 800px) {
  .tb-workspace { grid-template-columns: 1fr; }
  .tb-summary { position: static; }
}
@media (max-width: 560px) {
  .tb-dest-grid { grid-template-columns: repeat(2, 1fr); }
  /* At 2-up width, a wrapped 2-line name + 2-line blurb can exceed the card's
     fixed aspect-ratio height and get clipped by overflow:hidden — drop the
     blurb here so the name always has room. */
  .tb-dest-blurb { display: none; }
  /* "Nội địa" / "Quốc tế" wrap to 2 lines at narrow widths with the default
     padding — tighten so both stay on one line. */
  .tb-origin-options { gap: 0.5rem; }
  .tb-origin-btn { flex: 1; padding: 0.7rem 0.5rem; font-size: 0.85rem; text-align: center; white-space: nowrap; }
  .tb-step { padding-left: 2.6rem; }
  .tb-step-marker { width: 30px; height: 30px; font-size: 0.85rem; }
  .tb-step::before { left: 14px; top: 36px; }
}

/* ── A11Y — reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .tb *,
  .tb *::before,
  .tb *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── Tour cards ── */
.tb-tour-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 1rem;
}
.tb-tour-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 16 / 10;
  cursor: pointer;
  border: 2px solid transparent;
  background: #123642;
  padding: 0;
  transition: border-color 0.25s, transform 0.2s;
  font-family: inherit;
  outline: none;
}
.tb-tour-card:hover { transform: translateY(-2px); }
.tb-tour-card:focus-visible { border-color: #1c6e8c; outline: none; }
.tb-tour-card--active { border-color: #ef7b45; transform: translateY(-2px); }
.tb-tour-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  transition: opacity 0.4s, transform 0.6s;
}
.tb-tour-card:hover .tb-tour-img,
.tb-tour-card--active .tb-tour-img { opacity: 0.35; transform: scale(1.05); }
.tb-tour-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.85rem 1rem;
  z-index: 1;
}
.tb-tour-name {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1rem;
  font-weight: 400;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 0.2rem;
}
.tb-tour-duration {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Tour timeline ── */
.tb-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(18, 54, 66, 0.1);
}
.tb-timeline-back {
  font-size: 0.78rem;
  font-weight: 500;
  color: #1c6e8c;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.tb-timeline-back:hover { color: #123642; }
.tb-timeline-day {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(18, 54, 66, 0.06);
}
.tb-timeline-day:last-child { border-bottom: none; }
.tb-timeline-thumb {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #eef1f3;
}
.tb-timeline-body { flex: 1; min-width: 0; }
.tb-timeline-daynum {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ef7b45;
  margin-bottom: 0.3rem;
}
.tb-timeline-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1rem;
  font-weight: 500;
  color: #123642;
  margin: 0 0 0.4rem;
}
.tb-timeline-desc {
  font-size: 0.82rem;
  color: #5c7680;
  line-height: 1.55;
  margin: 0 0 0.45rem;
}
.tb-desc > :last-child { margin-bottom: 0; }
.tb-timeline-list {
  margin: 0 0 0.45rem;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: #5c7680;
  line-height: 1.55;
}
.tb-timeline-list li { margin-bottom: 0.2rem; }
.tb-timeline-list li::marker { color: #2fb6ae; }
.tb-desc--clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tb-desc-toggle {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1c6e8c;
  cursor: pointer;
}
.tb-desc-toggle:hover { color: #08415c; }
.tb-desc-toggle:focus-visible { outline: 3px solid #2fb6ae; outline-offset: 2px; }

@media (max-width: 560px) {
  .tb-timeline-day { flex-direction: column; }
  .tb-timeline-thumb { width: 100%; height: auto; aspect-ratio: 16/9; }
}

/* ── Destination page tours section ── */
.dst-tours {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 6vw, 5rem) clamp(4.5rem, 8vw, 7rem);
}
.dst-tours-toggle {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 2px solid #1c6e8c;
  border-radius: 8px;
  background: #fff;
  color: #1c6e8c;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  margin-bottom: 1.25rem;
}
.dst-tours-toggle:hover {
  background: #eef6f9;
}
.dst-tour-main {
  display: block;
  margin-top: 2rem;
}
