/* v228 — align the desktop layout with the Shopify reference. Mobile is unchanged. */
@media (min-width: 1101px) {
  body .catalog-search {
    width: min(1000px, calc(100% - 64px)) !important;
    max-width: 1000px !important;
    margin: 12px auto 11px !important;
  }

  body .catalog-search > div {
    min-height: 78px !important;
    padding-inline: 24px !important;
  }

  body .catalog-search input {
    height: 76px !important;
    font-size: 17px !important;
  }

  body .quick-finder {
    padding-block: 15px !important;
  }

  body .finder-inner {
    width: min(1500px, calc(100% - 64px)) !important;
    grid-template-columns: 205px repeat(3, minmax(0, 1fr)) 156px !important;
    gap: 16px !important;
  }

  body .finder-title {
    font-size: 20px !important;
  }

  body .finder-inner select,
  body .finder-inner button {
    height: 65px !important;
    min-height: 65px !important;
    font-size: 16px !important;
  }

  body .finder-inner select {
    padding-inline: 22px 40px !important;
  }

  body .finder-inner button {
    padding-inline: 18px !important;
  }

  body .repair-hero {
    width: min(1550px, calc(100% - 80px)) !important;
    min-height: 432px !important;
    margin: 16px auto 30px !important;
    padding: 30px 30px 28px !important;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.1fr) !important;
    gap: 28px 24px !important;
  }

  body .repair-hero-copy {
    max-width: 560px !important;
  }

  body .repair-hero-visual {
    min-height: 290px !important;
    border-radius: 16px !important;
  }

  body .repair-hero-links {
    gap: 10px !important;
  }

  body .repair-hero-links a {
    min-height: 54px !important;
    font-size: 13px !important;
  }
}

@media (min-width: 1451px) {
  body .header .header-inner {
    width: min(1680px, calc(100% - 96px)) !important;
    max-width: 1680px !important;
    min-width: 0 !important;
    gap: 18px !important;
  }

  body .header .brand {
    width: 330px !important;
    min-width: 330px !important;
    flex: 0 0 330px !important;
  }

  body .header .structure-nav {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    gap: 14px !important;
    white-space: nowrap !important;
  }

  body .header .structure-nav > a,
  body .header .nav-mega > summary {
    font-size: 14px !important;
  }

  body .header .header-phones {
    min-width: 0 !important;
    flex: 0 0 auto !important;
    padding-left: 16px !important;
  }

  body .header .header-phones .header-phone {
    font-size: 14px !important;
  }
}

/* Outrank earlier homepage and category compaction rules. */
@media (min-width: 1101px) {
  body.storefront.home-page > .catalog-search,
  body.storefront.category-page > .catalog-search {
    width: min(1000px, calc(100% - 64px)) !important;
    max-width: 1000px !important;
    margin: 12px auto 11px !important;
  }

  body.storefront.home-page .catalog-search > div,
  body.storefront.category-page .catalog-search > div {
    min-height: 78px !important;
    padding-inline: 24px !important;
  }

  body.storefront.home-page .catalog-search input,
  body.storefront.category-page .catalog-search input {
    height: 76px !important;
    font-size: 17px !important;
  }

  body.storefront.home-page .quick-finder,
  body.storefront.category-page .quick-finder {
    padding-block: 15px !important;
  }

  body.storefront.home-page .finder-inner,
  body.storefront.category-page .finder-inner {
    width: min(1500px, calc(100% - 64px)) !important;
    grid-template-columns: 205px repeat(3, minmax(0, 1fr)) 156px !important;
    gap: 16px !important;
  }

  body.storefront.home-page .finder-title,
  body.storefront.category-page .finder-title {
    font-size: 20px !important;
  }

  body.storefront.home-page .finder-inner select,
  body.storefront.home-page .finder-inner button,
  body.storefront.category-page .finder-inner select,
  body.storefront.category-page .finder-inner button {
    height: 65px !important;
    min-height: 65px !important;
    font-size: 16px !important;
  }

  body.storefront.home-page .finder-inner select,
  body.storefront.category-page .finder-inner select {
    padding-inline: 22px 40px !important;
  }

  body.storefront.home-page .finder-inner button,
  body.storefront.category-page .finder-inner button {
    padding-inline: 18px !important;
  }

  body.storefront.home-page .repair-hero,
  body.storefront.category-page .repair-hero {
    width: min(1550px, calc(100% - 80px)) !important;
    min-height: 432px !important;
    margin: 16px auto 30px !important;
    padding: 30px 30px 28px !important;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.1fr) !important;
    gap: 28px 24px !important;
  }

  body.storefront.home-page .repair-hero-copy,
  body.storefront.category-page .repair-hero-copy {
    max-width: 560px !important;
  }

  body.storefront.home-page .repair-hero-visual,
  body.storefront.category-page .repair-hero-visual {
    min-height: 290px !important;
    border-radius: 16px !important;
  }

  body.storefront.home-page .repair-hero-links,
  body.storefront.category-page .repair-hero-links {
    gap: 10px !important;
  }

  body.storefront.home-page .repair-hero-links a,
  body.storefront.category-page .repair-hero-links a {
    min-height: 54px !important;
    font-size: 13px !important;
  }
}

