@import url("../search/SearchTab.css");
@import url("../search/SearchTabTransferModals.css");
@import url("../components/Popups.css");

.transfer-search .sep {
  padding: 0;
  height: auto;
}

.car-search .search_item {
  width: 31.4%;
}

.car-search .sep {
  height: auto;
}

/* Hero: TransferAndCarHirePage.cshtml now reuses Home-v2.css's own real .hero/.hero__media/
   .hero__inner/.hero__copy/.hero__kicker/.hero__lede/.hero__facts (exactly what HomePage.cshtml
   uses) instead of a one-off .th-hero - nothing to add here, it's already .hp2-scoped and shared.
   See that file's own header comment for why. */

/* ============================================================================================
   Car Hire / Transfer search tabs - new design, ported from F:\CyprusParadise-NewDesigns\
   prototypes\car-hire\ and \transfer-only\ (their shared standalone-journey.css's .search-bar/
   .btn rules, plus transfer-only's own .trip-type/.search-bar--xfer/.search-bar__value/__clear/
   __icon). Used by Views/Search/CarHireSearchTab.cshtml + TransferSearchTab.cshtml, both wrapped
   in .hp2 (see those files) so --home-* tokens resolve - this file itself isn't loaded inside
   .hp2 by the calling page's other markup, only these two tabs' own wrapper divs are.

   Results below the tabs are deliberately plain (.plain-results) - matching the real
   CarSearchResult/TransferSegment data now, but not yet the design's own polished
   .hire-card/.xfer-card layouts (a separate follow-up task), so this doesn't read as a finished
   results page. */

/* CarHireSearchTab.cshtml/TransferSearchTab.cshtml are actually built on .aip-search-bar/
   .aip-search-wrap (AipSearchDropdowns.css's real modal-picker component - see those files' own
   header comments for why: real airport/resort data, real dialogs), not the prototype's own bare
   .search-bar/.search-bar--xfer classes - so nothing below targets those any more (an earlier
   pass ported that CSS straight from the prototype before the markup switched to .aip-*, leaving
   it dead - matching neither element on the actual page, which is why the design looked
   unstyled). The only two things still genuinely needed here are the transfer tab's own
   .trip-type toggle (no .aip-* equivalent exists) and .xfer-shell, the one wrapper the trip-type
   toggle and the .aip-search-bar form now share so they read as ONE gold capsule - exactly how
   transfer-only/styles.css's own .xfer-search wraps both, rather than two separate blocks. */

.hp2 .xfer-shell {
  /* max-width: 1180px; */
  margin: 0 auto;
  background: var(--home-gold);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 16px 40px rgba(16, 68, 67, 0.18);
}

/* The form's own .aip-search-bar background/padding/shadow/radius (real, from
   AipSearchDropdowns.css - shared with Holiday/Flight/Hotel/Car Hire's own tabs, so not edited
   there) would double up on top of .xfer-shell's, which already provides all of it - cancelled
   here rather than in the shared file, same "transparent" override
   transfer-only/styles.css's own .search-bar.search-bar--xfer used against its own base
   .search-bar for the same reason. */
.hp2 .xfer-shell .aip-search-bar {
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}

.hp2 .trip-type {
  display: flex;
  gap: 6px;
  padding: 0 2px 10px;
}

.hp2 .trip-type__opt {
  position: relative;
  cursor: pointer;
}

.hp2 .trip-type__opt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.hp2 .trip-type__opt span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: var(--home-primary-deep);
  background: rgba(255, 255, 255, 0.4);
}

.hp2 .trip-type__opt input:checked + span {
  background: var(--home-primary-deep);
  color: #fff;
}

/* ---- Plain results (real data, placeholder layout - see header comment) ---- */

.hp2 .plain-results {
  margin: 24px auto 0;
  display: grid;
  gap: 12px;
}

.hp2 .plain-results__head {
  font-weight: 800;
  color: var(--home-text-muted);
  font-size: 14px;
}

.hp2 .plain-result {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--home-border);
  border-radius: 12px;
  background: #fff;
}

.hp2 .plain-result__name {
  font-weight: 800;
}

.hp2 .plain-result__meta {
  color: var(--home-text-muted);
  font-size: 13px;
}

.hp2 .plain-result__price {
  font-family: var(--home-font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--home-primary-dark);
  white-space: nowrap;
}

.hp2 .plain-results__empty,
.hp2 .plain-results__error {
  padding: 16px;
  border: 1px dashed var(--home-border);
  border-radius: 12px;
  color: var(--home-text-muted);
  text-align: center;
}

