/* EnginesDIY layout correction v1.1 — loaded after authority-v1.css */

/* Desktop header: remove the mixed legacy/new layout and establish one grid. */
@media (min-width: 768px) {
  .header.header-compact,
  .header-compact .header-slim-wrapper,
  .header-compact .top-bar,
  .header-compact .mid-bar {
    background: #10151b !important;
  }

  .header-compact .header-slim-wrapper {
    width: 100% !important;
    max-width: none !important;
    min-height: 126px !important;
    border: 0 !important;
  }

  .header-compact .top-bar {
    width: min(calc(100% - 48px), 1420px) !important;
    height: 34px !important;
    min-height: 34px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.07) !important;
  }

  .header-compact .mid-bar {
    display: grid !important;
    grid-template-columns: 180px 154px minmax(360px, 1fr) 340px;
    grid-template-rows: 92px;
    column-gap: 18px;
    align-items: center;
    width: min(calc(100% - 48px), 1420px) !important;
    height: 92px !important;
    min-height: 92px !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }

  .header-compact .desktop-logo-wrapper {
    grid-column: 1;
    grid-row: 1;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 180px !important;
    min-width: 0 !important;
    height: 92px !important;
    padding: 0 !important;
    margin: 0 !important;
    order: 0 !important;
  }

  .header-compact .desktop-logo-wrapper img {
    display: block;
    width: auto !important;
    max-width: 132px !important;
    max-height: 76px !important;
    margin: 0 !important;
  }

  .header-compact .desktop-logo-wrapper::after {
    content: none !important;
    display: none !important;
  }

  .header-compact .desktop-main-menu-wrapper.menu-top {
    grid-column: 2;
    grid-row: 1;
    width: 154px !important;
    min-width: 0 !important;
    height: 44px !important;
    margin: 0 !important;
    order: 0 !important;
  }

  .header-compact .desktop-search-wrapper {
    grid-column: 3;
    grid-row: 1;
    width: auto !important;
    min-width: 0 !important;
    height: 44px !important;
    margin: 0 !important;
    order: 0 !important;
  }

  .header-compact .header-search {
    width: 100% !important;
    height: 44px !important;
    margin: 0 !important;
    border-radius: 10px !important;
  }

  .header-compact .header-cart-group {
    grid-column: 4;
    grid-row: 1;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    align-self: center;
    width: 340px !important;
    min-width: 0 !important;
    min-height: 58px !important;
    height: 58px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    order: 0 !important;
    background: rgba(255,255,255,.045) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
  }

  .header-compact .header-cart-group a,
  .header-compact .header-cart-group .menu-item > a,
  .header-compact .header-cart-group .menu-item > a > span {
    color: #f3f5f6 !important;
  }

  .header-compact .header-cart-group .menu-item .links-text,
  .header-compact .header-cart-group .menu-item .count-badge {
    color: #aeb7bf !important;
  }

  .header-compact .cart-heading {
    min-height: 40px !important;
    margin: 0 !important;
    background: #b96832 !important;
    border-color: #b96832 !important;
  }

  .header-compact .desktop-main-menu-wrapper.menu-bar {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    max-width: none !important;
    height: 46px !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #1a222c !important;
    border-top: 1px solid rgba(255,255,255,.06) !important;
    box-shadow: 0 8px 22px rgba(0,0,0,.16) !important;
  }

  .header-compact .desktop-main-menu-wrapper.menu-bar > .main-menu-1 {
    width: min(calc(100% - 48px), 1420px) !important;
    max-width: 1420px !important;
    height: 46px !important;
    margin: 0 auto !important;
    background: transparent !important;
  }

  .header-compact .desktop-main-menu-wrapper.menu-bar .j-menu {
    justify-content: center !important;
    height: 46px !important;
  }

  .header-compact .desktop-main-menu-wrapper.menu-bar .j-menu > li > a {
    min-height: 46px !important;
    padding: 0 24px !important;
  }
}

/* Keep the authority rail aligned with the same desktop canvas. */
@media (min-width: 1280px) {
  .ed-trust-rail {
    padding-left: calc((100vw - 1280px) / 2) !important;
    padding-right: calc((100vw - 1280px) / 2) !important;
  }
}

