/* CP383: final responsive card grids and 44px mobile/tablet controls. */
@media (min-width: 1024px) {
  html body.pg-page-home :is(.pgd-products#products .pgd-product-grid, .pg-sector-grid, .pgm-accessory-grid, .pgm-category-grid) {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (min-width: 769px) and (max-width: 1023px) {
  html body.pg-page-home :is(.pgd-products#products .pgd-product-grid, .pg-sector-grid, .pgm-accessory-grid, .pgm-category-grid) {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  html body.pg-page-home :is(.pgd-products#products .pgd-product-grid, .pg-sector-grid, .pgm-accessory-grid, .pgm-category-grid) {
    grid-template-columns: 1fr !important;
  }

  html body.pg-page-home .pgd-products#products .pgd-product-grid > .pgd-product-card-featured {
    grid-column: auto !important;
    grid-row: auto !important;
  }
}

@media (max-width: 1023px) {
  html body.pg-visual-system.pg-page-home main#main :is(
    a.cta,
    button.cta,
    a.pgd-btn,
    button.pgd-btn,
    a.btn-primary,
    button.btn-primary,
    .pgd-cms-quote,
    .pg-quote-add,
    .pg-home-calc-cta,
    .pg-filter-open,
    .pg-catalogue-card-quote,
    .pg-bf-primary,
    .pg-quote-submit,
    [role="button"]
  ),
  html body.pg-visual-system.pg-page-home :is(.pgd-hero, .pgd-hero-copy, .pgm-copy, .pgm-actions, .hero-actions, .pgd-hero-actions, .pg-home-mobile-tools) :is(a[href], button, [role="button"]),
  html body.pg-visual-system :is(.pg-home-header, .pg-site-header) :is(.header-actions a[href], .lang-switch a[href], button, [role="button"]),
  html body.pg-visual-system :is(.pg-product-quote-builder, .pg-quote-cart-bar) :is(a[href], button, [role="button"]),
  html body.pg-visual-system :is(.pg-quote-cart-bar .cta, .pg-quote-cart-clear, .pg-mega-trigger, .mobile-link) {
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  html body.pg-visual-system.pg-page-home .pg-home-mobile-tools :is(.pg-home-mobile-contact, .mobile-menu) {
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  html body.pg-visual-system :is(
    .pg-home-mobile-tools,
    .pg-site-header .header-actions,
    .pg-site-header .lang-switch,
    .pg-home-header .header-actions,
    .pg-home-header .lang-switch,
    .pg-header-search-mobile,
    .pg-catalogue-toolbar,
    .pg-catalogue-brand-tabs,
    .pg-catalogue-view-toggle,
    .pg-catalogue-filters,
    .pg-card-actions,
    .pg-catalogue-card-actions,
    .hero-actions,
    .pgm-actions,
    .pgd-hero-actions,
    .pg-footer-social,
    .pg-contact-social,
    .pghf-social,
    .pghf-company-social,
    .footer-links,
    .pg-sticky-actions,
    .pg-quote-cart-bar,
    .pg-product-quote-builder
  ) {
    gap: 10px !important;
  }

  html body.pg-visual-system :is(.pg-catalogue-view-toggle button, .pg-catalogue-brand-tabs a, .pg-catalogue-card-actions a, .pg-card-actions a, .pg-footer-social a, .pg-contact-social a, .pghf-social a, .pghf-company-social a, .pg-sticky-actions a, .pg-sticky-actions button) {
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

html body.pg-visual-system .pg-product-quote-builder {
  gap: 10px !important;
}

/* CP384: color-only section rhythm and transparent product depth; no geometry changes. */
html body.pg-visual-system main > section:nth-of-type(even) {
  background-color: #111622 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -1px 0 rgba(255, 255, 255, 0.06) !important;
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px) !important;
  background-size: 24px 24px !important;
}

html body.pg-visual-system :is(.product-card, .model-card) img,
html body.pg-visual-system .page :is(.pg-fx-product-stage, .pg-catalogue-card-image, .pg-media30-item, .pg-hq-media30-item, .pg-stand-art, .pg-360-card-art, .pg-360-stand-art, .pg-footer-stand-image) > img,
html body.pg-visual-system .page :is(.pg-fx-product-stage, .pg-catalogue-card-image, .pg-media30-item, .pg-hq-media30-item, .pg-stand-art, .pg-360-card-art, .pg-360-stand-art, .pg-footer-stand-image) picture > img {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55)) !important;
}

/* CP385: homepage logo motion, equal desktop cards, top-flow consent and category H1 fit. */
@keyframes pg385HeroLogoSway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