/* Mobile: Car Hire still keeps its search bar always visible on phones (no tap-to-edit
   ".aip-search-summary" accordion) per an earlier request - unchanged. Transfer's own tab was
   the same until a later request asked it to collapse behind the accordion exactly like
   Holiday/Flight/Hotel's tabs do (AipSearchDropdowns.css's own .is-editing toggle - already
   real/working via TransferSearchTab.cshtml's #xfEditSearch button, nothing to add there), so
   only #chSearchWrap keeps the override now.
   Same wrap id is shared by both pages TransferSearchTab.cshtml is embedded on
   (TransferAndCarHirePage.cshtml and TransferSearchResults.cshtml) - collapses on both rather
   than one page only, since having the Transfers landing page behave differently from its own
   results page on the same tab would be its own inconsistency. */
@media (max-width: 860px) {
  #chSearchWrap .aip-search-summary {
    display: none;
  }

  #chSearchWrap .aip-search-bar {
    max-height: none;
    overflow: visible;
    visibility: visible;
    margin-top: 0;
    transition: none;
  }

  /* .xfer-shell itself (the gold capsule .trip-type and .aip-search-bar both sit inside) keeps
     its own real padding (10px, see .xfer-shell's own rule above) regardless of its children
     collapsing to zero height - collapsing only the children left a thin gold sliver peeking out
     under the summary chip instead of the shell disappearing along with them. Zeroed out here to
     match, restored once .is-editing is on. */
  #xfSearchWrap .xfer-shell {
    padding: 0;
    transition: padding 0.32s ease;
  }

  #xfSearchWrap.is-editing .xfer-shell {
    padding: 10px;
  }

  /* .trip-type (One-way/Return) sits beside .aip-search-bar inside .xfer-shell, not inside it
     (see .xfer-shell's own header comment above) - AipSearchDropdowns.css's shared collapse rule
     only ever targets .aip-search-bar itself, so without this the trip-type toggle would stay
     visible above a collapsed bar instead of tucking behind the summary chip with everything
     else. Same collapsed/expanded mechanics (max-height+visibility, gated on .is-editing) applied
     to it directly since it isn't nested inside the element the shared rule already covers. */
  #xfSearchWrap .trip-type {
    max-height: 0;
    padding-bottom: 0;
    overflow: hidden;
    visibility: hidden;
    transition:
      max-height 0.32s ease,
      padding-bottom 0.32s ease,
      visibility 0s linear 0.32s;
  }

  #xfSearchWrap.is-editing .trip-type {
    max-height: 60px;
    padding-bottom: 10px;
    visibility: visible;
    transition:
      max-height 0.32s ease,
      padding-bottom 0.32s ease;
  }
}

/* .aip-search-bar's own responsive collapsing (AipSearchDropdowns.css) already covers the
   fields/button for both Car Hire and Transfer - nothing extra needed here for that. */

/* ---- Transfer Boxes widget (TransferBoxesWidget.cshtml) - see that file's own header comment.
   Only real widget on these two pages besides HolidayTrustWidget.cshtml, which already had the
   homepage-v2 treatment - this brings the other one up to the same standard. ---- */

.hp2 .tbx-section {
  padding-top: 8px;
}

.hp2 .tbx-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* Without this, each implicit row sizes to its own tallest card only - a short top row (e.g.
     one-line descriptions) ends up visibly shorter than a longer row below it. 1fr row tracks on
     an auto-height grid all get sized to the SAME flex-fraction (the largest row's content need),
     so every row - and every card in it, since grid items stretch to fill their cell by default -
     ends up the same height as the tallest card anywhere in the grid. */
  grid-auto-rows: 1fr;
  gap: 24px;
}

.hp2 .tbx-card {
  display: grid;
  grid-template-columns: 42% 1fr;
  align-items: stretch;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(16, 68, 67, 0.1);
  border: 1px solid var(--home-border);
}

.hp2 .tbx-card__media {
  position: relative;
  min-height: 160px;
}

.hp2 .tbx-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hp2 .tbx-card__body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.hp2 .tbx-card__body h3 {
  margin: 0;
  font-family: var(--home-font-display);
  font-size: 19px;
  color: var(--home-primary-deep);
}

.hp2 .tbx-card__body p {
  margin: 0;
  font-size: 14px;
  color: var(--home-text-muted);
  line-height: 1.5;
}

.hp2 .tbx-card__btn {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 14px;
  min-height: 42px;
  padding: 8px 16px;
}

.hp2 .tbx-card__btn svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 860px) {
  .hp2 .tbx-grid {
    grid-template-columns: 1fr;
  }

  .hp2 .tbx-card {
    grid-template-columns: 1fr;
  }

  .hp2 .tbx-card__media {
    min-height: 200px;
  }
}