/* First screen: authoritative but not oversized. */
@media (min-width: 768px) {
  .ed-brand-hero,
  .ed-brand-hero__grid {
    min-height: 540px !important;
  }

  .ed-brand-hero__grid {
    padding-top: 54px !important;
    padding-bottom: 54px !important;
  }

  .ed-brand-hero__copy {
    max-width: 650px !important;
  }

  .ed-brand-hero__title {
    max-width: 650px !important;
    margin: 16px 0 16px !important;
    font-size: clamp(44px, 4vw, 64px) !important;
    line-height: 1.01 !important;
    letter-spacing: -.04em !important;
  }

  .ed-brand-hero__lead {
    max-width: 600px !important;
    font-size: 16px !important;
    line-height: 1.62 !important;
  }

  .ed-brand-hero__actions {
    margin-top: 25px !important;
  }

  .ed-brand-hero__chips {
    margin-top: 24px !important;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .header-compact .mid-bar {
    grid-template-columns: 138px 138px minmax(280px, 1fr) 275px;
    column-gap: 12px;
  }

  .header-compact .desktop-logo-wrapper {
    width: 138px !important;
  }

  .header-compact .desktop-main-menu-wrapper.menu-top {
    width: 138px !important;
  }

  .header-compact .header-cart-group {
    width: 275px !important;
  }
}

/* Preserve the validated mobile header and purchasing path. */
@media (max-width: 767px) {
  .ed-brand-hero,
  .ed-brand-hero__grid {
    min-height: 540px !important;
  }

  .ed-brand-hero__title {
    font-size: clamp(36px, 10.7vw, 42px) !important;
  }
}

/* Legacy promotional overlay remains disabled. */
.module-popup-110 { display: none !important; }

/* Homepage cleanup: retire expired, duplicate, or empty legacy modules. */
html.route-common-home .grid-row-top-5,
html.route-common-home .grid-row-top-7,
html.route-common-home .grid-row-top-9,
html.route-common-home .grid-row-bottom-2,
html.route-common-home .grid-row-bottom-3,
html.route-common-home footer .grid-row-1.fullwidth-row {
  display: none !important;
}

/* Keep the useful discovery banners, but remove the dated #newstore headline. */
html.route-common-home .grid-row-top-2 {
  padding-top: 54px !important;
  padding-bottom: 48px !important;
  background: #fff !important;
}

html.route-common-home .module-banners_grid-563 {
  width: min(calc(100% - 48px), 1280px) !important;
  max-width: 1280px !important;
  height: auto !important;
  margin: 0 auto !important;
}

html.route-common-home .module-banners_grid-563 > .module-title {
  display: none !important;
}

html.route-common-home .module-banners_grid-563 .module-body,
html.route-common-home .module-banners_grid-563 .banners-grid {
  height: auto !important;
}

/* Main product discovery section: center the three curated products. */
html.route-common-home .grid-row-top-4 {
  padding-top: 62px !important;
  padding-bottom: 62px !important;
  background: #f1f3f3 !important;
}

html.route-common-home .module-products-448,
html.route-common-home .module-button-263 {
  width: min(calc(100% - 48px), 1040px) !important;
  max-width: 1040px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

html.route-common-home .module-products-448 .module-body,
html.route-common-home .module-products-448 .tab-container,
html.route-common-home .module-products-448 .nav-tabs {
  width: 100% !important;
  max-width: 100% !important;
}

html.route-common-home .module-products-448 .nav-tabs {
  margin-bottom: 30px !important;
}

html.route-common-home .module-products-448 .product-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 22px !important;
  width: 100% !important;
  max-width: 960px !important;
  margin: 0 auto !important;
  overflow: visible !important;
}

html.route-common-home .module-products-448 .product-layout {
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
}

/* Authority section: reduce the editorial headline to a balanced desktop scale. */
html.route-common-home .ed-authority-story {
  margin-top: 72px !important;
}

html.route-common-home .ed-authority-story h2 {
  max-width: 650px;
  font-size: clamp(38px, 3.2vw, 50px) !important;
  line-height: 1.06 !important;
}

/* Testimonials: show four complete cards instead of an overflowing strip. */
html.route-common-home .grid-row-bottom-1 {
  padding-top: 64px !important;
  padding-bottom: 64px !important;
  background: #fff !important;
}

html.route-common-home .module-testimonials-256 {
  width: min(calc(100% - 48px), 1420px) !important;
  max-width: 1420px !important;
  height: auto !important;
  margin: 0 auto !important;
  overflow: hidden !important;
}

html.route-common-home .module-testimonials-256 .module-body,
html.route-common-home .module-testimonials-256 .no-scroll.auto-grid {
  width: 100% !important;
  max-width: 100% !important;
}

html.route-common-home .module-testimonials-256 .no-scroll.auto-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 1px !important;
  margin: 0 !important;
  overflow: hidden !important;
}

