/* Companion: assets/css/mobile-nav-fix.css (linked on all pages) */
/* =========================================================
   Mobile one-page experience — Woningontruiming Groene Huis
   Desktop (≥992px) is intentionally untouched.
   ========================================================= */

/* Defaults: hide mobile-only UI so desktop stays unchanged */
.mobile-onepage-nav,
.mobile-sticky-cta,
.mobile-cta-link {
  display: none !important;
}

@media (min-width: 992px) {
  .mobile-onepage-nav,
  .mobile-sticky-cta,
  .mobile-cta-link {
    display: none !important;
  }
}

@media (max-width: 991.98px) {

  /* ---------- Base / typography ---------- */
  html {
    scroll-behavior: smooth;
    scroll-padding-top: 76px;
    scroll-padding-bottom: 88px;
  }

  body {
    font-size: 16px;
    line-height: 1.65;
    padding-bottom: 84px; /* room for sticky CTA */
  }

  body.index-page .main {
    overflow-x: hidden;
  }

  h1, h2, h3,
  .section-heading,
  .section-title h2 {
    letter-spacing: -0.02em;
  }

  /* ---------- Sticky compact header ---------- */
  #header.header {
    padding-top: 8px;
    padding-bottom: 8px;
    min-height: 64px;
    background: rgba(22, 15, 9, 0.94) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  }

  .scrolled #header.header,
  .scrolled .header {
    --background-color: rgba(22, 15, 9, 0.96);
  }

  #header .sitename-logo {
    max-width: 148px;
  }

  #header .container-fluid,
  #header .container-xl {
    padding-left: 14px;
    padding-right: 14px;
  }

  /* Hide desktop header Offerte/WhatsApp pills on small screens
     (already d-none d-sm-block below sm; keep compact on tablet too) */
  #header .btn-getstarted {
    display: none !important;
  }

  .mobile-nav-toggle {
    font-size: 30px;
    color: #fff;
    padding: 8px;
    margin-right: 0;
  }

  /* ---------- Mobile nav: anchors only ---------- */
  .desktop-primary-nav {
    display: none !important;
  }

  .desktop-cta-link {
    display: none !important;
  }

  .mobile-cta-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Let the existing hamburger overlay drive visibility */
  .navmenu ul.mobile-onepage-nav {
    display: none;
    list-style: none;
    position: absolute;
    inset: 60px 14px 20px 14px;
    padding: 12px 0;
    margin: 0;
    border-radius: 16px;
    background-color: #ffffff;
    overflow-y: auto;
    z-index: 9998;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  }

  .mobile-nav-active .navmenu > ul.mobile-onepage-nav {
    display: block !important;
  }

  .mobile-nav-active .navmenu > ul.desktop-primary-nav {
    display: none !important;
  }

  .mobile-onepage-nav > li > a {
    min-height: 52px;
    padding: 14px 22px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #2c1607 !important;
    border-bottom: 1px solid rgba(44, 22, 7, 0.06);
  }

  .mobile-onepage-nav > li > a.active,
  .mobile-onepage-nav > li > a:hover,
  .mobile-onepage-nav > li > a:focus {
    color: #21CF0A !important;
  }

  .mobile-onepage-nav .mobile-meer > a {
    color: #64748b !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .mobile-onepage-nav .dropdown ul a {
    min-height: 46px;
    padding: 12px 18px !important;
    font-size: 16px !important;
  }

  /* ---------- Hero fit for phones ---------- */
  #hero.hero {
    min-height: min(92svh, 720px);
    min-height: min(92vh, 720px);
    padding-top: 88px;
    padding-bottom: 48px;
    align-items: center;
  }

  #hero .hero-content h1 {
    font-size: clamp(1.65rem, 6.2vw, 2.15rem) !important;
    line-height: 1.2 !important;
    margin-bottom: 1rem;
  }

  #hero .hero-content p {
    font-size: 1.05rem !important;
    line-height: 1.7 !important;
    margin-bottom: 1.5rem;
  }

  #hero .hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  #hero .hero-actions .btn {
    width: 100%;
    min-height: 52px;
    padding: 14px 20px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 14px;
    justify-content: center;
  }

  #hero .hero-overlay {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.55) 0%,
      rgba(0, 0, 0, 0.72) 100%
    );
  }

  /* ---------- Sections: spacing & polish ---------- */
  .section {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  #about.about,
  #services.services,
  #offerte.offerte {
    scroll-margin-top: 76px;
  }

  #about .section-heading {
    font-size: clamp(1.5rem, 5.5vw, 1.9rem);
  }

  #services .section-title h2,
  #services .section-title p {
    text-align: left;
  }

  #services .section-title h2 {
    font-size: clamp(1.5rem, 5.5vw, 1.9rem);
  }

  .services-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .service-item {
    min-height: auto !important;
    padding: 24px 20px !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08) !important;
  }

  .service-item h2 {
    font-size: 1.25rem !important;
  }

  .modern-offerte-btn {
    min-height: 50px;
    border-radius: 14px !important;
    font-size: 1rem !important;
  }

  /* Offerte form section */
  #offerte {
    padding-top: 48px;
    padding-bottom: 64px;
    background: #f5f7f4;
  }

  #offerte .quote-form {
    padding: 28px 18px !important;
    border-radius: 20px !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08) !important;
  }

  #offerte .form-intro h3 {
    font-size: 1.55rem;
  }

  #offerte .submit-btn,
  #offerte .form-field input,
  #offerte .form-field select,
  #offerte .form-field textarea {
    min-height: 50px;
    font-size: 16px; /* avoid iOS zoom */
  }

  #offerte .submit-btn {
    min-height: 54px;
    border-radius: 14px;
  }

  /* Safer card / list tap targets */
  .about .icon-list li,
  .service-features li {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  /* ---------- Sticky bottom CTA ---------- */
  .mobile-sticky-cta {
    display: flex !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.12);
  }

  .mobile-sticky-cta a {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 12px 14px;
    border-radius: 14px;
    font-family: var(--nav-font, "Poppins", sans-serif);
    font-size: 1rem;
    font-weight: 650;
    text-decoration: none;
    line-height: 1.2;
  }

  .mobile-sticky-cta__offerte {
    background: linear-gradient(135deg, #21CF0A, #153006);
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(33, 207, 10, 0.28);
  }

  .mobile-sticky-cta__whatsapp {
    background: #25D366;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.28);
  }

  .mobile-sticky-cta a i {
    font-size: 1.25rem;
  }

  /* Lift floating widgets above sticky bar; hide redundant FAB */
  .whatsapp-floating {
    display: none !important;
  }

  .whatsapp-popup {
    bottom: 92px !important;
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
  }

  .scroll-top {
    bottom: 96px !important;
    right: 16px !important;
  }

  /* Footer breathing room above sticky CTA */
  #footer.footer {
    padding-bottom: 24px;
  }

  .footer-bottom {
    padding-bottom: 8px;
  }
}

/* Extra-small phones */
@media (max-width: 400px) {
  #header .sitename-logo {
    max-width: 132px;
  }

  .mobile-sticky-cta a {
    font-size: 0.92rem;
    gap: 6px;
    padding: 12px 10px;
  }

  #hero .hero-content h1 {
    font-size: 1.5rem !important;
  }
}
