/* Shared feedback for links, disclosures and form controls. */
:root {
  --ui-ink: #171a20;
  --ui-edge: #5c5e62;
  --ui-hover-shadow: 0 2px 6px rgb(23 26 32 / 14%);
}
:where(a[href],button,summary,[role="button"],input:is([type="button"],[type="submit"],[type="reset"]),label:has(input:is([type="radio"],[type="checkbox"]))) {
  -webkit-tap-highlight-color: rgb(23 26 32 / 18%);
  touch-action: manipulation;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
:where(button:not(:disabled),summary,[role="button"]:not([aria-disabled="true"]),input:is([type="button"],[type="submit"],[type="reset"]):enabled) { cursor: pointer; }
body :is(a[href],button,summary,[role="button"],input):focus-visible {
  outline: 2px solid #0057fe !important;
  outline-offset: 3px;
}

/* A grid item with width:100% plus its two margins used to push the last
   company pill past the right edge of the vehicles section. */
body#page-top.home-page #main .hm-vehicles #range {
  width: auto;
  min-width: 0;
  max-width: none;
  justify-self: stretch;
}
body#page-top.home-page #main #models .model, .catalog-page #models .model {
  box-sizing: border-box;
  min-width: 0;
  min-height: 46px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  background: #fff;
}
body#page-top.home-page #main .hm-vehicles .hm-copy { min-width: 0; }
body#page-top.home-page #main .hm-actions a { max-width: 100%; text-align: center; }

/* Account for the additional row in the header when staff are signed in. */
html:has(body > .z-header) { scroll-padding-top: calc(var(--zibas-header-height, 84px) + 12px); }
body#page-top:has(> .z-header) main[id],
body#page-top:has(> .z-header) main [id] { scroll-margin-top: 0; }

/* Respect each photograph's original aspect ratio inside its existing frame. */
:where(main,.z-menu-panel,dialog) img { object-fit: contain !important; max-width: 100%; }
body#page-top.home-page #main :is(.hm-hero-photo,.hm-wide-photo,.hm-story-photo,.hm-visit-photo,.hm-product-photo) {
  box-sizing: border-box;
  min-width: 0;
}
body#page-top.home-page #main :is(.hm-hero,.hm-vehicles,.hm-story) figure {
  align-self: center;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  margin: 0;
  padding-block: clamp(10px, 1.3vw, 20px);
  padding-inline: var(--zb-page-inset);
}
body#page-top.home-page #main :is(.hm-hero,.hm-vehicles,.hm-story) figure img.hm-photo {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  max-height: none;
  mask-image: none;
  -webkit-mask-image: none;
}
body#page-top.home-page #main .hm-photo-link {
  display: block;
  width: 100%;
  border-radius: 8px;
}
body#page-top.home-page #main :is(.hm-product-photo,.hm-visit-photo) .hm-photo-link { height: 100%; }
body#page-top.home-page #main .hm-photo-link img.hm-photo { display: block; border-radius: inherit; }
body#page-top .sv-facility-image > .hm-photo-link { display: block; width: 100%; }
body#page-top .contact-hub .contact-choice .contact-thumb { aspect-ratio: 16/10; }
body#page-top .contact-hub .contact-choice .contact-thumb img {
  position: static;
  inset: auto;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-position: center;
}
header.z-header .z-menu-card:hover .z-card-photo img { transform: none; }

/* Hover belongs only to devices with a pointing cursor. The press rules below
   also work with a finger and never change the dimensions of a hit target. */