html.route-common-home .module-testimonials-256 .module-item {
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
}

html.route-common-home .module-testimonials-256 .module-item:nth-child(n+5) {
  display: none !important;
}

@media (max-width: 767px) {
  html.route-common-home .grid-row-top-2,
  html.route-common-home .grid-row-top-4,
  html.route-common-home .grid-row-bottom-1 {
    padding-top: 38px !important;
    padding-bottom: 38px !important;
  }

  html.route-common-home .module-banners_grid-563,
  html.route-common-home .module-products-448,
  html.route-common-home .module-button-263,
  html.route-common-home .module-testimonials-256 {
    width: calc(100% - 30px) !important;
  }

  html.route-common-home .module-products-448 .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  html.route-common-home .module-testimonials-256 .no-scroll.auto-grid {
    grid-template-columns: 1fr !important;
  }

  html.route-common-home .module-testimonials-256 .module-item:nth-child(n+4) {
    display: none !important;
  }
}

html.route-common-home .module-products-448 .product-layout{width:100%!important}
html.route-common-home .module-testimonials-256 .module-item,html.route-common-home .module-testimonials-256 .module-item>*{width:100%!important;min-width:0!important}

html.route-common-home .module-products-448 .product-layout{width:100%!important}
html.route-common-home .module-testimonials-256 .module-item,html.route-common-home .module-testimonials-256 .module-item>*{width:100%!important;min-width:0!important}

html.route-common-home .module-products-448 .product-grid{display:block!important}
html.route-common-home .module-products-448 .auto-grid-items{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:22px!important;width:100%!important;max-width:960px!important;margin:0 auto!important}
html.route-common-home .module-products-448 .auto-carousel-controls{display:none!important}
html.route-common-home .module-testimonials-256 .no-scroll.auto-grid{display:block!important}
html.route-common-home .module-testimonials-256 .auto-grid-items{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:1px!important;width:100%!important;max-width:100%!important;margin:0!important}
html.route-common-home .module-testimonials-256 .auto-carousel-controls{display:none!important}

html.route-common-home .module-products-448 .product-grid{display:block!important}
html.route-common-home .module-products-448 .auto-grid-items{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:22px!important;width:100%!important;max-width:960px!important;margin:0 auto!important}
html.route-common-home .module-products-448 .auto-carousel-controls{display:none!important}
html.route-common-home .module-testimonials-256 .no-scroll.auto-grid{display:block!important}
html.route-common-home .module-testimonials-256 .auto-grid-items{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:1px!important;width:100%!important;max-width:100%!important;margin:0!important}
html.route-common-home .module-testimonials-256 .auto-carousel-controls{display:none!important}

html.route-common-home .module-products-448 .auto-grid-items,html.route-common-home .module-testimonials-256 .auto-grid-items{padding:0!important}

html.route-common-home .module-products-448 .auto-grid-items,html.route-common-home .module-testimonials-256 .auto-grid-items{padding:0!important}

@media(max-width:767px){
html.route-common-home .module-products-448 .auto-grid-items{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important}
html.route-common-home .module-testimonials-256 .auto-grid-items{grid-template-columns:1fr!important;gap:12px!important}
.ed-trust-rail{scrollbar-width:none!important;-ms-overflow-style:none!important}
.ed-trust-rail::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}
}
@media(max-width:767px){
html.route-common-home .module-products-448 .auto-grid-items{grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-flow:row!important;grid-auto-columns:minmax(0,1fr)!important;gap:12px!important}
html.route-common-home .module-testimonials-256 .auto-grid-items{grid-template-columns:1fr!important;grid-auto-flow:row!important;grid-auto-columns:minmax(0,1fr)!important;gap:12px!important}
}
@media(max-width:767px){
html.route-common-home .module-products-448 .auto-grid-items{grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-flow:row!important;grid-auto-columns:minmax(0,1fr)!important;gap:12px!important}
html.route-common-home .module-testimonials-256 .auto-grid-items{grid-template-columns:1fr!important;grid-auto-flow:row!important;grid-auto-columns:minmax(0,1fr)!important;gap:12px!important}
}