/* CarMisto public shell: one visual language for the SPA and server-rendered
   pages.  The selectors are scoped so legacy cabinet components keep their
   existing hooks and business behaviour. */
html.site-shell {
  background: var(--bg-main);
}

body.site-shell {
  min-width: 0;
  background: var(--bg-main);
}

body.site-shell #main-header {
  isolation: isolate;
  border-bottom: 2px solid var(--primary);
  background: #20242c;
  box-shadow: 0 6px 20px rgba(28, 33, 42, .16);
}

body.site-shell #main-header .top-bar > a:first-child,
body.site-shell #main-header .header-logo-button {
  color: #fff;
  text-decoration: none;
}

body.site-shell #main-header .header-logo-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 2px 0;
  border-radius: 10px;
}

body.site-shell #main-header .header-logo-button:focus-visible {
  outline-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .24) !important;
}

body.site-shell #main-header .header-brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -.04em;
  box-shadow: 0 5px 15px rgba(201, 22, 29, .28);
}

body.site-shell #main-header .header-brand-name {
  overflow: hidden;
  color: #fff;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.site-shell #main-header .header-actions--shared {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

body.site-shell #main-header .header-actions--shared > .base-language-switch,
body.site-shell #main-header .header-actions--shared > .shared-language-switch,
body.site-shell #main-header .header-actions--shared > .currency-switch,
body.site-shell #main-header .header-actions--shared > .icon-btn,
body.site-shell #main-header .header-actions--shared #user-badge {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: rgba(255, 255, 255, .09);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

body.site-shell #main-header .base-language-switch,
body.site-shell #main-header .shared-language-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  color: rgba(255, 255, 255, .58);
  white-space: nowrap;
}

body.site-shell #main-header .base-language-switch a {
  color: rgba(255, 255, 255, .72);
  text-decoration: none;
}

body.site-shell #main-header .base-language-switch a[aria-current="true"],
body.site-shell #main-header .shared-language-switch button.active {
  color: #fff;
}

body.site-shell #main-header .shared-language-switch button {
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .72);
  font: inherit;
  cursor: pointer;
}

body.site-shell #main-header .currency-switch {
  min-width: 74px;
  padding: 0 26px 0 10px;
  outline: none;
  cursor: pointer;
}

body.site-shell #main-header .currency-switch option {
  color: #171113;
  background: #fff;
}

body.site-shell #main-header .icon-btn {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  padding: 0 9px;
  cursor: pointer;
}

body.site-shell #main-header .header-account,
body.site-shell #main-header .header-account-link {
  min-width: 0;
  color: #fff;
  text-decoration: none;
}

body.site-shell #main-header .header-account-badge,
body.site-shell #main-header .header-account-link .header-account-badge {
  display: inline-flex;
  align-items: center;
  max-width: 150px;
  padding: 0 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.site-shell #main-header .desktop-nav {
  min-width: 0;
  margin: 0;
  gap: 4px;
  overflow: hidden;
  flex-wrap: nowrap !important;
}

body.site-shell #main-header .desktop-nav > a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0;
  padding: 7px 9px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, .84);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The first six links are the task navigation.  Everything else belongs in
   the overflow menu; this prevents the header from wrapping or crushing the
   account controls at laptop widths. */
@media (min-width: 851px) {
  body.site-shell #main-header {
    display: grid;
    grid-template-columns: minmax(150px, auto) minmax(0, 1fr) auto minmax(max-content, auto) !important;
    align-items: center;
    column-gap: 10px;
    min-height: 58px;
    padding: 6px clamp(16px, 3vw, 42px);
  }

  body.site-shell #main-header .top-bar {
    display: contents;
  }

  body.site-shell #main-header .top-bar > :first-child {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  body.site-shell #main-header .desktop-nav {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap !important;
    overflow: hidden;
  }

  body.site-shell:not(.is-tg-app) #main-header .desktop-nav-overflow {
    display: block !important;
    grid-column: 3 !important;
    grid-row: 1 !important;
  }

  body.site-shell:not(.is-tg-app) #main-header .desktop-nav > a:nth-of-type(-n + 6) {
    display: inline-flex !important;
  }

  body.site-shell:not(.is-tg-app) #main-header .desktop-nav > a:nth-of-type(n + 7) {
    display: none !important;
  }

  body.site-shell #main-header .desktop-nav > a.active {
    border-color: rgba(255, 255, 255, .12);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(201, 22, 29, .22);
  }

  body.site-shell #main-header .desktop-nav > a:hover:not(.active) {
    background: rgba(255, 255, 255, .10);
    color: #fff;
  }

  body.site-shell #main-header .desktop-nav-overflow {
    position: relative;
    grid-column: 3;
    grid-row: 1;
  }

  body.site-shell #main-header .header-actions {
    grid-column: 4 !important;
    grid-row: 1 !important;
    justify-self: end;
  }

  body.site-shell #main-header .desktop-nav-more {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: rgba(255, 255, 255, .84);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
  }

  body.site-shell #main-header .desktop-nav-more:hover,
  body.site-shell #main-header .desktop-nav-more[aria-expanded="true"],
  body.site-shell #main-header .desktop-nav-more.is-active {
    background: rgba(255, 255, 255, .10);
    color: #fff;
  }

  body.site-shell #main-header .desktop-more-menu {
    top: calc(100% + 10px);
    right: 0;
    min-width: 192px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--bg-card);
    box-shadow: var(--shadow-raised);
  }

  body.site-shell #main-header .desktop-more-menu a {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 750;
    text-transform: none;
    text-decoration: none;
  }

  body.site-shell #main-header .desktop-more-menu a:hover,
  body.site-shell #main-header .desktop-more-menu a.active {
    background: var(--primary-light);
    color: var(--primary);
  }
}

