/**
 * Genpro Phase 5 — Legacy UI suppression, mobile QA, AI widget clearance
 * Load last in futuristic_assets.php (after all futuristic overrides).
 */

/* ─── Suppress obsolete legacy components (not in current DOM) ─── */
body.genpro-futuristic .hero-slider-enhanced,
body.genpro-futuristic .hero-slide-enhanced,
body.genpro-futuristic .hero-slider-container-enhanced,
body.genpro-futuristic .hero-slider-controls-enhanced,
body.genpro-futuristic .chat-assistant-btn:not(.fx-ai-fab),
body.genpro-futuristic .chat-widget:not(.fx-ai-panel) {
  display: none !important;
}

/* Legacy header chrome — replaced by fx-nav-glass (header_floating.css) */
body.genpro-futuristic .site-header.header-enhanced,
body.genpro-futuristic .fx-topbar,
body.genpro-futuristic #mobile-menu-overlay,
body.genpro-futuristic .mobile-menu-toggle {
  display: none !important;
}

/* Neutralize legacy white section backgrounds that fight dark glass pass */
body.genpro-futuristic .policy-content-section,
body.genpro-futuristic .article-content-section,
body.genpro-futuristic .about-section:not(.about-enhanced),
body.genpro-futuristic .contact-section:not(.contact-enhanced):not(.contact-page-enhanced),
body.genpro-futuristic .support-section:not(.support-page-enhanced),
body.genpro-futuristic .services-section:not(.services-page-enhanced):not(.services-enhanced),
body.genpro-futuristic .products-section:not(.products-page-enhanced):not(.products-enhanced) {
  background: transparent;
}

/* ─── Global overflow & responsive safety ─── */
body.genpro-futuristic {
  overflow-x: clip;
}

body.genpro-futuristic img,
body.genpro-futuristic video,
body.genpro-futuristic iframe,
body.genpro-futuristic svg {
  max-width: 100%;
}

/* Header brand logo — wide format; do not inherit global img width */
body.genpro-futuristic .fx-nav-glass__brand img,
body.genpro-futuristic .fx-nav-glass__logo,
body.genpro-futuristic .fx-nav-glass__brand .genpro-public-logo {
  width: auto !important;
  height: 50px !important;
  max-height: 50px !important;
  max-width: min(220px, 38vw) !important;
  object-fit: contain !important;
  object-position: left center;
}

/* Card/thumbnail frames — preserve aspect-ratio + object-fit */
body.genpro-futuristic [class*="image-wrapper"] img,
body.genpro-futuristic [class*="-image-enhanced"]:not(.contact-generator-img-enhanced),
body.genpro-futuristic .related-post-image,
body.genpro-futuristic .blog-card-image img,
body.genpro-futuristic .featured-blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.genpro-futuristic pre,
body.genpro-futuristic table {
  max-width: 100%;
  overflow-x: auto;
}

body.genpro-futuristic .container {
  width: 100%;
  padding-left: clamp(0.75rem, 3vw, 1.25rem);
  padding-right: clamp(0.75rem, 3vw, 1.25rem);
}

/* Prevent 100vw drawer bleed on small screens */
body.genpro-futuristic .fx-drawer {
  max-width: 100vw;
}

/* ─── Viewport breakpoints: 360 / 414 / 768 / 1024 ─── */
@media (max-width: 414px) {
  body.genpro-futuristic .fx-nav-glass__btn--primary {
    padding: 0 0.65rem;
    font-size: 0.7rem;
  }

  body.genpro-futuristic .fx-announce__text {
    font-size: 0.68rem;
  }

  body.genpro-futuristic .kb-hero__title {
    font-size: clamp(1.65rem, 8vw, 2.25rem);
  }
}

@media (max-width: 360px) {
  :root {
    --fx-nav-float-inset: 0.5rem;
  }

  body.genpro-futuristic .fx-nav-glass {
    padding-left: 0.65rem;
    padding-right: 0.45rem;
  }

  body.genpro-futuristic .fx-nav-glass__logo,
  body.genpro-futuristic .fx-nav-glass__brand .genpro-public-logo {
    height: 42px !important;
    max-height: 42px !important;
    width: auto !important;
    max-width: min(170px, 46vw) !important;
    object-fit: contain !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  body.genpro-futuristic .contact-page-wrapper-enhanced,
  body.genpro-futuristic .support-page-wrapper-enhanced,
  body.genpro-futuristic .about-page-wrapper-enhanced {
    grid-template-columns: 1fr;
  }
}

/* ─── AI assistant clearance — avoid blocking primary CTAs ─── */
@media (max-width: 1023px) {
  body.genpro-futuristic main {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
  }

  body.genpro-futuristic {
    padding-top: var(--fx-page-offset) !important;
  }

  body.genpro-futuristic .kb-hero__controls {
    margin-bottom: 0.5rem;
  }
}

body.genpro-futuristic .fx-ai-fab {
  z-index: 99999 !important;
  position: fixed !important;
  bottom: max(1.5rem, env(safe-area-inset-bottom, 0px)) !important;
  right: max(1.5rem, env(safe-area-inset-right, 0px)) !important;
  left: auto !important;
}

/* Reserve corner safe zone for FAB on pages with fixed bottom actions */
body.genpro-futuristic .contact-form-submit-enhanced,
body.genpro-futuristic .support-form-submit-enhanced {
  margin-bottom: 0.25rem;
}

@media (max-width: 480px) {
  body.genpro-futuristic .fx-ai-panel.is-open ~ .fx-ai-fab,
  body.genpro-futuristic .fx-ai-panel.is-open + .fx-ai-fab {
    opacity: 0;
    pointer-events: none;
  }
}
