/*
 * B2B responsive layout overrides
 * Keeps the >=1200px desktop presentation aligned with the existing design
 * while improving phone, tablet and small-laptop behavior.
 */

/* Reusable values that replace repeated inline styles. */
.nav-spacer {
  height: 100px;
}

.section-spacer {
  height: 75px;
}

.b2b-hero img {
  border-radius: 18px;
}

.b2b-carousel {
  text-align: center;
}

.b2b-carousel .carousel-item {
  height: 90vh;
  min-height: 350px;
  max-height: 580px;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  border-radius: 18px;
}

.b2b-cta-box {
  padding: 30px;
  background-color: #111111;
  border-radius: 18px;
}

/* Prevent unusually long technical strings from creating horizontal scroll. */
.b2b-services,
.b2b-cta,
.b2b-footer {
  overflow-wrap: anywhere;
}

.b2b-services ul {
  max-width: 100%;
}

/* Accessible keyboard focus, replacing the removed inline outline suppression. */
#mainNav .navbar-toggler:focus-visible,
.b2b-page a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Small laptops: keep navigation compact and avoid oversized type. */
@media (max-width: 1199.98px) {
  .b2b-page {
    font-size: 1.125rem;
  }

  #mainNav {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  #mainNav .navbar-brand img {
    height: 3rem;
  }

  #mainNav .navbar-nav .nav-item {
    margin-right: 0.4rem;
  }

  #mainNav .navbar-nav .nav-item .nav-link {
    font-size: 0.76rem;
    letter-spacing: 0.035em;
  }

  .nav-spacer {
    height: 80px;
  }

  .section-spacer {
    height: 40px;
  }

  .b2b-hero .display-4 {
    font-size: 3rem;
    line-height: 1.08;
  }

  .b2b-hero .container {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }

  .b2b-services.py-5,
  .b2b-gallery.py-5,
  .b2b-cta.py-5 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .b2b-carousel .carousel-item {
    height: clamp(360px, 50vw, 520px);
    min-height: 0;
    max-height: none;
  }

  .b2b-cta-action {
    width: 100%;
    max-width: 420px;
    flex: 0 0 100%;
  }

  .b2b-cta-action .btn {
    display: block;
    width: 100%;
    white-space: normal;
  }
}

/* Tablet and below: collapsed navigation, tighter rhythm and readable lists. */
@media (max-width: 991.98px) {
  #mainNav .navbar-collapse {
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    padding-top: 0.75rem;
  }

  #mainNav .navbar-nav .nav-item {
    margin-right: 0;
  }

  #mainNav .navbar-nav .nav-item .nav-link {
    padding: 0.7rem 0;
    font-size: 0.85rem;
  }

  #mainNav .navbar-nav .nav-item .nav-link:hover,
  #mainNav .navbar-nav .nav-item .nav-link.active {
    border-bottom-color: transparent;
  }

  .b2b-hero .display-4 {
    font-size: 2.7rem;
  }

  .b2b-hero .lead {
    font-size: 1.15rem;
  }

  .b2b-services ul {
    padding-left: 1.5rem;
  }

  .b2b-carousel .carousel-item {
    height: clamp(300px, 58vw, 460px);
  }

  .b2b-cta-box {
    padding: 24px;
  }

  .b2b-footer .container {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
}