/* At laptop widths the account controls and the catalogue task need a stable
   one-line header. Secondary destinations stay available in More instead of
   shrinking into a second row. */
@media (min-width: 851px) and (max-width: 1320px) {
  body.site-shell:not(.is-tg-app) #main-header .desktop-nav > a:nth-of-type(n + 5):nth-of-type(-n + 6) {
    display: none !important;
  }
}

@media (min-width: 851px) and (max-width: 1120px) {
  body.site-shell:not(.is-tg-app) #main-header .desktop-nav > a:nth-of-type(n + 4):nth-of-type(-n + 6) {
    display: none !important;
  }
}

/* Make the SPA and full-page routes enter with the same short, quiet motion. */
body.site-shell #app-content > .page.active,
body.site-shell #main-content {
  animation: carmisto-page-enter .22s ease both;
}

html.site-route-switch body.site-shell #app-content > .page.active {
  animation: none;
}

@keyframes carmisto-page-enter {
  from { opacity: .72; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

html.site-route-leaving body.site-shell #main-content,
html.site-route-leaving body.site-shell #app-content {
  opacity: .72;
  transition: opacity .12s ease;
}

/* Compare is a utility, not a second hero.  Dock it to the edge and hide it
   while the sticky search surface is in view, so it cannot cover dates or the
   primary search action. */
body.site-shell .compare-bar {
  right: max(16px, env(safe-area-inset-right));
  bottom: 24px;
  left: auto;
  width: min(360px, calc(100vw - 32px));
  max-width: none;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(120px);
}

body.site-shell .compare-bar.show {
  bottom: 24px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

body.site-shell .compare-bar.is-search-visible {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
}

/* Date labels and localized placeholders are two deliberate rows. Native
   date controls otherwise place their browser placeholder on top of the
   floated label, especially in the empty return-date field. */
body.site-shell .locale-date-field .floating-label,
body.site-shell .marketplace-search__date-field .floating-label {
  top: 6px;
  z-index: 2;
  padding: 0 3px;
  border-radius: 4px;
  background: var(--bg-card);
}

body.site-shell .locale-date-field .date-input-placeholder,
body.site-shell .marketplace-search__date-field .date-input-placeholder {
  top: 27px;
  font-size: 13px;
  line-height: 1.15;
}

body.site-shell #app-content,
body.site-shell #main-content {
  min-width: 0;
}

body.site-shell #app-content > .page {
  max-width: 1120px;
  padding-right: 16px;
  padding-left: 16px;
}

body.site-shell .marketplace-page {
  max-width: 1120px;
  margin-top: 30px;
}

body.site-shell .marketplace-page h1,
body.site-shell .public-page__hero h1 {
  text-wrap: balance;
}

body.site-shell .journey-hero,
body.site-shell .public-page__hero {
  box-shadow: 0 10px 28px rgba(23, 32, 42, .10);
}

@media (min-width: 851px) and (max-width: 1120px) {
  body.site-shell #main-header {
    grid-template-columns: minmax(132px, auto) minmax(0, 1fr) auto minmax(max-content, auto) !important;
    column-gap: 5px;
    padding-right: 14px;
    padding-left: 14px;
  }

  body.site-shell #main-header .header-brand-name {
    font-size: 15px;
  }

  body.site-shell #main-header .desktop-nav > a {
    padding-right: 6px;
    padding-left: 6px;
    font-size: 10px;
  }

  body.site-shell #main-header .header-actions--shared {
    gap: 4px;
  }

  body.site-shell #main-header .header-account-badge,
  body.site-shell #main-header .header-account-link .header-account-badge {
    max-width: 84px;
    padding-right: 8px;
    padding-left: 8px;
  }
}

