/* Flights tab */
.flt-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr) repeat(2, 0.8fr) repeat(2, 0.8fr);
  gap: .7rem;
  align-items: end;
}
.flt-field { display: flex; flex-direction: column; position: relative; }
.flt-field label {
  font-size: .72rem; font-weight: 600; color: #555;
  text-transform: uppercase; letter-spacing: .03em; margin-bottom: .25rem;
}
.flt-field input, .flt-field select {
  padding: .55rem .6rem; border: 1px solid #ccc; border-radius: 6px;
  font-size: .9rem; font-family: inherit; background: #fff; width: 100%;
}
.flt-field input:focus, .flt-field select:focus { outline: none; border-color: #6ab04c; }

.flt-controls {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: .9rem; gap: 1rem; flex-wrap: wrap;
}
.flt-oneway { font-size: .9rem; color: #333; display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.flt-oneway input { width: auto; }

/* Autocomplete */
.flt-ac {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
  background: #fff; border: 1px solid #ccc; border-top: none;
  border-radius: 0 0 6px 6px; box-shadow: 0 6px 16px rgba(0,0,0,.12);
  display: none; max-height: 280px; overflow-y: auto;
}
.flt-ac.open { display: block; }
.flt-ac-item {
  padding: .5rem .6rem; cursor: pointer; display: flex; align-items: baseline; gap: .55rem;
  border-bottom: 1px solid #f0f0f0;
}
.flt-ac-item:last-child { border-bottom: none; }
.flt-ac-item:hover, .flt-ac-item.active { background: #eef6e8; }
.flt-ac-code { font-weight: 700; color: #2d5a1b; font-size: .82rem; min-width: 2.4rem; }
.flt-ac-name { font-size: .85rem; color: #444; }

/* Result messages */
.flt-msg { padding: 1.2rem; text-align: center; color: #555; font-size: .92rem; }
.flt-loading { color: #2d5a1b; font-weight: 600; }
.flt-err { color: #b03a2e; }
.flt-results-head { margin: 1rem 0 .6rem; font-size: .85rem; color: #666; font-weight: 600; }

/* Airline filter bar */
.flt-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .9rem; }
.flt-filter-label { font-size: .75rem; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: .03em; margin-right: .2rem; }
.flt-pill {
  font-family: inherit; font-size: .8rem; padding: .32rem .7rem; border-radius: 999px;
  border: 1px solid #cfcfcf; background: #fff; color: #888; cursor: pointer; transition: all .12s;
}
.flt-pill:hover { border-color: #6ab04c; }
.flt-pill.active { background: #eef6e8; border-color: #6ab04c; color: #2d5a1b; font-weight: 600; }
.flt-pill-all {
  font-family: inherit; font-size: .78rem; padding: .32rem .6rem; border-radius: 999px;
  border: 1px dashed #bbb; background: transparent; color: #666; cursor: pointer; margin-left: .2rem;
}
.flt-pill-all:hover { border-color: #6ab04c; color: #2d5a1b; }

/* Offer card */
.flt-card {
  background: #fff; border: 1px solid #e3e3e3; border-radius: 10px;
  padding: 1rem 1.1rem; margin-bottom: .85rem; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.flt-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.flt-airline { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: #222; font-size: .95rem; }
.flt-logo { width: 26px; height: 26px; object-fit: contain; }
.flt-price { font-size: 1.4rem; font-weight: 800; color: #2d5a1b; line-height: 1; text-align: right; }
.flt-price-sub { display: block; font-size: .68rem; font-weight: 500; color: #999; text-transform: uppercase; }

.flt-slice { padding: .55rem 0; border-top: 1px solid #f2f2f2; }
.flt-slice:first-of-type { border-top: none; }
.flt-slice-label { font-size: .7rem; font-weight: 700; color: #6ab04c; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem; }
.flt-slice-row { display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; gap: .6rem; }
.flt-endpoint { text-align: center; }
.flt-time { font-size: 1.05rem; font-weight: 700; color: #222; }
.flt-airport { font-size: .85rem; font-weight: 600; color: #555; }
.flt-date { font-size: .72rem; color: #999; }
.flt-mid { text-align: center; }
.flt-duration { font-size: .78rem; color: #777; margin-bottom: .15rem; }
.flt-line { display: flex; align-items: center; gap: .25rem; }
.flt-track { flex: 1; height: 2px; background: #ccc; }
.flt-dot { width: 7px; height: 7px; border-radius: 50%; background: #6ab04c; flex: none; }
.flt-stops { font-size: .74rem; color: #b07a2e; margin-top: .15rem; }
.flt-stops.nonstop { color: #2d5a1b; }

.flt-card-foot { margin-top: .7rem; text-align: right; }
.flt-book { display: inline-block; text-decoration: none; padding: .5rem 1rem; font-size: .85rem; }
.flt-book-out { display: inline-block; text-decoration: none; padding: .5rem 1rem; font-size: .85rem; }

/* Source badges */
.flt-badge {
  font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: .12rem .45rem; border-radius: 4px; margin-left: .5rem; white-space: nowrap;
}
.flt-badge-instant { background: #eef6e8; color: #2d5a1b; }
.flt-badge-out { background: #eef2f7; color: #4a6585; }
.flt-loading-more { font-size: .76rem; color: #888; font-style: italic; margin-left: .4rem; }

/* Booking modal */
.flt-modal-overlay {
  position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.5);
  display: flex; align-items: flex-start; justify-content: center; padding: 2rem 1rem; overflow-y: auto;
}
.flt-modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 560px;
  box-shadow: 0 12px 40px rgba(0,0,0,.3); overflow: hidden;
}
.flt-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem; border-bottom: 1px solid #eee;
}
.flt-modal-head h3 { margin: 0; font-size: 1.05rem; color: #222; }
.flt-modal-close { background: none; border: none; font-size: 1.6rem; line-height: 1; color: #999; cursor: pointer; }
.flt-modal-body { padding: 1.1rem 1.2rem; }
.flt-note { font-size: .82rem; color: #777; background: #f6f6f2; border-radius: 6px; padding: .55rem .7rem; margin: 0 0 1rem; }

.flt-pax { border: 1px solid #e3e3e3; border-radius: 8px; padding: .7rem .9rem 1rem; margin-bottom: .9rem; }
.flt-pax legend { font-size: .8rem; font-weight: 700; color: #2d5a1b; padding: 0 .4rem; }
.flt-pax-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.flt-pax-grid label { display: flex; flex-direction: column; font-size: .76rem; font-weight: 600; color: #555; gap: .25rem; }
.flt-pax-grid input, .flt-pax-grid select {
  padding: .5rem .55rem; border: 1px solid #ccc; border-radius: 6px; font-size: .9rem; font-family: inherit;
}
.flt-pax-grid input:focus, .flt-pax-grid select:focus { outline: none; border-color: #6ab04c; }
.flt-f-sm { max-width: 100%; }

.flt-modal-msg { font-size: .85rem; margin-top: .5rem; min-height: 1.1rem; }
.flt-modal-foot {
  display: flex; justify-content: flex-end; gap: .6rem;
  padding: .9rem 1.2rem; border-top: 1px solid #eee; background: #fafafa;
}

.flt-confirm { text-align: center; padding: 1rem .5rem; }
.flt-confirm-check { font-size: 2.4rem; }
.flt-confirm h3 { margin: .3rem 0 .8rem; color: #2d5a1b; }
.flt-confirm-ref { font-size: .8rem; color: #777; text-transform: uppercase; letter-spacing: .04em; }
.flt-confirm-ref strong { display: block; font-size: 1.8rem; letter-spacing: .08em; color: #222; margin-top: .2rem; }
.flt-confirm-total { font-weight: 700; color: #222; font-size: 1.05rem; }

/* Right-column Amazon rail (shown on every tab) */
.page-layout { display: flex; gap: 1.25rem; max-width: 1400px; margin: 0 auto; width: 100%; align-items: flex-start; }
.page-layout > main { max-width: none; margin: 0; }
.amazon-rail {
  flex: 0 0 290px; width: 290px; align-self: flex-start;
  position: sticky; top: 1rem; padding: 2rem 1.25rem 2rem 0;
  max-height: calc(100vh - 1.5rem); overflow-y: auto;
}
.amazon-rail .flt-gear { margin-top: 0; border-top: none; padding-top: 0; }
.amazon-rail .flt-gear-grid { grid-template-columns: 1fr; }
.amazon-rail .flt-gear-title { font-size: 1rem; }
.amazon-rail .flt-gear-card { background: rgba(255,255,255,.97); }
@media (max-width: 980px) {
  .page-layout { flex-direction: column; }
  .amazon-rail {
    position: static; width: auto; flex: none; max-height: none;
    padding: 0 1.5rem 2rem; overflow: visible;
  }
  .amazon-rail .flt-gear-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* Travel gear affiliate strip */
.flt-gear:empty { display: none; }
.flt-gear { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid #e8e8e8; }
.flt-gear-title { margin: 0 0 .15rem; font-size: 1.1rem; color: #222; }
.flt-gear-sub { margin: 0 0 1rem; font-size: .85rem; color: #777; }
.flt-gear-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem;
}
.flt-gear-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: .25rem;
  text-decoration: none; background: #fff; border: 1px solid #e3e3e3; border-radius: 10px;
  padding: .8rem .85rem; transition: border-color .12s, transform .12s, box-shadow .12s;
}
.flt-gear-card:hover { border-color: #6ab04c; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.flt-gear-icon { font-size: 1.7rem; line-height: 1; }
.flt-gear-img {
  width: 100%; height: 120px; object-fit: cover; border-radius: 8px;
  background: #f0f0f0; margin-bottom: .15rem; display: block;
}
.flt-gear-name { font-weight: 700; font-size: .88rem; color: #222; }
.flt-gear-blurb { font-size: .76rem; color: #777; line-height: 1.25; flex: 1; }
.flt-gear-btn { margin-top: .4rem; font-size: .78rem; font-weight: 700; color: #2d5a1b; }
.flt-gear-disc { margin: 1rem 0 0; font-size: .72rem; color: #999; font-style: italic; }

@media (max-width: 720px) {
  .flt-form { grid-template-columns: 1fr 1fr; }
  .flt-field-sm { grid-column: span 1; }
  .flt-pax-grid { grid-template-columns: 1fr; }
  .flt-gear-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Auth + Saved ---------- */
.auth-area { display: flex; align-items: center; margin-left: auto; }
.auth-signin-btn {
  font-family: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  background: #6ab04c; color: #fff; border: none; border-radius: 6px; padding: .45rem 1rem;
}
.auth-signin-btn:hover { background: #5a9a40; }
.auth-chip {
  font-family: inherit; font-size: .9rem; cursor: pointer; background: rgba(255,255,255,.15);
  color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 20px; padding: .35rem .8rem;
}
.auth-dropdown {
  position: absolute; right: 1rem; top: 3.4rem; z-index: 200; background: #fff;
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); min-width: 200px; overflow: hidden;
}
.auth-dropdown.hidden { display: none; }
.auth-dd-email { padding: .7rem .9rem; font-size: .8rem; color: #777; border-bottom: 1px solid #eee; word-break: break-all; }
.auth-dd-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: .65rem .9rem; font-size: .9rem; cursor: pointer; color: #333; font-family: inherit; }
.auth-dd-item:hover { background: #eef6e8; }

.auth-modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.55); display: flex; align-items: flex-start; justify-content: center; padding: 4rem 1rem; }
.auth-modal { background: #fff; border-radius: 12px; width: 100%; max-width: 400px; box-shadow: 0 12px 40px rgba(0,0,0,.3); overflow: hidden; }
.auth-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.3rem .4rem; }
.auth-modal-head h3 { margin: 0; font-size: 1.2rem; color: #222; }
.auth-modal-close { background: none; border: none; font-size: 1.7rem; line-height: 1; color: #999; cursor: pointer; }
#auth-form { padding: .5rem 1.3rem 1rem; display: flex; flex-direction: column; gap: .7rem; }
.auth-field { display: flex; flex-direction: column; font-size: .8rem; font-weight: 600; color: #555; gap: .25rem; }
.auth-field input { padding: .6rem .7rem; border: 1px solid #ccc; border-radius: 6px; font-size: .95rem; font-family: inherit; }
.auth-field input:focus { outline: none; border-color: #6ab04c; }
.auth-submit { margin-top: .3rem; padding: .65rem; font-size: .95rem; }
.auth-google-btn { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; padding: .6rem; border: 1px solid #ccc; border-radius: 6px; background: #fff; font-family: inherit; font-size: .92rem; font-weight: 600; color: #444; cursor: pointer; }
.auth-google-btn:hover { background: #f7f7f7; }
.auth-g { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; background: #4285F4; color: #fff; font-weight: 700; font-size: .85rem; }
.auth-or { text-align: center; position: relative; color: #999; font-size: .8rem; margin: .2rem 0; }
.auth-or span { background: #fff; padding: 0 .6rem; position: relative; z-index: 1; }
.auth-or::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #e5e5e5; }
.auth-msg { font-size: .82rem; min-height: 1rem; }
.auth-err { color: #b03a2e; }
.auth-foot { padding: .9rem 1.3rem; border-top: 1px solid #eee; background: #fafafa; font-size: .85rem; color: #666; text-align: center; }
.auth-link { background: none; border: none; color: #2d5a1b; font-weight: 700; cursor: pointer; font-family: inherit; font-size: .85rem; }

.save-search-btn { font-family: inherit; font-size: .85rem; cursor: pointer; background: #fff; color: #b07a2e; border: 1px solid #e0c08a; border-radius: 6px; padding: .5rem .8rem; white-space: nowrap; }
.save-search-btn:hover { background: #fdf6e9; }
.save-search-btn.saved { background: #eef6e8; color: #2d5a1b; border-color: #6ab04c; }

.saved-card { display: flex; align-items: center; justify-content: space-between; gap: .6rem; background: rgba(255,255,255,.97); border: 1px solid #e3e3e3; border-radius: 8px; padding: .8rem 1rem; margin-bottom: .6rem; }
.saved-card-main { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.saved-type { font-size: .68rem; font-weight: 700; color: #2d5a1b; background: #eef6e8; border-radius: 4px; padding: .15rem .45rem; }
.saved-label { font-weight: 600; color: #222; font-size: .92rem; }
.saved-date { font-size: .75rem; color: #999; }
.saved-del { background: none; border: none; cursor: pointer; font-size: 1rem; opacity: .6; }
.saved-del:hover { opacity: 1; }
.saved-empty { color: #777; padding: 1.5rem; text-align: center; }

@media (max-width: 768px) { .auth-dropdown { top: auto; } }

/* ---------- Nav layout with auth area + mobile fixes ---------- */
.topnav-links { flex: 1 1 auto; min-width: 0; }
.auth-area { position: relative; flex: 0 0 auto; margin-left: 1rem; }
/* anchor the user dropdown under the button, independent of nav height */
.auth-dropdown { top: calc(100% + .5rem); right: 0; }

@media (max-width: 768px) {
  /* nav becomes: logo .......... [Sign In] [≡] */
  .topnav-links { top: 130px; flex: none; }       /* match mobile nav height */
  .auth-area { order: 2; margin-left: auto; margin-right: .4rem; }
  .hamburger { order: 3; margin-left: 0; }
  .auth-signin-btn { padding: .4rem .8rem; font-size: .82rem; }
  .auth-chip { padding: .3rem .6rem; font-size: .82rem; }
  /* save button goes full-width in stacked search rows */
  .search-row .save-search-btn, .trails-filters .save-search-btn { width: 100%; }
}
@media (max-width: 480px) {
  .topnav-links { top: 110px; }                    /* match small nav height */
}

/* Make the Amazon rail + flights form comfortable on phones */
@media (max-width: 600px) {
  .amazon-rail .flt-gear-grid { grid-template-columns: 1fr 1fr; }
  .flt-form { grid-template-columns: 1fr 1fr; }
  .flt-controls { flex-direction: column; align-items: stretch; }
  .flt-controls .btn-primary { width: 100%; }
  .auth-modal-overlay { padding: 1.5rem 1rem; }
}
