/* Site-wide header + footer fixes (all pages) */

html {
  scroll-behavior: smooth;
}

/* Fixed navbar clearance — all non-home pages */
body:not(.page-home) {
  padding-top: 90px !important;
  overflow-x: hidden;
}

@media (max-width: 992px) {
  body:not(.page-home) {
    padding-top: 70px !important;
  }
}

@media (max-width: 480px) {
  body:not(.page-home) {
    padding-top: 62px !important;
  }
}

/* Legacy body classes (same values) */
body.site-page:not(.page-home),
body.page-about,
body.page-services,
body.page-contact,
body.page-product,
body.page-blog {
  padding-top: 90px !important;
  overflow-x: hidden;
}

@media (max-width: 992px) {
  body.site-page:not(.page-home),
  body.page-about,
  body.page-services,
  body.page-contact,
  body.page-product,
  body.page-blog {
    padding-top: 70px !important;
  }
}

@media (max-width: 480px) {
  body.site-page:not(.page-home),
  body.page-about,
  body.page-services,
  body.page-contact,
  body.page-product,
  body.page-blog {
    padding-top: 62px !important;
  }
}

/* Footer always full width, above page backgrounds */
.site-footer,
.footer {
  width: 100% !important;
  clear: both !important;
  position: relative !important;
  z-index: 10 !important;
  margin-top: 40px;
}

/* Bootstrap .container must not crush footer grid */
.footer .footer-grid {
  max-width: 1100px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
  display: grid !important;
}

.footer .container {
  max-width: 1100px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
  padding-left: 15px !important;
  padding-right: 15px !important;
  box-sizing: border-box;
}

@media (max-width: 992px) {
  .footer .container {
    margin-left: auto !important;
    margin-right: auto !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
  }
}

@media (max-width: 576px) {
  .footer .container {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .footer-logo {
    width: 120px !important;
  }

  .footer h3 {
    font-size: 18px;
  }

  .footer-col h4 {
    font-size: 16px;
  }
}

/* Product / VFD pages: div.hero is NOT fullscreen homepage hero */
body.site-page .container > .hero,
body.page-product .hero:not(section) {
  min-height: auto !important;
  height: auto !important;
  margin-top: 0 !important;
}

/* VFD floating action buttons */
@media (max-width: 768px) {
  .float,
  .sickfloat {
    width: 48px !important;
    height: 48px !important;
    right: 16px !important;
    bottom: 20px !important;
    font-size: 22px !important;
  }

  .sickfloat {
    bottom: 76px !important;
  }

  .float2,
  .sickfloat2 {
    width: auto !important;
    max-width: calc(100vw - 90px) !important;
    height: 44px !important;
    right: 16px !important;
    left: auto !important;
    bottom: 20px !important;
    font-size: 13px !important;
    line-height: 44px !important;
    padding: 0 14px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sickfloat2 {
    bottom: 72px !important;
  }
}

/* Product catalog page (product.php) */
body:not(.page-home) section.hero {
  min-height: auto !important;
  height: auto !important;
}

@media (max-width: 768px) {
  body:not(.page-home) section.hero {
    margin-top: 0 !important;
    padding: 48px 16px !important;
  }

  body:not(.page-home) section.hero h1 {
    font-size: 1.75rem !important;
    line-height: 1.25;
  }

  body:not(.page-home) section.hero p {
    font-size: 1rem !important;
  }

  .top-bar {
    padding: 20px 16px !important;
  }

  .top-bar .search,
  .top-bar .search input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .categories {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 12px !important;
  }

  .cat-btn {
    font-size: 13px !important;
    padding: 8px 12px !important;
  }

  .custom-section {
    margin: 40px 16px !important;
    padding: 40px 16px !important;
  }

  .custom-section h1 {
    font-size: 1.75rem !important;
  }

  .custom-section p {
    margin: 16px auto 32px !important;
    font-size: 1rem !important;
  }
}

/* Contact page — top-level hero only (not product card .hero) */
@media (max-width: 768px) {
  body > .hero {
    height: auto !important;
    min-height: 50vh;
    padding: 80px 16px 40px;
  }

  body > .hero .hero-content h1 {
    font-size: 1.75rem !important;
  }

  .method-card {
    margin-bottom: 16px;
  }

  .method-card h4 {
    font-size: 20px;
  }

  #popupForm .form-box,
  .form-box {
    width: calc(100% - 32px) !important;
    max-width: 400px;
    margin: 16px;
  }

  .section {
    padding: 16px !important;
    margin: 30px auto !important;
  }

  .section h2 {
    font-size: 1.5rem !important;
  }
}

/* Blog */
.blog-page-wrap {
  padding-bottom: 40px;
}

@media (max-width: 768px) {
  .blog-hero {
    padding: 60px 16px 40px !important;
  }

  .blog-hero h1 {
    font-size: 1.75rem !important;
  }

  .blog-page-wrap .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Tables site-wide */
.table-responsive,
.table-container,
.table-section {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Prevent horizontal scroll from wide embeds */
iframe,
video,
embed {
  max-width: 100%;
}