@media (max-width: 850px) {
  body.site-shell {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  body.site-shell #main-header {
    position: relative !important;
    display: block;
    padding: 8px 14px;
  }

  body.site-shell #main-header .top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
  }

  body.site-shell #main-header .header-brand-mark {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  body.site-shell #main-header .header-brand-name {
    max-width: min(42vw, 180px);
    font-size: 16px;
  }

  body.site-shell #main-header .header-actions--shared {
    flex: 0 1 auto;
    gap: 5px;
  }

  body.site-shell #main-header .base-language-switch,
  body.site-shell #main-header .shared-language-switch,
  body.site-shell #main-header .currency-switch {
    display: none !important;
  }

  body.site-shell #main-header .header-account-badge,
  body.site-shell #main-header .header-account-link .header-account-badge {
    max-width: 100px;
    padding-right: 9px;
    padding-left: 9px;
  }

  body.site-shell #main-header .desktop-nav,
  body.site-shell #main-header .desktop-nav-overflow {
    display: none !important;
  }

  body.site-shell .mobile-nav {
    display: block;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 -8px 24px rgba(23, 32, 42, .12);
  }

  body.site-shell .mobile-nav-inner {
    max-width: 520px;
    margin: 0 auto;
    padding: 8px 7px calc(8px + env(safe-area-inset-bottom));
  }

  body.site-shell .mobile-nav a,
  body.site-shell .mobile-nav button {
    min-height: 52px;
    gap: 3px;
    border-radius: 10px;
    font-size: 10px;
  }

  body.site-shell .mobile-nav a.active,
  body.site-shell .mobile-nav button.active {
    background: var(--primary-light);
    color: var(--primary);
  }

  body.site-shell .mobile-nav a span.icon,
  body.site-shell .mobile-nav button span.icon {
    font-size: 20px;
  }

  body.site-shell .mobile-more-menu {
    bottom: calc(72px + env(safe-area-inset-bottom));
    max-height: min(72dvh, 560px);
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 32px rgba(23, 32, 42, .18);
  }

  body.site-shell .mobile-menu-item {
    min-height: 48px;
    padding: 12px 18px;
  }

  body.site-shell .compare-bar {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
  }

  body.site-shell .compare-bar.show {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }

  body.site-shell #app-content > .page {
    padding-right: 12px;
    padding-left: 12px;
  }

  body.site-shell .marketplace-page {
    margin-top: 20px;
  }
}

/* Group secondary destinations without changing their URLs or navigation handlers. */
#desktop-more-menu{max-height:min(76vh,620px);overflow-y:auto;overscroll-behavior:contain}
#desktop-more-menu .more-menu-heading,.mobile-more-menu .more-menu-heading{padding:12px 12px 5px;color:var(--text-muted);font-size:10px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}
#desktop-more-menu .more-menu-heading:not(:first-child),.mobile-more-menu .more-menu-heading:not(:first-child){margin-top:7px;border-top:1px solid var(--border)}
.mobile-more-menu .more-menu-heading{padding:13px 18px 5px}
@media(min-width:851px){
  #desktop-more-menu{width:min(460px,calc(100vw - 32px));min-width:360px;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px}
  #desktop-more-menu .more-menu-group{min-width:0;padding:4px;border:1px solid color-mix(in srgb,var(--border) 78%,transparent);border-radius:10px;background:color-mix(in srgb,var(--surface-secondary) 45%,var(--bg-card))}
  #desktop-more-menu .more-menu-group .more-menu-heading{margin:0!important;padding:7px 8px 6px;border:0!important;color:var(--text-muted);font-size:10px;line-height:1.2}
  #desktop-more-menu .more-menu-group a{display:block;min-width:0;padding:8px;border-radius:7px;font-size:12px;line-height:1.25}
}
.mobile-more-menu .more-menu-heading{clear:both}
.how-page-navigation{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0 24px}
.how-page-navigation a{display:inline-flex;align-items:center;min-height:42px;padding:8px 12px;border:1px solid var(--border);border-radius:9px;background:var(--bg-card);color:var(--text-main);font-size:13px;font-weight:750;text-decoration:none}
.how-page-navigation a:hover,.how-page-navigation a:focus-visible{border-color:var(--primary);color:var(--primary)}
#rental-steps,#rental-roles,#rental-programmes{scroll-margin-top:80px}

@media (prefers-reduced-motion: reduce) {
  body.site-shell #app-content > .page.active,
  body.site-shell #main-content {
    animation: none;
  }

  html.site-route-leaving body.site-shell #main-content,
  html.site-route-leaving body.site-shell #app-content {
    opacity: 1;
    transition: none;
  }
}