@media (hover: hover) and (pointer: fine) {
  body :is(button,summary,input:is([type="button"],[type="submit"],[type="reset"]),[role="button"]):not(:disabled,[aria-disabled="true"],:where(.z-header *)):hover {
    box-shadow: inset 0 0 0 1px currentColor, var(--ui-hover-shadow);
  }
  body a[href]:not([aria-disabled="true"],:where(.z-header *, .zf-navigation a, .company-page a, :has(img))):hover {
    text-decoration: underline;
    text-underline-offset: .2em;
  }
  body#page-top :is(#models .model,.hm-actions a,.actions a,.filters a,.sv-dept-nav a,.sv-tabs a,.sv-next-days a,.z-seller-links a,.button,.sv-button,.zf-cta,.z-mobile-book,.sv-price-book):not(:disabled,[aria-disabled="true"]):hover,
  body#page-top .store-main .hm-actions a:hover {
    color: white !important;
    background-color: var(--ui-ink) !important;
    border-color: var(--ui-ink) !important;
    box-shadow: var(--ui-hover-shadow);
    text-decoration: none;
  }
  body#page-top :is(.store-category-nav a:not(:has(img)),.sv-booking-option:not(:has(:disabled))):hover {
    box-shadow: 0 0 0 2px var(--ui-edge), var(--ui-hover-shadow);
  }
}

body#page-top :is(.filters,.sv-tabs,.sv-dept-nav,.contact-intents) a[aria-current]:not([aria-current="false"]),
body#page-top .contact-choice[aria-current]:not([aria-current="false"]),
body#page-top .sv-booking-option:has(input:checked) {
  box-shadow: inset 0 -3px 0 currentColor;
}
body :is(a[href],button,summary,[role="button"],input:is([type="button"],[type="submit"],[type="reset"])):not(:disabled,[aria-disabled="true"],:where(.z-header *, .zf-navigation a, .company-page a, a:has(img))):active,
body#page-top :is(#models .model,.hm-actions a,.z-seller-links a,.sv-booking-option:not(:has(:disabled))):active {
  box-shadow: inset 0 0 0 2px currentColor, inset 0 2px 5px rgb(23 26 32 / 24%) !important;
  translate: 0 1px;
}
body#page-top :is(#models .model,.hm-actions a,.z-seller-links a,.sv-tabs a,.sv-dept-nav a):active {
  background-color: #000 !important;
  color: #fff !important;
}
body :is(button,input,select):disabled, body [aria-disabled="true"] { cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) {
  :where(a,button,summary,[role="button"],input,label,img) { transition-duration: 0s !important; }
  :where(a,button,summary,[role="button"],input,label):active { translate: none !important; }
}
@media (forced-colors: active) {
  :is(button,a,summary):active, :is(a,button)[aria-current]:not([aria-current="false"]) {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
}
.vehicle-page-status { margin: clamp(24px, 5vw, 68px) auto; padding: 0 1.25rem; max-width: 86rem; color: #5c5e62; }

img.zb-viewable, a[data-original-photo] { cursor: zoom-in; }
body#page-top .gallery-frame .zb-enlarge {
  position: absolute; right: 10px; bottom: 10px;
  min-height: 40px; padding: 6px 14px; border: 1px solid #e5e5e5;
  border-radius: 999px; background: #fff; color: #171a20;
  font: 600 .8rem/1.3 system-ui, sans-serif; cursor: zoom-in;
}
@media (hover: hover) and (pointer: fine) {
  body#page-top .gallery-frame .zb-enlarge:hover { background: #171a20; color: #fff; }
}
body dialog.zb-photo-viewer {
  box-sizing: border-box; width: fit-content; height: fit-content;
  max-width: calc(100vw - 20px); max-height: calc(100dvh - 20px);
  margin: auto; padding: 10px; border: 0; border-radius: 12px;
  background: #fff; color: #171a20;
}
body dialog.zb-photo-viewer::backdrop { background: rgb(23 26 32 / 75%); }
body dialog.zb-photo-viewer[open] { display: grid; gap: 8px; justify-items: end; }
body dialog.zb-photo-viewer > img { display: block; max-width: 100%; max-height: calc(100dvh - 108px); width: auto; height: auto; }
body dialog.zb-photo-viewer > button {
  min-height: 44px; padding: 7px 20px; border: 1px solid #171a20;
  border-radius: 999px; color: white; background: #171a20; font: inherit;
}
.gallery-frame:has(> img[hidden]) .zb-enlarge { display: none; }

/* The radius follows the painted image, including letterboxed thumbnails. */
:root { --zb-photo-curve: 16px; }
@media (max-width: 760px) {
  :root { --zb-photo-curve: 12px; }
}
:where(main, .z-menu-panel, dialog) img:not(.vehicle-icon, [class*="logo" i], [src*="/logo." i], [src^="logo." i], [src*="/logos/" i], [src*="zibas-electric-mobility" i], [src*=".svg" i], [src*="/icons/" i]) {
  --zb-visible-radius: min(var(--zb-photo-curve), var(--zb-image-cap, 16px));
  border-radius: var(--zb-visible-radius) !important;
  clip-path: inset(
    var(--zb-image-top, 0px) var(--zb-image-right, 0px)
    var(--zb-image-bottom, 0px) var(--zb-image-left, 0px)
    round var(--zb-visible-radius)
  );
}
body header.z-header .z-menu-card .z-card-photo {
  background-color: transparent;
  border-radius: var(--zb-photo-curve);
}
body header.z-header .z-card-photo img,
body header.z-header #modelnav .z-card-photo img {
  position: absolute; inset: 0; margin: auto;
  width: auto; height: auto; max-width: 100%; max-height: 100%;
}
body :is(.hm-photo-link, .sv-facility-image, .gallery-frame, .store-product-photo, .contact-thumb):has(img) {
  background-color: transparent;
}
body :has(> img.zb-viewable:focus-visible) {
  outline: 2px solid #0057fe;
  outline-offset: 3px;
}

