/* Overrides when legacy Bootstrap/main.css is loaded on new-design pages */

/* Bootstrap .nav makes <nav class="nav"> a flex container, which centers .nav-inner */
.nd-layout .header > .nav {
  display: block;
}

.nd-layout .header .nav-inner {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  margin-top: 0;
  margin-bottom: 0;
  padding: 0 18px;
  gap: 6px;
  overflow-x: auto;
  flex-wrap: nowrap;
  list-style: none;
}

.nd-layout .header .nav-inner > a,
.nd-layout .header .nav-inner > button {
  flex: 0 0 auto;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  text-decoration: none;
}

.nd-layout .header .nav-inner > a.active,
.nd-layout .header .nav-inner > a:hover,
.nd-layout .header .nav-inner > button.active,
.nd-layout .header .nav-inner > button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-bottom-color: var(--yellow);
}

/* Keep footer columns in the designed grid positions */
.nd-layout .nd-footer .nd-footer-shell,
.nd-layout .nd-footer .nd-footer-grid,
.nd-layout .nd-footer .nd-footer-col,
.nd-layout .nd-footer .nd-footer-contact-body {
  float: none !important;
}

.nd-layout .nd-footer-grid {
  display: grid !important;
  grid-template-columns: minmax(300px, 1.65fr) minmax(150px, 0.75fr) minmax(220px, 1fr) !important;
  gap: 28px 36px !important;
  align-items: start;
  width: 100%;
}

.nd-layout .nd-footer-col {
  display: block;
  min-width: 0;
}

/* main.css floats all headings, which breaks the contact column stack */
.nd-layout .nd-footer h1,
.nd-layout .nd-footer h2,
.nd-layout .nd-footer h3,
.nd-layout .nd-footer h4,
.nd-layout .nd-footer h5,
.nd-layout .nd-footer h6,
.nd-layout .nd-footer .nd-footer-heading {
  float: none !important;
  width: auto !important;
  max-width: 100%;
  clear: none;
  font-family: inherit;
}

.nd-layout .nd-footer .nd-footer-heading {
  margin: 0 0 16px;
  color: var(--yellow);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}

.nd-layout .nd-footer-subhead {
  float: none !important;
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: 100% !important;
  max-width: 100%;
  margin: 0 0 12px;
  clear: both;
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
}

.nd-layout .nd-footer-locations {
  column-count: 2 !important;
  column-gap: 28px;
  column-rule: 1px solid rgba(255, 255, 255, 0.14);
  width: 100% !important;
  clear: both;
}

.nd-layout .nd-footer-locations--stack {
  column-count: 1 !important;
  column-rule: none;
}

.nd-layout .nd-footer-links {
  display: grid !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 10px;
  float: none !important;
}

.nd-layout .nd-footer-links li {
  float: none !important;
  margin: 0 !important;
}

.nd-layout .nd-footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
}

.nd-layout .nd-footer-map-slot {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
}

.nd-layout .nd-footer-map-slot iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 200px;
  border: 0;
}

.nd-layout .nd-footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.nd-layout .nd-footer-bottom,
.nd-layout .nd-footer-bottom-inner {
  float: none !important;
}

.nd-layout .nd-contact h1,
.nd-layout .nd-contact h2,
.nd-layout .nd-contact h3,
.nd-layout .nd-contact h4,
.nd-layout .nd-contact h5,
.nd-layout .nd-contact h6,
.nd-layout .nd-contact .control-label,
.nd-layout .nd-contact label {
  float: none !important;
  width: auto !important;
  max-width: 100%;
  clear: none;
}

/* Contain legacy floated contact form blocks so footer stays below content */
.nd-layout .page.nd-contact,
.nd-layout .nd-contact .nd-contact-shell,
.nd-layout .nd-contact .nd-contact-form-root {
  display: flow-root;
}

.nd-layout .nd-contact .nd-contact-form-root,
.nd-layout .nd-contact .mainContent,
.nd-layout .nd-contact .entry_door,
.nd-layout .nd-contact .entryDoorBlock,
.nd-layout .nd-contact .contact-opacity,
.nd-layout .nd-contact .form-horizontal,
.nd-layout .nd-contact .form-group,
.nd-layout .nd-contact .row,
.nd-layout .nd-contact [class*="col-"] {
  float: none !important;
  clear: none !important;
}

.nd-layout .nd-contact .nd-contact-form-root {
  width: 100%;
  margin-bottom: 0;
}

.nd-layout .page.nd-cms-page,
.nd-layout .nd-cms-page .nd-cms-shell,
.nd-layout .nd-cms-page .nd-cms-content-wrap,
.nd-layout .nd-cms-page .main-page,
.nd-layout .nd-cms-page .static_pages {
  display: flow-root;
}

.nd-layout .nd-cms-page .nd-cms-content-wrap,
.nd-layout .nd-cms-page .main-page,
.nd-layout .nd-cms-page .static_pages,
.nd-layout .nd-cms-page .static_pages h1,
.nd-layout .nd-cms-page .static_pages h2,
.nd-layout .nd-cms-page .static_pages h3,
.nd-layout .nd-cms-page .static_pages h4,
.nd-layout .nd-cms-page .static_pages h5,
.nd-layout .nd-cms-page .static_pages h6 {
  float: none !important;
  clear: none;
}

/* Auth forms: legacy main.css sets .productbaselisting.car-lists .btn { width: 100% } */
.nd-layout .nd-account--auth .productbaselisting.car-lists .btn.actn-btn,
.nd-layout .nd-account--auth .car-lists.productbaselisting .btn.actn-btn,
.nd-layout .nd-account--auth .nd-auth-actions .btn.actn-btn {
  width: auto !important;
  max-width: 100%;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.nd-layout .nd-account--auth .form-group.mb-0,
.nd-layout .nd-account--auth .nd-auth-actions {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  float: none !important;
}

.nd-layout .nd-account--auth .form-group.mb-0 .actn-btn + .actn-btn,
.nd-layout .nd-account--auth .nd-auth-actions .nd-auth-cancel {
  background: transparent !important;
  color: var(--blue-900) !important;
  border: 2px solid var(--blue-900) !important;
}

.nd-layout .nd-account--auth .form-group.mb-0 .actn-btn + .actn-btn:hover,
.nd-layout .nd-account--auth .nd-auth-actions .nd-auth-cancel:hover {
  background: rgba(15, 59, 120, 0.06) !important;
}

.nd-layout .nd-account--auth .removebuttons {
  display: none !important;
}

.nd-layout .nd-account--auth #signup_footer {
  width: auto !important;
  max-width: 100%;
}

/* Mobile: restore responsive.css behavior (this file loads after responsive.css) */
@media (max-width: 1050px) {
  .nd-layout .header > .nav {
    display: none !important;
  }

  .nd-layout .nd-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 24px 20px !important;
  }

  .nd-layout .nd-footer-locations {
    column-count: 1 !important;
    column-rule: none !important;
  }

  .nd-layout .nd-footer-map-slot {
    max-width: 100% !important;
    width: 100% !important;
  }
}

@media (max-width: 650px) {
  .nd-layout .nd-footer-grid {
    grid-template-columns: 1fr !important;
  }

  .nd-layout .nd-footer-shell {
    padding: 28px 14px 24px !important;
  }
}
