/* Native form follows the existing rentcar palette; vendor styles stay on /search/. */
.roscar-search-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  min-height: 0;
  gap: 24px 18px;
  align-items: end;
  position: relative;
  box-sizing: border-box;
  padding: 24px;
  margin: 0 0 32px;
  background: var(--home-surface, #fff);
  border: 1px solid var(--home-border, #e1eaf3);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgb(23 23 43 / 20%);
  color: var(--home-text, #12243d);
  font-family: var(--home-font, system-ui, sans-serif);
  text-align: start;
}
.roscar-site.has-hero-header #content .entry-content > .roscar-search-form { width: calc(100% - 8px); margin-inline: auto; margin-top: -84px; z-index: 2; }
.roscar-search-form .roscar-search-field { display: flex; flex-direction: column; min-width: 0; gap: 7px; margin: 0; font-size: 15px; font-weight: 700; line-height: 1.4; }
.roscar-search-form .roscar-search-field > span { padding-inline: 2px; }
.roscar-search-form :is(select, input[type=date]) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 12px;
  margin: 0;
  border: 1px solid var(--home-border, #d6e0eb);
  border-radius: 12px;
  background-color: var(--home-soft, #f5f8fc);
  color: var(--home-text, #12243d);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  color-scheme: light;
}
.roscar-search-form select { padding-inline-end: 30px; text-overflow: ellipsis; }
.roscar-search-form :is(select,input):focus-visible { outline: 3px solid var(--home-yellow, #f7cd42); outline-offset: 2px; border-color: var(--home-red, #e3282f); }
.roscar-search-form .roscar-search-submit {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(320px, 100%);
  min-height: 54px;
  padding: 12px 24px;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: var(--home-red, #e3282f);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
@media (hover: hover) and (pointer: fine) {
  .roscar-search-form .roscar-search-submit:hover { background: var(--home-red-dark, #b9151b); }
}
.roscar-search-form .roscar-search-submit:active { background: var(--home-red-dark, #b9151b); }
.roscar-search-form .roscar-search-submit:focus-visible { outline: 3px solid var(--home-yellow, #f7cd42); outline-offset: 3px; }
.roscar-results-main { width: 100%; min-width: 0; padding-block: 36px 64px; }
.roscar-results-widget { min-height: 600px; }
.roscar-results-widget lr-whitelabel { display: block; }
.roscar-search-error { padding: 16px; border-inline-start: 4px solid var(--home-red, #e3282f); background: var(--home-surface, #fff); }
@media (max-width: 720px) {
  .roscar-search-form { grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 16px; gap: 14px; border-radius: 15px; }
  .roscar-search-form .roscar-search-submit { width: 100%; }
  .roscar-site.has-hero-header #content .entry-content > .roscar-search-form { width: 100%; margin-top: -60px; }
  .roscar-search-form :is(select, input[type=date]) { padding-inline: 12px; }
  .roscar-results-main { padding-top: 24px; }
}
/* Custom location controls keep the native select as a no-JavaScript fallback. */
.roscar-search-form [hidden] { display: none !important; }
.roscar-search-form .roscar-location-field { position: relative; }
.roscar-search-form .roscar-location-field > label { margin: 0; font: inherit; padding-inline: 2px; }
.roscar-search-form :is(.roscar-location-trigger,.roscar-date-trigger) {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-width: 0; min-height: 50px; padding: 12px 16px; margin: 0;
  border: 1px solid var(--home-border,#d6e0eb); border-radius: 12px;
  background: var(--home-soft,#f5f8fc); color: var(--home-text,#12243d);
  font: inherit; font-size: 16px; font-weight: 500; text-align: start; line-height: 1.4;
  cursor: pointer; touch-action: manipulation;
}
.roscar-search-form :is(.roscar-location-trigger,.roscar-date-trigger) > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roscar-search-form :is(.roscar-location-trigger,.roscar-date-trigger) svg { width: 20px; height: 20px; flex: 0 0 20px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.roscar-search-form :is(.roscar-location-trigger,.roscar-date-trigger):focus-visible { outline: 3px solid var(--home-yellow,#f7cd42); outline-offset: 3px; }
.roscar-search-form .roscar-location-trigger[aria-expanded=true],.roscar-search-form .roscar-date-trigger[aria-expanded=true] { border-color: var(--home-red,#e3282f); background: var(--home-surface,#fff); }
.roscar-search-form .roscar-location-list { position: absolute; z-index: 50; inset-inline: 0; top: calc(100% + 8px); max-height: 292px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 6px; border: 1px solid var(--home-border,#d6e0eb); border-radius: 14px; background: var(--home-surface,#fff); box-shadow: 0 16px 40px #071f3b26; }
.roscar-search-form .roscar-location-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 10px 12px; border-radius: 8px; font-size: 16px; font-weight: 500; line-height: 1.4; cursor: pointer; }
.roscar-search-form .roscar-location-option[aria-selected=true] { background: var(--home-soft,#f5f8fc); color: var(--home-red,#e3282f); font-weight: 700; }
.roscar-search-form .roscar-location-option.is-focused { outline: 2px solid var(--home-red,#e3282f); outline-offset: -2px; }
.roscar-search-form .roscar-location-field.is-open { z-index: 30; }
.roscar-range-panel { position: absolute; z-index: 80; max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; width: 640px; max-width: calc(100% - 24px); padding: 18px; border: 1px solid var(--home-border,#e1eaf3); border-radius: 20px; background: var(--home-surface,#fff); color: var(--home-text,#12243d); box-shadow: 0 20px 60px #071f3b33; }
.roscar-range-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.roscar-range-header strong { font-size: 16px; }
.roscar-range-panel .roscar-range-close { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--home-soft,#f5f8fc); color: inherit; font-size: 26px; cursor: pointer; }
.roscar-range-panel .flatpickr-calendar { width: 100% !important; border: 0; box-shadow: none; background: transparent; padding: 0; font: inherit; }
.roscar-range-panel .flatpickr-innerContainer,.roscar-range-panel .flatpickr-rContainer,.roscar-range-panel .flatpickr-days { width: 100% !important; }
.roscar-range-panel .flatpickr-days { display: flex; gap: 12px; }
.roscar-range-panel .dayContainer { flex: 1 1 0; width: 0; min-width: 0; max-width: none; padding: 0; }
.roscar-range-panel .flatpickr-day { flex-basis: 14.2857%; max-width: 14.2857%; height: 38px; line-height: 38px; border-radius: 9px; color: var(--home-text,#12243d); }
.roscar-range-panel .flatpickr-day.flatpickr-disabled { opacity: .3; }
.roscar-range-panel .flatpickr-day.inRange { background: var(--home-soft,#f5f8fc); border-color: var(--home-soft,#f5f8fc); box-shadow: none; border-radius: 0; }
.roscar-range-panel .flatpickr-day:is(.selected,.startRange,.endRange) { background: var(--home-red,#e3282f); border-color: var(--home-red,#e3282f); color: #fff; }
.roscar-range-panel .flatpickr-day.today:not(.selected) { border-color: var(--home-red,#e3282f); }
.roscar-range-panel .flatpickr-months .flatpickr-month { height: 44px; color: inherit; }
.roscar-range-panel .flatpickr-current-month { font-size: 16px; padding-top: 8px; }
.roscar-range-panel .flatpickr-weekday { background: transparent; color: var(--home-muted,#627287); font-size: 12px; }
.roscar-range-panel .flatpickr-months :is(.flatpickr-prev-month,.flatpickr-next-month) { top: 0; fill: currentColor; color: inherit; }
.roscar-range-panel .roscar-range-done { display: block; min-height: 44px; padding: 10px 24px; margin: 14px 0 0 auto; border: 0; border-radius: 10px; background: var(--home-red,#e3282f); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.roscar-range-panel .roscar-range-done:disabled { opacity: .4; cursor: default; }
.roscar-range-panel button:focus-visible { outline: 3px solid var(--home-yellow,#f7cd42); outline-offset: 2px; }
@media (hover:hover) and (pointer:fine) { .roscar-search-form .roscar-location-option:hover { background: var(--home-soft,#f5f8fc); } }
@media (max-width:720px), (max-width:900px) and (max-height:480px) {
  .roscar-range-panel { position: fixed; inset: auto 12px max(12px, env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; padding: 16px; }
  .roscar-search-form .roscar-location-list { max-height: 250px; }
}

/* The dates and action share the second row on desktop. */
.roscar-search-form .roscar-date-range-field { grid-column: 1; }
.roscar-search-form:has(.roscar-date-range-field) .roscar-search-submit {
  grid-column: 2;
  justify-self: stretch;
  width: 100%;
  min-height: 50px;
}
@media (max-width: 720px) {
  .roscar-search-form .roscar-date-range-field,
  .roscar-search-form:has(.roscar-date-range-field) .roscar-search-submit { grid-column: 1; }
}

/* Use the same image-backed hero placement as DiscoverCars. */
.page-hero-header .roscar-booking-widget--hero:has(.roscar-search-form) {
  padding: 0; border: 0; background: transparent; box-shadow: none;
}
.page-hero-header .roscar-booking-widget--hero > .roscar-search-form {
  width: 100%; max-width: none; margin: 0;
}
.page-hero-header:has(.roscar-search-form),
.page-hero-header:has(.roscar-search-form) .page-hero-header__content { overflow: visible; }

/* Localrent's compact form leaves room for a more spacious editorial hero. */
body.roscar-site.roscar-booking-localrent .page-hero-header:has(.roscar-search-form) .page-hero-header__content {
  padding-top: 80px;
  padding-bottom: 104px;
}
body.roscar-site.roscar-booking-localrent .page-hero-header:has(.roscar-search-form) .page-hero-header__title {
  margin-block: 12px 36px !important;
}
body.roscar-site.roscar-booking-localrent .page-hero-header:has(.roscar-search-form) .page-hero-header__desc {
  line-height: 1.65;
}
body.roscar-site.roscar-booking-localrent .page-hero-header:has(.roscar-search-form) .page-hero-header__badges {
  margin-top: 38px;
}
body.roscar-site.roscar-booking-localrent .page-hero-header .roscar-booking-widget--hero:has(.roscar-search-form) {
  margin-top: 48px;
}
@media (max-width: 720px) {
  body.roscar-site.roscar-booking-localrent .page-hero-header:has(.roscar-search-form) .page-hero-header__content {
    padding-top: 96px;
    padding-bottom: 32px;
  }
  body.roscar-site.roscar-booking-localrent .page-hero-header:has(.roscar-search-form) .page-hero-header__title {
    margin-block: 8px 28px !important;
  }
  body.roscar-site.roscar-booking-localrent .page-hero-header:has(.roscar-search-form) .page-hero-header__badges {
    margin-top: 24px;
  }
  body.roscar-site.roscar-booking-localrent .page-hero-header .roscar-booking-widget--hero:has(.roscar-search-form) {
    margin-top: 28px;
  }
}

/* Match the hero text column without inheriting the theme's generic widget gutters. */
body.roscar-site.roscar-booking-localrent .page-hero-header .roscar-booking-widget--hero:has(.roscar-search-form) {
  width: 100%;
  max-width: none;
  padding-inline: 0;
  margin-inline: 0;
  box-sizing: border-box;
}
body.roscar-site.roscar-booking-localrent .page-hero-header .roscar-booking-widget--hero > .roscar-search-form {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

/* Pointer interaction uses the surface and checkmark, without focus rings. */
.roscar-search-form .roscar-location-trigger:is(:focus, [aria-expanded=true]) {
  outline: none;
  box-shadow: none;
  border-color: var(--home-border, #d6e0eb);
}
.roscar-search-form .roscar-location-trigger:focus-visible {
  outline: 2px solid var(--home-yellow, #f7cd42);
  outline-offset: 3px;
}
.roscar-search-form .roscar-location-option.is-focused {
  outline: none;
  background: var(--home-soft, #f5f8fc);
}

/* Raise the hero stacking context only while one of its popovers is open. */
body.roscar-site.roscar-booking-localrent .page-hero-header:has(.roscar-search-form [aria-expanded="true"]) {
  z-index: 100;
}

/* Results use the same full-width hero and editable page fields as the site. */
body.roscar-search-results #page { background: var(--home-soft, #f5f8fc); }
body.roscar-search-results .roscar-results-hero { background: transparent; overflow: visible; }
body.roscar-search-results .roscar-results-hero::before { content: ""; position: absolute; inset: 0 0 calc(-1 * clamp(360px, 40vw, 560px)); background-color: var(--home-navy, #071f3b); background-position: center; background-size: cover; pointer-events: none; }
body.roscar-search-results .roscar-results-hero .page-hero-header__content { padding-block: 96px 88px; }
body.roscar-search-results .roscar-results-hero .page-hero-header__title { margin: 0 0 24px; }
body.roscar-search-results .roscar-results-hero .page-hero-header__badges { margin-top: 28px; }
body.roscar-search-results #content { padding-top: 0; }
body.roscar-search-results .roscar-results-main { position: relative; z-index: 1; margin-top: -40px; margin-bottom: 64px; padding: 24px; border: 1px solid var(--home-border, #e1eaf3); border-radius: 30px; background: #fff; box-shadow: var(--home-shadow, 0 10px 28px #071f3b0f); }
@media (max-width: 720px) {
  body.roscar-search-results .roscar-results-hero .page-hero-header__content { padding-block: 80px 64px; }
  body.roscar-search-results .roscar-results-hero .page-hero-header__title { margin-bottom: 18px; }
  body.roscar-search-results .roscar-results-main { margin-top: -28px; margin-bottom: 32px; padding: 12px; border-radius: 20px; }
}

/* Keep breadcrumbs in the normal flow with the reference spacing above H1. */
body.roscar-site.roscar-booking-localrent:not(.roscar-search-results) .page-hero-header:has(.roscar-search-form) .breadcrumb {
  margin-bottom: 31px;
}
@media (max-width: 720px) {
  body.roscar-site.roscar-booking-localrent:not(.roscar-search-results) .page-hero-header:has(.roscar-search-form) .breadcrumb {
    margin-bottom: 16px;
  }
}

/* Keep the calendar below the WordPress toolbar on short, logged-in screens. */
body.admin-bar .roscar-range-panel { max-height: calc(100dvh - 24px - var(--wp-admin--admin-bar--height, 32px) - env(safe-area-inset-bottom, 0px)); }