/* Desktop header correction: Shopify-sized logo and readable navigation, with the phone links kept close to Contact. */
@media (min-width: 1451px) {
  body .header .header-inner {
    width: min(1680px, calc(100% - 96px)) !important;
    max-width: 1680px !important;
    justify-content: flex-start !important;
    gap: 8px !important;
  }

  body .header .brand {
    width: 300px !important;
    min-width: 0 !important;
    flex: 0 1 300px !important;
  }

  body .header .structure-nav {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    gap: 8px !important;
    margin-left: 12px !important;
  }

  body .header .structure-nav > a,
  body .header .nav-mega > summary {
    font-size: clamp(15px, 1vw, 16px) !important;
  }

  body .header .header-phones {
    flex: 0 0 auto !important;
    margin-left: 8px !important;
    padding-left: 12px !important;
  }

  body .header .header-phones .header-phone {
    font-size: 13px !important;
  }
}

/* Responsive desktop navigation: full row on compact laptops, menu button below the fit threshold. */
@media (min-width: 1240px) and (max-width: 1450px) {
  body .header .header-inner {
    width: calc(100% - 48px) !important;
    gap: 8px !important;
    justify-content: flex-start !important;
  }

  body .header .brand {
    width: clamp(195px, 17vw, 245px) !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
  }

  body .header .brand-art { max-width: 100% !important; }

  body .header .structure-nav {
    display: flex !important;
    position: relative !important;
    inset: auto !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 1 auto !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    gap: clamp(5px, .5vw, 8px) !important;
    white-space: nowrap !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body .header .structure-nav > a,
  body .header .structure-nav > .nav-mega > summary {
    display: block !important;
    width: auto !important;
    padding: 12px 0 !important;
    font-size: clamp(12px, .95vw, 14px) !important;
    white-space: nowrap !important;
  }

  body .header .header-phones {
    display: flex !important;
    flex: 0 0 auto !important;
    margin-left: 4px !important;
    padding-left: 10px !important;
  }

  body .header .header-phones .header-phone { font-size: 12px !important; }
  body .header .menu-toggle { display: none !important; }
  body .header .structure-nav .mega-panel {
    position: absolute !important;
    top: calc(100% - 1px) !important;
    left: 0 !important;
    right: 0 !important;
  }
}

@media (min-width: 761px) and (max-width: 1239px) {
  body .header { height: auto !important; min-height: 88px !important; }
  body .header .header-inner {
    width: calc(100% - 48px) !important;
    gap: 12px !important;
    position: relative !important;
  }
  body .header .brand {
    width: clamp(190px, 22vw, 260px) !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
  }
  body .header .brand-art { max-width: 100% !important; }
  body .header .header-phones { display: none !important; }
  body .header .menu-toggle {
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    flex: 0 0 44px !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin-left: auto !important;
    padding: 5px !important;
    border: 1px solid #bdb5ae !important;
    border-radius: 10px !important;
    background: transparent !important;
  }
  body .header .structure-nav {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    z-index: 50 !important;
    width: min(480px, calc(100vw - 48px)) !important;
    margin: 0 !important;
    padding: 12px 20px 18px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    white-space: normal !important;
    background: var(--paper, #fff) !important;
    border: 1px solid var(--line) !important;
    border-radius: 0 0 16px 16px !important;
    box-shadow: 0 12px 24px rgba(17, 24, 39, .14) !important;
  }
  body .header .structure-nav.is-open { display: flex !important; }
  body .header .structure-nav > a,
  body .header .structure-nav > .nav-mega > summary {
    display: block !important;
    width: 100% !important;
    padding: 12px 4px !important;
    font-size: 14px !important;
  }
  body .header .structure-nav .mega-panel {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    margin-top: 8px !important;
    box-shadow: none !important;
  }
}
