/* Home search-card functional/layout fix
   - Keeps Transfer / Hourly tabs side-by-side
   - Restores transfer one-way / roundtrip and hourly mode visibility behavior
   - Applies only on home page search-card
*/

/* Keep tabs stable on all devices */
body.home-page .search-card.search-card--home.search-card--beige .toggle-group,
body.home-page .search-card.search-card--home.search-card--beige .toggle-group--beige{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:14px !important;
  width:100% !important;
  align-items:stretch !important;
}

body.home-page .search-card.search-card--home.search-card--beige .toggle-group .btn-toggle,
body.home-page .search-card.search-card--home.search-card--beige .toggle-group--beige .btn-toggle{
  width:100% !important;
  min-width:0 !important;
  min-height:112px !important;
  border-radius:28px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:14px !important;
  white-space:nowrap !important;
}

body.home-page .search-card.search-card--home.search-card--beige .toggle-group .btn-toggle .btn-label,
body.home-page .search-card.search-card--home.search-card--beige .toggle-group--beige .btn-toggle .btn-label{
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

/* Desktop / large tablet: stable two-column layout */
@media (min-width: 992px){
  body.home-page .search-card.search-card--home.search-card--beige{
    width:min(94vw,1320px) !important;
    max-width:min(94vw,1320px) !important;
    padding:28px !important;
  }

  body.home-page .search-card.search-card--home.search-card--beige .form-row{
    display:grid !important;
    grid-template-columns:minmax(0,1.55fr) minmax(430px,1fr) !important;
    grid-template-areas:
      "locations datetime"
      "trip submit"
      "distance distance"
      "routes routes"
      "toast toast";
    column-gap:20px !important;
    row-gap:18px !important;
    align-items:start !important;
  }

  body.home-page .search-card.search-card--home.search-card--beige #mainLocationRow,
  body.home-page .search-card.search-card--home.search-card--beige #hourlyLocationRow{
    grid-area:locations !important;
    min-width:0 !important;
  }

  body.home-page .search-card.search-card--home.search-card--beige .date-row{
    grid-area:datetime !important;
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:16px !important;
    align-items:start !important;
    min-width:0 !important;
  }

  body.home-page .search-card.search-card--home.search-card--beige .trip-type-inline--beige{
    grid-area:trip !important;
    width:100% !important;
    min-height:96px !important;
    padding:18px 20px !important;
    display:flex;
    align-items:center !important;
    justify-content:space-between !important;
  }

  body.home-page .search-card.search-card--home.search-card--beige .btn-search{
    grid-area:submit !important;
    width:100% !important;
    min-height:96px !important;
    height:auto !important;
    margin:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:28px !important;
    border-radius:28px !important;
  }

  body.home-page .search-card.search-card--home.search-card--beige #distanceOutput{ grid-area:distance !important; }
  body.home-page .search-card.search-card--home.search-card--beige #routeOptions{ grid-area:routes !important; }
  body.home-page .search-card.search-card--home.search-card--beige #custom-toast{ grid-area:toast !important; }

  body.home-page .search-card.search-card--home.search-card--beige .location-row{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 88px minmax(0,1fr) !important;
    gap:18px !important;
    align-items:center !important;
    min-width:0 !important;
  }

  body.home-page .search-card.search-card--home.search-card--beige .location-row > .field-group,
  body.home-page .search-card.search-card--home.search-card--beige .date-row > .field-group{
    width:100% !important;
    min-width:0 !important;
    min-height:118px !important;
  }

  body.home-page .search-card.search-card--home.search-card--beige .location-row .field-group,
  body.home-page .search-card.search-card--home.search-card--beige .date-row .field-group{
    display:flex;
    align-items:center !important;
    gap:14px !important;
    padding:18px 20px !important;
  }

  body.home-page .search-card.search-card--home.search-card--beige .location-row .swap-btn{
    position:static !important;
    top:auto !important;
    right:auto !important;
    transform:none !important;
    -webkit-transform:none !important;
    width:78px !important;
    height:78px !important;
    margin:0 !important;
    justify-self:center !important;
    align-self:center !important;
    border-radius:24px !important;
  }

  body.home-page .search-card.search-card--home.search-card--beige .date-row .duration-group{
    grid-column:1 / 2 !important;
    max-width:none !important;
    width:100% !important;
  }

  body.home-page .search-card.search-card--home.search-card--beige .date-row .return-date-wrapper,
  body.home-page .search-card.search-card--home.search-card--beige .date-row .return-time-wrapper{
    min-width:0 !important;
  }

  body.home-page .search-card.search-card--home.search-card--beige .duration-group .unit-label{
    position:static !important;
    transform:none !important;
    margin-left:auto !important;
    white-space:nowrap !important;
  }

  body.home-page .search-card.search-card--home.search-card--beige .field-group .form-control,
  body.home-page .search-card.search-card--home.search-card--beige .field-group input[type="text"],
  body.home-page .search-card.search-card--home.search-card--beige .field-group input[type="search"],
  body.home-page .search-card.search-card--home.search-card--beige .field-group input[type="date"],
  body.home-page .search-card.search-card--home.search-card--beige .field-group input[type="time"],
  body.home-page .search-card.search-card--home.search-card--beige .field-group input[type="number"]{
    font-size:18px !important;
    height:34px !important;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991px){
  body.home-page .search-card.search-card--home.search-card--beige .form-row{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(250px,320px) !important;
    grid-template-areas:
      "locations locations"
      "datetime submit"
      "trip trip";
    gap:16px !important;
    align-items:start !important;
  }

  body.home-page .search-card.search-card--home.search-card--beige #mainLocationRow,
  body.home-page .search-card.search-card--home.search-card--beige #hourlyLocationRow{ grid-area:locations !important; }
  body.home-page .search-card.search-card--home.search-card--beige .date-row{ grid-area:datetime !important; }
  body.home-page .search-card.search-card--home.search-card--beige .btn-search{ grid-area:submit !important; min-height:72px !important; }
  body.home-page .search-card.search-card--home.search-card--beige .trip-type-inline--beige{ grid-area:trip !important; }
}

/* Mobile */
@media (max-width: 767px){
  body.home-page .search-card.search-card--home.search-card--beige .toggle-group .btn-toggle,
  body.home-page .search-card.search-card--home.search-card--beige .toggle-group--beige .btn-toggle{
    min-height:84px !important;
    border-radius:22px !important;
  }
}