/* Public page surfaces span their containing block, excluding the scrollbar.
   Text and controls keep an inset that also clears a phone's safe area. */
body#page-top:has(> .z-header) {
  --zb-page-inset: max(clamp(16px, 2vw, 32px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --pad: var(--zb-page-inset);
  margin-inline: 0;
}
body#page-top:has(> .z-header) > :is(main, .z-header, .zf-footer) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin-inline: 0;
}
body#page-top .z-header .z-menu-inner,
body#page-top .zf-footer .zf-wrap {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}
body#page-top .zf-footer { --zf-pad: var(--zb-page-inset); }
@media (min-width: 1121px) {
  body#page-top .z-header .z-menu-panel { padding-inline: var(--zb-page-inset); }
}

body#page-top.home-page #main {
  --home-width: 100%;
  --home-inset: var(--zb-page-inset);
}
body#page-top.home-page #main :is(.hm-hero, .hm-vehicles, .hm-story, .hm-visit) {
  margin-inline: 0;
  border-inline: 0;
  border-radius: 0;
}
body#page-top.home-page #main .hm-shop {
  padding-inline: var(--zb-page-inset);
  margin-inline: 0;
}
body#page-top #main > :is(#cars, #range, #compare, .modelBody, .used-detail, .modelhero, .stage, .nextem-brand-section),
body#page-top:has(> .z-header) > main:not(.store-main):not(#main) > section {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin-inline: 0;
}
body#page-top:has(> .z-header) > main:not(.store-main):not(#main) > section { padding-inline: var(--zb-page-inset); }
body#page-top .used-detail,
body#page-top #main .nextem-brand-section { max-width: none; }

body#page-top.shop-public > .store-main { padding-inline: var(--zb-page-inset); }
body#page-top.shop-public > .store-main > :is(.sv-hero, .sv-facility-row, .store-category-hero, .parts-heading) {
  width: auto;
  max-width: none;
  margin-inline: calc(0px - var(--zb-page-inset));
  border-radius: 0;
}
body#page-top.shop-public .store-main > :is(.sv-facility-row, .store-category-hero, .parts-heading) > div { padding-inline: var(--zb-page-inset); }
body#page-top.shop-public .store-main :is(.contact-hub, .sv-price-page, .sv-booking-menu, .vehicle-comparison, .account-page) {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin-inline: 0;
}
body#page-top.shop-public .account-page { padding-inline: 0; }
body#page-top.shop-public .contact-panel form { max-inline-size: 62rem; }

