/* =========================================================
   trip-card.css — аяллын карт (Tours хуудас ба нүүр хуудасны эгнээ)
   Зураг + ♥ Save, нэр, Destination / Duration, What to expect, From үнэ + See trip, "See N departure dates"
   Мөн departure-уудын цонх, "Log in or sign up" цонх (tour-dates.js)
   ========================================================= */
.journey-card {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid #e6e8df;
  border-radius: 18px;
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h) + 16px);
  transition: transform 0.25s, box-shadow 0.25s;
}
.journey-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(31, 35, 35, 0.1); }
.journey-card[hidden] { display: none; }
/* Дэлгэрэнгүй хуудастай аялал: карт бүхэлдээ дарагдана */
.journey-card { position: relative; }
.journey-link { color: inherit; text-decoration: none; }
.journey-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.journey-card:has(.journey-link) { cursor: pointer; }
.journey-media { position: relative; overflow: hidden; }
.journey-media img {
  display: block;
  width: 100%; height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.journey-card:hover .journey-media img { transform: scale(1.04); }
.journey-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 5px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 0.72rem; font-weight: 700;
  color: var(--charcoal);
}
.journey-badge:empty { display: none; }
.jc-heart {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.15s;
}
.jc-heart:hover { transform: scale(1.08); }
.jc-heart svg { width: 21px; height: 21px; fill: none; stroke: var(--charcoal); stroke-width: 1.9; stroke-linejoin: round; transition: fill 0.15s, stroke 0.15s; }
.jc-heart.is-on svg { fill: #E0454F; stroke: #E0454F; }
.jc-heart[aria-busy="true"] { opacity: 0.6; }
.journey-body { display: flex; flex-direction: column; flex: 1; padding: 12px 14px 10px; }
.journey-body h3 { margin: 0 0 4px; font-size: 1rem; line-height: 1.28; color: var(--charcoal); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.journey-meta { margin-bottom: 14px; color: #6b7070; font-size: 0.88rem; }
.jc-buy { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.jc-price { display: grid; line-height: 1.15; }
.jc-price small { font-size: 0.72rem; color: #6b7070; }
.jc-price strong { font-size: 1.22rem; color: var(--altai-forest); }
.jc-see { position: relative; z-index: 2; flex: none; padding: 9px 18px; min-height: 0; font-size: 0.9rem; border-radius: 10px; }
.jc-foot { padding: 0 14px 12px; }
.jc-dates, .jc-flex {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin: 0; padding: 8px 12px;
  border: 1px solid #dcdfd5; border-radius: 10px;
  background: #fff;
  font: inherit; font-size: 0.85rem; color: var(--charcoal);
}
.td-dates-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jc-dates { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.jc-dates:hover { border-color: var(--altai-forest); background: #f4f7f2; }
.jc-dates[hidden], .jc-flex[hidden] { display: none; }
.jc-flex { border-style: dashed; color: #6b7070; }
.jc-dates svg, .jc-flex svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* ===== Departure dates цонх (tour-dates.js) ===== */
html.td-lock { overflow: hidden; }
.td-modal, .td-auth {
  padding: 0; border: 0; background: transparent; color: var(--charcoal);
  max-width: none; max-height: none;
}
/* Дэлгэцийн голд, 4 талдаа зайтай */
.td-modal[open], .td-auth[open] { position: fixed; inset: 0; margin: auto; width: fit-content; height: fit-content; }
.td-modal::backdrop, .td-auth::backdrop { background: rgba(18, 24, 20, 0.55); backdrop-filter: blur(2px); }
.td-modal-box {
  display: flex; flex-direction: column;
  width: min(1060px, calc(100vw - 32px));
  max-height: calc(100dvh - 64px);
  border-radius: 18px; background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.td-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid #eceee6; }
.td-modal-head h2 { margin: 0; font-size: 1.3rem; line-height: 1.3; }
.td-modal-sub { margin: 4px 0 0; color: #6b7070; font-size: 0.9rem; }
.td-x { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f2f3ee; cursor: pointer; }
.td-x:hover { background: #e6e9e0; }
.td-x svg { width: 18px; height: 18px; fill: none; stroke: var(--charcoal); stroke-width: 2; stroke-linecap: round; }
.td-modal-body { padding: 8px 24px 24px; overflow-y: auto; overscroll-behavior: contain; outline: none; }
.td-loading { padding: 32px 0; text-align: center; color: #6b7070; }
.td-loading a { color: var(--altai-forest); font-weight: 700; }
.td-month + .td-month { margin-top: 10px; }
.td-month:first-child { margin-top: 16px; }
.td-month-bar {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  list-style: none; cursor: pointer; user-select: none;
  padding: 12px 16px;
  border-radius: 8px; background: var(--charcoal, #1f2323); color: #fff;
  font-size: 0.85rem; font-weight: 700;
}
.td-dep {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center;
  margin-bottom: 12px; padding: 18px 20px;
  border: 1px solid #e3e6dc; border-radius: 14px; background: #fff;
}
.td-dep.is-full { background: #fafaf8; }
.td-dep-main { display: grid; grid-template-columns: 64px minmax(0, 1fr) 200px; gap: 16px; align-items: center; }
.td-day { display: grid; text-align: center; line-height: 1; }
.td-day b { font-size: 2rem; }
.td-day span { margin-top: 4px; font-size: 0.9rem; letter-spacing: 0.06em; text-transform: uppercase; color: #6b7070; }
.td-range { display: flex; align-items: flex-start; gap: 12px; }
.td-range > div { display: grid; }
.td-range strong { font-size: 1rem; }
.td-range small { color: #6b7070; font-size: 0.85rem; }
.td-cal svg { width: 20px; height: 20px; fill: none; stroke: #6b7070; stroke-width: 1.7; }
.td-to { padding-top: 4px; }
.td-to svg { width: 36px; height: 12px; fill: none; stroke: #9aa09a; stroke-width: 1.4; stroke-linecap: round; }
.td-status { display: flex; align-items: flex-start; gap: 10px; }
.td-status svg { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.td-status div { display: grid; }
.td-status strong { font-size: 0.92rem; color: var(--charcoal); }
.td-status small { font-size: 0.8rem; }
.td-status.is-open { color: #2f6fd6; }
.td-status.is-sure { color: var(--altai-forest); }
.td-status.is-hot { color: #d9363e; }
.td-status.is-hot svg { fill: rgba(217, 54, 62, 0.15); }
.td-status.is-full { color: #8a908c; }
.td-dep-buy { display: grid; grid-template-columns: auto 150px; gap: 10px 12px; align-items: center; }
.td-price { display: grid; text-align: right; line-height: 1.15; }
.td-price small { font-size: 0.75rem; color: #6b7070; }
.td-price strong { font-size: 1.45rem; }
.td-see { display: flex; justify-content: center; padding: 12px 18px; border-radius: 10px; font-size: 0.95rem; }
.td-see.is-disabled { background: #eceee6; color: #8a908c; border-color: #eceee6; cursor: default; }
.td-dep-tools { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.td-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 12px; border: 1px solid #d5d9ce; border-radius: 10px; background: #fff;
  font: inherit; font-size: 0.9rem; color: var(--charcoal); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.td-btn:hover { border-color: var(--charcoal); }
.td-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.td-btn.is-on { border-color: var(--altai-forest); background: #f1f6ee; color: var(--altai-forest); }
.td-btn-save.is-on svg { fill: #E0454F; stroke: #E0454F; }
.td-btn-notify.is-on svg { fill: currentColor; }
.td-btn[aria-busy="true"] { opacity: 0.6; }
.td-dep.is-full .td-btn-notify { border-color: var(--altai-forest); color: var(--altai-forest); }

@media (max-width: 860px) {
  .td-dep { grid-template-columns: 1fr; gap: 14px; }
  .td-dep-main { grid-template-columns: 56px minmax(0, 1fr); }
  .td-status { grid-column: 2; }
  .td-dep-buy { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); padding-top: 14px; border-top: 1px solid #eceee6; }
  .td-price { text-align: left; }
}
@media (max-width: 560px) {
  .td-modal-box { width: calc(100vw - 24px); max-height: calc(100dvh - 32px); border-radius: 16px; }
  .td-modal-head { padding: 16px; }
  .td-modal-body { padding: 4px 12px 24px; }
  .td-dep { padding: 14px; }
  .td-day b { font-size: 1.6rem; }
  .td-range { gap: 8px; flex-wrap: wrap; }
  .td-cal { display: none; }
  .td-to svg { width: 22px; }
  .td-range strong { font-size: 0.92rem; }
}

.td-month-bar::-webkit-details-marker { display: none; }
.td-month-n { display: flex; align-items: center; gap: 8px; font-weight: 500; opacity: 0.85; }
.td-month-n svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform 0.2s; }
.td-month[open] .td-month-n svg { transform: rotate(180deg); }
.td-month-list { padding-top: 12px; }
.td-single { padding-top: 16px; }

/* "Log in or sign up" цонх */
.td-auth-box {
  position: relative; display: grid; gap: 12px;
  width: min(420px, calc(100vw - 32px)); padding: 28px 24px 22px;
  border-radius: 18px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}
.td-auth-box .td-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; background: none; }
.td-auth-title { margin: 0 28px 6px 0; font-size: 1.3rem; line-height: 1.35; }
.td-auth-google { display: grid; gap: 8px; }
.td-auth-google[hidden], .td-auth-or[hidden] { display: none; }
.td-auth-gsi { display: flex; justify-content: center; min-height: 44px; }
.td-auth-gbtn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px; border: 1px solid #d5d9ce; border-radius: 10px;
  color: var(--charcoal); font-weight: 700; text-decoration: none;
}
.td-auth-gbtn[hidden] { display: none; }
.td-auth-gbtn:hover { border-color: var(--charcoal); }
.td-auth-or { display: flex; align-items: center; gap: 12px; color: #8a908c; font-size: 0.85rem; }
.td-auth-or::before, .td-auth-or::after { content: ""; flex: 1; height: 1px; background: #e3e6dc; }
.td-auth-label { font-weight: 700; font-size: 0.92rem; }
.td-auth-email { width: 100%; padding: 12px 14px; border: 1px solid #c9cdc2; border-radius: 10px; font: inherit; }
.td-auth-email:focus { outline: 2px solid var(--altai-forest); outline-offset: 1px; }
.td-auth-go { width: 100%; justify-content: center; padding: 13px; border-radius: 10px; }
.td-auth-terms { margin: 4px 0 0; font-size: 0.78rem; color: #6b7070; line-height: 1.5; }
.td-auth-terms a { color: inherit; text-decoration: underline; }

.td-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 2000;
  padding: 12px 18px; border-radius: 12px;
  background: var(--charcoal, #1f2323); color: #fff; font-size: 0.92rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.td-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Карт: Destination, Duration, What to expect гарчгууд */
.jc-facts { display: flex; flex-wrap: wrap; gap: 0 12px; margin: 0 0 6px; font-size: 0.82rem; line-height: 1.45; }
.jc-facts div { display: flex; gap: 5px; }
.jc-facts dt { font-weight: 700; color: var(--charcoal); }
.jc-facts dd { margin: 0; color: #5b6060; }
.jc-expect { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 0; font-size: 0.8rem; color: #5b6060; }
.jc-expect li { position: relative; padding-left: 13px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jc-expect li::before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 5px; height: 5px; border-radius: 50%; background: var(--sand-gold, #C9A24B); }

/* Нүүр хуудасны эгнээ (tours-carousel) */
.tours-track > .journey-card { flex: 0 0 calc((100% - 32px) / 3); scroll-snap-align: start; }
.tours-track > .journey-card:hover { transform: none; }
@media (max-width: 1024px) { .tours-track > .journey-card { flex-basis: calc((100% - 16px) / 2.2); } }
@media (max-width: 760px) { .tours-track > .journey-card { flex-basis: 84%; } }

/* Нүүр хуудасны Mongolia / Central Asia эгнээ: хоёр тал руу өргөн, гарчиг зүүн талд (компьютер) */
[data-tours-region] > .container { width: min(1280px, 100% - 48px); }
@media (min-width: 761px) {
  [data-tours-region] .section-head { text-align: left; margin-bottom: 24px; }
  [data-tours-region] .section-head p { margin: 0; }
}
@media (max-width: 760px) {
  [data-tours-region] > .container { width: min(1480px, 100% - 32px); }
}
[data-tours-region] .carousel-btn.prev { left: -14px; }
[data-tours-region] .carousel-btn.next { right: -14px; }