@media (prefers-reduced-motion: no-preference) {
  html body.pg-page-home .pg-site-header .logo img {
    transform-origin: center center;
    will-change: transform;
    animation: pg385HeroLogoSway 4.5s ease-in-out infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body.pg-page-home .pg-site-header .logo img {
    animation: none !important;
    will-change: auto;
  }
}

@media (min-width: 1024px) {
  html body.pg-visual-system.pg-page-home main#main {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
  }

  html body.pg-visual-system.pg-page-home main#main .container,
  html body.pg-visual-system.pg-page-home main#main > :is(.pg-home-trust-strip, .pg-home-stat-grid, .pg-home-protection-compare, .pg-b2b-bento, .pg-fx-why-posguard, .pgd-products, .sectors-marquee-section, .pg-home-final-cta) {
    width: min(92%, 1360px) !important;
    max-width: 1360px !important;
    margin-inline: auto !important;
  }

  html body.pg-visual-system.pg-page-home main#main > .pg-fx-why-posguard {
    padding-inline: clamp(22px, 3vw, 42px) !important;
  }

  html body.pg-visual-system.pg-page-home :is(.pg-home-stat-grid, .pg-home-compare-grid, .pg-bento-grid) {
    align-items: stretch !important;
  }

  html body.pg-visual-system.pg-page-home :is(.pg-home-stat-card, .pg-home-compare-card, .pg-bento-card) {
    align-self: stretch !important;
    min-width: 0 !important;
    height: 100% !important;
  }
}

/* Keep the first-visit consent bar in flow above the site header. The hidden
   placeholder reserves the same space before deferred consent JS runs. */
html body.pg-visual-system #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: 2 !important;
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 9px clamp(14px, 3vw, 42px) !important;
  overflow: visible !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px 18px !important;
  border-radius: 0 !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
  transition: none !important;
}

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

html.pg-consent-needed body.pg-visual-system #pg-cookie-banner.pg-cookie-banner.pg-consent-flow[hidden] {
  display: grid !important;
  visibility: hidden !important;
}

html body.pg-visual-system #pg-cookie-banner.pg-cookie-banner.pg-consent-flow.is-visible,
html body.pg-visual-system #pg-cookie-banner.pg-cookie-banner.pg-consent-flow.is-hiding {
  opacity: 1 !important;
  transform: none !important;
}

html body.pg-visual-system #pg-cookie-banner.pg-cookie-banner.pg-consent-flow .pg-cookie-banner-options {
  display: none !important;
}

html body.pg-visual-system #pg-cookie-banner.pg-cookie-banner.pg-consent-flow .pg-cookie-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 8px !important;
  min-width: min(620px, 52vw) !important;
}

html body.pg-visual-system #pg-cookie-banner.pg-cookie-banner.pg-consent-flow .pg-cookie-actions .pg-consent-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 44px !important;
  min-height: 44px !important;
  height: auto !important;
  padding: 7px 10px !important;
  border: 1px solid rgba(255,255,255,.22) !important;
  border-radius: 8px !important;
  background: #ff163c !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 4px 12px rgba(0,0,0,.2) !important;
  font-size: .76rem !important;
  font-weight: 750 !important;
  line-height: 1.2 !important;
  text-align: center !important;
}

html body.pg-visual-system #pg-cookie-banner.pg-cookie-banner.pg-consent-flow .pg-cookie-actions [data-pg-settings] {
  display: inline-flex !important;
  grid-column: auto !important;
}

html body.pg-visual-system #pg-cookie-banner.pg-cookie-banner.pg-consent-flow .pg-cookie-links {
  grid-column: 1 / -1 !important;
  justify-content: flex-end !important;
  min-height: 20px !important;
  gap: 12px !important;
}

html body.pg-visual-system #pg-cookie-banner.pg-cookie-banner.pg-consent-flow .pg-cookie-consent-receipt {
  grid-column: 1 / -1 !important;
  margin: 0 !important;
  color: #C3D2E3 !important;
  font: 11px/1.4 'Courier New', monospace !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 768px) {
  html body.pg-visual-system #pg-cookie-banner.pg-cookie-banner.pg-consent-flow {
    grid-template-columns: minmax(0, 1fr) !important;
    padding: 10px 12px !important;
    gap: 7px !important;
  }

  html body.pg-visual-system #pg-cookie-banner.pg-cookie-banner.pg-consent-flow .pg-cookie-actions {
    min-width: 0 !important;
    width: 100% !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  html body.pg-visual-system #pg-cookie-banner.pg-cookie-banner.pg-consent-flow .pg-cookie-actions .pg-consent-btn {
    padding: 6px 5px !important;
    font-size: .68rem !important;
    overflow-wrap: anywhere !important;
  }

  html body.pg-visual-system #pg-cookie-banner.pg-cookie-banner.pg-consent-flow .pg-cookie-links {
    justify-content: flex-start !important;
  }
}

@media (max-width: 768px) {
  html body.pg-visual-system.pg-page-category main#main > section.legal-page.product-page[data-category-id] .product-layout h1 {
    font-size: clamp(26px, 6.5vw, 42px) !important;
    line-height: 1.12 !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
  }
}

/* Keep model quote-list actions on a readable row on phones and small tablets. */
@media (max-width: 768px) {
  html body.pg-visual-system:not(.pg-page-home) .pg-product-quote-builder {
    flex-wrap: wrap !important;
    min-width: 0 !important;
  }

  html body.pg-visual-system:not(.pg-page-home) .pg-product-quote-builder > .pg-quote-add {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    line-height: 1.3;
  }

  /* The tilted footer globe adds a small visual shadow beyond its 100vw frame. */
  html body.pg-visual-system .pg-fx-network-map {
    overflow-x: clip !important;
  }
}
