/* SIDEWAY LAYOUT REPAIR FINAL
   Fix dark full-page bug, narrow/mini landing, footer overflow, and How It Works spacing. */

html,
body {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  background: #f3f7fb !important;
}

body,
body.sideway-footer-clean,
body.sideway-theme,
body.sideway-motion-page {
  background: #f3f7fb !important;
  color: #071a33 !important;
}

main,
#app,
.page,
.main {
  width: 100% !important;
  max-width: none !important;
  background: #f3f7fb !important;
  margin: 0 !important;
  padding-bottom: 0 !important;
}

/* Restore normal landing width */
.wrap,
.products-section,
.feature-strip,
.footer-grid,
.footer-bottom,
.hero,
.nav {
  width: min(1280px, calc(100% - 48px)) !important;
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.topbar,
.hero-shell,
.products-section,
.catalog-tools,
.feature-strip,
.site-footer,
footer {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.topbar {
  width: 100% !important;
  background: rgba(255,255,255,.96) !important;
  border-bottom: 1px solid rgba(7,26,51,.08) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
}

.hero-shell {
  width: 100% !important;
  min-height: 440px !important;
  padding: 54px 0 56px !important;
  background:
    radial-gradient(circle at 72% 22%, rgba(249,115,22,.13), transparent 32%),
    linear-gradient(110deg, #ffffff 0%, #ffffff 68%, #071a33 68%, #071a33 100%) !important;
  overflow: hidden !important;
}

.hero {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 520px) !important;
  align-items: center !important;
  gap: 54px !important;
}

.products-section {
  padding: 56px 0 34px !important;
  background: transparent !important;
}

.section-head.center,
.products-section .section-head {
  text-align: center !important;
  margin: 0 auto 22px !important;
}

.catalog-tools {
  width: min(920px, 100%) !important;
  max-width: 920px !important;
  margin: 0 auto 24px !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
}

.product-grid,
#products {
  width: 100% !important;
  max-width: none !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) !important;
  gap: 18px !important;
  align-items: stretch !important;
}

.product-card,
.catalog-card,
.service-card,
.card.product,
#products > * {
  min-width: 0 !important;
  height: 282px !important;
  max-height: 282px !important;
}

/* How It Works / feature strip */
#cara-order,
.feature-strip {
  margin-top: 24px !important;
  margin-bottom: 48px !important;
  padding: 28px 30px !important;
  background: #ffffff !important;
  border: 1px solid rgba(7,26,51,.08) !important;
  border-radius: 22px !important;
  box-shadow: 0 18px 48px rgba(7,26,51,.08) !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0 !important;
}

#cara-order article,
.feature-strip article {
  display: grid !important;
  grid-template-columns: 54px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  column-gap: 16px !important;
  row-gap: 8px !important;
  align-items: start !important;
  padding: 0 24px !important;
  min-width: 0 !important;
  border-right: 1px solid rgba(7,26,51,.08) !important;
}

#cara-order article:last-child,
.feature-strip article:last-child {
  border-right: 0 !important;
}

#cara-order .feature-icon,
.feature-strip .feature-icon {
  grid-row: 1 / span 2 !important;
  width: 54px !important;
  height: 54px !important;
  border-radius: 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #fff5eb !important;
  font-size: 24px !important;
  flex: 0 0 auto !important;
}

#cara-order strong,
.feature-strip strong {
  display: block !important;
  margin: 0 !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  color: #071a33 !important;
}

#cara-order p,
.feature-strip p {
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  color: #516173 !important;
  max-width: 220px !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* Footer back to normal width, no blank below */
.site-footer,
footer.site-footer,
footer {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 42px 0 24px !important;
  background: #071a33 !important;
  color: #eaf2ff !important;
  position: relative !important;
  z-index: 5 !important;
}

.site-footer .footer-grid,
.footer-grid {
  display: grid !important;
  grid-template-columns: minmax(250px, 1.4fr) minmax(130px, .8fr) minmax(170px, .9fr) minmax(150px, .8fr) !important;
  gap: 64px !important;
  align-items: start !important;
}

.site-footer .footer-bottom,
.footer-bottom {
  margin-top: 28px !important;
  padding-top: 18px !important;
  border-top: 1px solid rgba(255,255,255,.12) !important;
  color: #b7c5d8 !important;
}

.site-footer a,
.site-footer span,
.site-footer p,
.footer-grid a,
.footer-grid span,
.footer-grid p {
  color: #d9e6f7 !important;
  line-height: 1.6 !important;
}

.site-footer h4,
.footer-grid h4 {
  color: #ffffff !important;
  margin: 0 0 14px !important;
}

.site-footer .footer-logo,
.footer-logo {
  width: 170px !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  background: rgba(255,255,255,.96) !important;
  border-radius: 14px !important;
  padding: 12px !important;
}

body::after,
main::after,
.site-footer::after,
footer::after {
  display: none !important;
  content: none !important;
}

@media (max-width: 980px) {
  .wrap,
  .products-section,
  .feature-strip,
  .footer-grid,
  .footer-bottom,
  .hero,
  .nav {
    width: min(100% - 32px, 1280px) !important;
  }

  .hero-shell {
    background: #ffffff !important;
  }

  .hero {
    grid-template-columns: 1fr !important;
  }

  #cara-order,
  .feature-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
  }

  #cara-order article,
  .feature-strip article {
    border-right: 0 !important;
    padding: 0 !important;
  }

  .site-footer .footer-grid,
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 30px !important;
  }
}

@media (max-width: 620px) {
  .product-grid,
  #products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  #cara-order,
  .feature-strip {
    grid-template-columns: 1fr !important;
    padding: 22px !important;
  }

  .site-footer .footer-grid,
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
}
