/* CP364: targeted visual repairs for the wide Hero, model registry and contacts. */

@media (min-width: 1024px) {
  /* Keep the current two-column Hero design while letting its canvas reach the viewport edges. */
  html body.pg-fx-visual-repair.pg-page-home .pgd-hero-section > .pg-home-hero-inner {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    padding-inline: clamp(24px, 3vw, 56px) !important;
  }

  /* The catalogue stays readable and centered instead of stretching each result across the screen. */
  html body.pg-fx-visual-repair .page > main#main > .models-container {
    width: min(92%, 1360px) !important;
    max-width: 1360px !important;
    min-width: 0 !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
    box-sizing: border-box !important;
  }

  /* Put both secondary filters on the same row and align their labels and controls. */
  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .filter-panel {
    align-items: end !important;
  }

  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .filter-panel > .pg-filter-disclosure {
    display: block !important;
    grid-column: 2 / 4 !important;
    min-width: 0 !important;
  }

  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-filter-disclosure > summary {
    display: none !important;
  }

  html body.pg-fx-visual-repair.pg-page-registry.pg-posguard-template .pg-filter-disclosure-fields {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: end !important;
    gap: 16px !important;
    min-width: 0 !important;
  }
}

@media (min-width: 769px) and (max-width: 1023px) {
  html body.pg-fx-visual-repair .page > main#main > .models-container {
    width: min(96%, 1360px) !important;
    max-width: 1360px !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
  }
}

@media (max-width: 768px) {
  html body.pg-fx-visual-repair .pg-public-page .pg-partner-hero {
    gap: 18px !important;
    padding: 20px 16px !important;
  }

  html body.pg-fx-visual-repair .page > main#main .pg-public-page .pg-partner-signal {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    justify-items: end !important;
    gap: 3px 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 12px 15px !important;
    box-sizing: border-box !important;
  }

  html body.pg-fx-visual-repair .pg-public-page .pg-partner-signal > strong {
    grid-column: 1 !important;
    grid-row: 1 / 3 !important;
    justify-self: start !important;
    font-size: clamp(1.25rem, 5vw, 1.55rem) !important;
    line-height: 1.1 !important;
  }

  html body.pg-fx-visual-repair .pg-public-page .pg-partner-signal > span,
  html body.pg-fx-visual-repair .pg-public-page .pg-partner-signal > small {
    grid-column: 2 !important;
    justify-self: end !important;
    max-width: 100% !important;
    text-align: right !important;
    overflow-wrap: anywhere !important;
  }

  html body.pg-fx-visual-repair .page > main#main > .models-container {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-inline: 0 !important;
    padding-inline: 16px !important;
    box-sizing: border-box !important;
  }
}

/* Phone labels and numbers remain on one aligned line in both languages. */
html body.pg-fx-visual-repair .pg-public-contact-copy {
  width: 100% !important;
}

html body.pg-fx-visual-repair .page > main#main .pg-public-page .pg-public-contact-grid .pg-public-contact-card--phones .pg-public-contact-copy > a.pg-public-phone-link {
  display: flex !important;
  align-items: baseline !important;
  justify-content: flex-start !important;
  justify-self: stretch !important;
  width: 100% !important;
  gap: 5px !important;
  white-space: nowrap !important;
}

html body.pg-fx-visual-repair .pg-public-phone-link > span {
  flex: 0 0 auto !important;
  margin-inline-end: 1px !important;
}

@media (min-width: 361px) and (max-width: 700px) {
  html body.pg-fx-visual-repair .pg-public-contact-card--phones,
  html body.pg-fx-visual-repair .pg-public-contact-grid > .pg-public-contact-card[href^="mailto:"] {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 700px) {
  html body.pg-fx-visual-repair .pg-public-contact-copy > .pg-public-phone-link {
    font-size: 13px !important;
  }

  html body.pg-fx-visual-repair .pg-public-phone-link > span {
    font-size: 12px !important;
  }
}

/* First-visit consent stays above the header in the document flow; it never covers the page. */
html body.pg-fx-visual-repair #pg-cookie-banner.pg-cookie-banner,
html body.pg-fx-visual-repair #pg-cookie-banner.pg-cookie-banner.pg-consent-flow {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 50 !important;
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  overflow: visible !important;
  border-radius: 0 !important;
  transform: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

html body.pg-fx-visual-repair #pg-cookie-banner.pg-cookie-banner.is-visible {
  transform: none !important;
}

html body.pg-fx-visual-repair #pg-cookie-banner.pg-cookie-banner[hidden] {
  display: none !important;
}

html body.pg-fx-visual-repair #pg-cookie-banner .pg-cookie-actions {
  gap: 8px !important;
}

html body.pg-fx-visual-repair #pg-cookie-banner .pg-cookie-actions .pg-consent-btn {
  min-height: 44px !important;
}

@media (prefers-reduced-motion: reduce) {
  html body.pg-fx-visual-repair .pg-public-contact-card,
  html body.pg-fx-visual-repair .model-card {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