/* Only the outside edge needs an inset when copy and image share a row. */
body#page-top .store-main :is(.sv-hero, .sv-facility-row) > figure {
  box-sizing: border-box;
  min-width: 0;
  padding-inline: var(--zb-page-inset);
}
body#page-top .store-main :is(.store-category-hero, .parts-heading) > img {
  box-sizing: border-box;
  width: 100%;
  padding-inline: var(--zb-page-inset);
}
@media (min-width: 761px) {
  body#page-top.home-page #main :is(.hm-hero, .hm-vehicles, .hm-story.hm-reverse) > figure,
  body#page-top .store-main .sv-hero > figure,
  body#page-top .store-main .sv-facility-row:nth-of-type(even) > figure,
  body#page-top .store-main :is(.store-category-hero, .parts-heading) > img {
    padding-inline-start: 0;
  }
  body#page-top.home-page #main .hm-story:not(.hm-reverse) > figure,
  body#page-top .store-main .sv-facility-row:nth-of-type(odd) > figure {
    padding-inline-end: 0;
  }
}

/* The open panel itself signals the current navigation category. */
body#page-top .z-header :is(#mainnav .z-nav-trigger, #mobile.z-menu-toggle),
body#page-top .z-header #mainnav :is(a, .z-nav-trigger, .z-card-cta, a > span, a > strong),
body#page-top .z-header .z-header-actions a {
  background-color: transparent;
  box-shadow: none;
  text-decoration: none;
  translate: none;
  -webkit-tap-highlight-color: transparent;
}
body#page-top .z-header :is(#mainnav .z-nav-trigger, #mobile.z-menu-toggle) {
  color: var(--zb-ink);
}
body#page-top .z-header :is(.z-menu-shell, .z-menu-panel) {
  background: var(--zb-paper);
  box-shadow: none;
}
body#page-top .z-header .z-nav-backdrop {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body#page-top .z-header #mainnav .z-menu-card:hover .z-card-photo img { transform: none; }

/* Start the caption and the visible photo on the same vertical line. */
body#page-top .z-header #mainnav .z-menu-panel .z-menu-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: start;
  gap: .45rem;
  padding: 0;
}
body#page-top .z-header #mainnav .z-menu-panel .z-menu-card > strong {
  margin: 0 0 0 -.45em;
  line-height: 1.4;
}
body#page-top .z-header #mainnav .z-card-photo { margin: auto 0 0; }
body#page-top .z-header #mainnav .z-card-photo img { margin: 0 auto auto 0; }
body#page-top .z-header .z-menu-directory { min-width: 0; }
body#page-top .z-header .z-directory-heading { margin: 0 0 .45rem; font-family: inherit; font-size: .94rem; font-weight: 600; line-height: 1.4; }
body#page-top .z-header .z-feature-directory { display: grid; gap: 1.35rem; }
body#page-top .z-header .z-feature-directory .z-menu-links {
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.25rem;
}
body#page-top .z-header .z-menu-features .z-menu-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(12px, 1.4vw, 18px);
}
@media (min-width: 1280px) {
  body#page-top .z-header .z-feature-directory { grid-template-columns: minmax(0, 1fr) minmax(11.5rem, .32fr); gap: clamp(1.5rem, 2.2vw, 2.5rem); }
  body#page-top .z-header .z-feature-directory .z-menu-links { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  body#page-top .z-header .z-menu-features .z-menu-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body#page-top .z-header :is(.z-menu-company, .z-menu-catalog) .z-card-photo { max-width: 22rem; }
}
@media (max-width: 400px) {
  body#page-top .z-header .z-feature-directory .z-menu-links { grid-template-columns: minmax(0, 1fr); }
}