/* Phones: use the viewport efficiently and avoid Bootstrap's desktop-sized display type. */
@media (max-width: 767.98px) {
  .b2b-page {
    font-size: 1.0625rem;
  }

  #mainNav {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  #mainNav .navbar-brand img {
    height: 2.5rem;
  }

  .nav-spacer {
    height: 64px;
  }

  .section-spacer {
    height: 24px;
  }

  .b2b-hero.py-5 {
    padding-top: 2.25rem !important;
    padding-bottom: 2.25rem !important;
  }

  .b2b-hero .container {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  .b2b-hero .my-5 {
    margin-top: 1.25rem !important;
    margin-bottom: 1.25rem !important;
  }

  .b2b-hero .display-4 {
    font-size: 2.25rem;
    line-height: 1.12;
  }

  .b2b-hero .lead {
    font-size: 1.05rem;
    line-height: 1.6;
  }

  .b2b-services h2,
  .b2b-cta h2 {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  .b2b-services.py-5,
  .b2b-gallery.py-5,
  .b2b-cta.py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .b2b-services ul {
    padding-left: 1.25rem;
  }

  .b2b-services li + li {
    margin-top: 0.35rem;
  }

  .b2b-carousel .carousel-item {
    height: clamp(230px, 68vw, 340px);
    border-radius: 12px;
  }

  .b2b-carousel .carousel-indicators {
    margin-right: 8%;
    margin-left: 8%;
  }

  .b2b-cta-box {
    padding: 20px 16px;
    border-radius: 14px;
  }

  .b2b-cta .row.text-center.py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  .b2b-cta-action .btn {
    padding: 0.75rem 1rem;
  }

  .b2b-footer .container.p-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1rem !important;
  }

  .b2b-footer .mb-4 {
    margin-bottom: 0.75rem !important;
  }
}

/* Very narrow phones. */
@media (max-width: 399.98px) {
  .b2b-page {
    font-size: 1rem;
  }

  #mainNav .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  #mainNav .navbar-brand {
    margin-right: 0.5rem;
  }

  #mainNav .navbar-brand img {
    height: 2.2rem;
  }

  #mainNav .navbar-toggler {
    padding: 0.55rem 0.6rem;
    font-size: 0.7rem;
  }

  .nav-spacer {
    height: 58px;
  }

  .b2b-hero .display-4 {
    font-size: 2rem !important;
  }

  .b2b-carousel .carousel-item {
    height: clamp(220px, 72vw, 300px);
  }
}

/* Extra safeguard for legacy/narrow embedded webviews. */
@media (max-width: 299.98px) {
  .b2b-hero .display-4 {
    font-size: 1.85rem !important;
  }
}

/* Follow-up: stronger mobile gutters, visible hero image and narrower CTA. */
@media (max-width: 1199.98px) {
  /* The original Bootstrap utility hides the hero visual below XL. Show it
     on smaller viewports and stack it below the unchanged hero copy. */
  .b2b-hero .d-none.d-xl-block {
    display: block !important;
    flex: 0 0 100%;
    max-width: 100%;
  }

  .b2b-hero .col-lg-7 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .b2b-hero .d-none.d-xl-block img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 440px;
    object-fit: cover;
    margin: 0.75rem 0 0 !important;
  }
}

@media (max-width: 767.98px) {
  /* Give all main white-content sections a calmer edge distance. */
  .b2b-hero .container,
  .b2b-services > .container,
  .b2b-gallery > .container,
  .b2b-cta > .container {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  .b2b-hero .d-none.d-xl-block img {
    max-height: none;
    border-radius: 12px;
    margin-top: 0.5rem !important;
  }

  /* Prevent Bootstrap's negative outer row margins from making the dark CTA
     look almost edge-to-edge on narrow phones. */
  .b2b-cta > .container > .row {
    margin-left: 0;
    margin-right: 0;
  }

  .b2b-cta-box {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 399.98px) {
  .b2b-hero .container,
  .b2b-services > .container,
  .b2b-gallery > .container,
  .b2b-cta > .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

/* V3: one consistent gap between all main page sections. */
.b2b-page {
  --b2b-section-gap: 75px;
}

/* Spacing is controlled in one place instead of being accumulated from
   Bootstrap py/my utilities plus an extra spacer element. */
.section-spacer {
  display: none;
}

.b2b-services.py-5,
.b2b-gallery.py-5,
.b2b-cta.py-5 {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.b2b-services,
.b2b-gallery {
  margin-top: var(--b2b-section-gap);
}

.b2b-cta {
  margin-top: var(--b2b-section-gap) !important;
  margin-bottom: var(--b2b-section-gap) !important;
}

/* Do not add an extra list margin after the final service block; otherwise
   the services -> gallery gap would look larger than the other gaps. */
.b2b-services .service-block:last-child ul {
  margin-bottom: 0;
}

@media (max-width: 1199.98px) {
  .b2b-page {
    --b2b-section-gap: 56px;
  }
}

@media (max-width: 767.98px) {
  .b2b-page {
    --b2b-section-gap: 44px;
  }
}