/* Give feedback on the selected label while the whole link stays clickable. */
body#page-top .z-header #mainnav .z-menu-panel .z-menu-card > strong,
body#page-top .z-header #mainnav .z-menu-panel :is(.z-menu-links, .z-menu-aside) a > span,
body#page-top .zf-navigation .zf-column a {
  padding-inline: .45em;
  border-radius: .35rem;
  background-color: var(--zb-submenu-feedback, transparent);
  text-decoration: none;
}
body#page-top .z-header #mainnav .z-menu-panel :is(.z-menu-links, .z-menu-aside) a > span,
body#page-top .zf-navigation .zf-column a {
  margin-inline-start: -.45em;
}
@media (hover: hover) and (pointer: fine) {
  body#page-top :is(.z-menu-panel, .zf-navigation) a[href]:hover {
    --zb-submenu-feedback: rgb(23 26 32 / 5%);
  }
}
body#page-top :is(.z-menu-panel, .zf-navigation) a[href]:active {
  --zb-submenu-feedback: rgb(23 26 32 / 8%);
}
body#page-top .z-header #mainnav .z-menu-panel a[href],
body#page-top .zf-navigation a[href] {
  -webkit-tap-highlight-color: rgb(23 26 32 / 5%);
}

/* Mobile and tablet share one inset for navigation, content and footer. */
@media (max-width: 1120px) {
  body#page-top .z-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding-inline: var(--zb-page-inset);
    column-gap: clamp(4px, 1.5vw, 16px);
  }
  body#page-top .z-header .z-logo,
  body#page-top .z-header .z-logo img { max-width: 100%; min-width: 0; }
  body#page-top .z-header .z-menu-shell { padding-inline: var(--zb-page-inset); }
  body#page-top .z-header #mainnav .z-nav-trigger { padding-inline: 0; }
  body#page-top .z-header .z-header-actions { gap: clamp(0px, .5vw, 6px); }
  body#page-top .z-header .z-header-actions a { min-width: 44px; }
  body#page-top .z-header .z-menu-panel :is(a, strong, span) { overflow-wrap: anywhere; }
  body#page-top #main > .used-detail { padding-inline: var(--zb-page-inset); }
  body#page-top .store-main :is(.sv-hero, .sv-facility-row, .store-category-hero, .parts-heading) > div {
    min-width: 0;
    padding-inline: var(--zb-page-inset);
  }
  body#page-top .store-main :is(.account-grid, .sv-book-layout, .sv-fields, .checkout-fields, .contact-grid, .parts-finder-fields) > * {
    min-width: 0;
  }
  body#page-top .store-main form :is(input, select, textarea, fieldset) {
    box-sizing: border-box;
    min-inline-size: 0;
    max-inline-size: 100%;
  }
}
@media (min-width: 641px) and (max-width: 1120px) {
  body#page-top .store-main .sv-dept-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  body#page-top .store-main .sv-book-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body#page-top.home-page #main :is(.hm-hero, .hm-vehicles, .hm-story) { grid-template-columns: minmax(0, 1fr); }
  body#page-top.home-page #main .hm-vehicles .hm-wide-photo { width: 100%; margin-inline: 0; }
  body#page-top .store-main .sv-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  body#page-top .store-main .contact-actions > button { width: 100%; }
  body#page-top .z-header .z-menu-panel:not(.z-menu-features) .z-menu-links { column-gap: 12px; }
  body#page-top .store-main .sv-booking-option {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: .25rem;
  }
  body#page-top .store-main .sv-booking-option > strong { grid-column: 1; white-space: normal; }
  body#page-top .store-main .sv-booking-option > [aria-hidden] { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 360px) {
  body#page-top .z-header .z-header-actions { gap: 0; }
  body#page-top .z-header #mobile { gap: 4px; padding-inline: 0; }
}
