/* MOBILE-FIRST — HOTFIX 53ax (homepage + site-wide mobile UX) */

:root {
  --bottom-bar-h: 64px;
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --tap-min: 44px;
}

@media (max-width: 768px) {
  body:not(.page-login):not(.page-login-wachtwoord) {
    padding-bottom: calc(var(--bottom-bar-h) + var(--safe-bot));
  }
}

@media (max-width: 768px) {
  button,
  a.btn,
  input[type="submit"],
  .btn-primary,
  .btn-secondary,
  .btn-accent,
  .filter-pill,
  .service-abos__toggle-btn {
    min-height: var(--tap-min);
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px;
    min-height: var(--tap-min);
    padding: 12px 14px;
    box-sizing: border-box;
  }
}

/* Hero */
@media (max-width: 768px) {
  body.home .hero-home,
  body.home .home-hero {
    padding: 32px 18px 28px;
    min-height: auto;
  }

  body.home .hero-home h1,
  body.home .home-hero h1 {
    font-size: clamp(28px, 7vw, 36px);
    line-height: 1.15;
  }

  body.home .hero-home p,
  body.home .home-hero p {
    font-size: 16px;
    line-height: 1.5;
  }

  body.home .hero-cta-row,
  body.home .home-hero__cta {
    flex-direction: column;
    gap: 10px;
  }

  body.home .hero-cta-row > a,
  body.home .home-hero__cta > a {
    width: 100%;
    justify-content: center;
  }
}

/* Diensten grid */
@media (max-width: 600px) {
  body.home .home-diensten-grid,
  body.home .diensten__grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  body.home .home-diensten-grid,
  body.home .diensten__grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Service-abonnementen: horizontale swipe op mobile */
@media (max-width: 768px) {
  body.home .service-abos__grid.pakketten-carousel-mobile {
    display: flex !important;
    grid-template-columns: unset !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding: 4px 4px 18px;
    margin: 0 -4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.home .service-abos__grid.pakketten-carousel-mobile::-webkit-scrollbar {
    display: none;
  }

  body.home .service-abos__grid.pakketten-carousel-mobile > .abo-card {
    flex: 0 0 88%;
    scroll-snap-align: center;
    min-width: 0;
  }
}

/* Impact stats */
@media (max-width: 600px) {
  body.home .counter-wall__grid,
  body.home .impact-stats,
  body.home .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
}

/* Reviews swipe */
@media (max-width: 768px) {
  body.home .reviews-band__quotes.reviews-carousel-mobile {
    display: flex !important;
    grid-template-columns: unset !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding: 4px 4px 18px;
    margin: 0 -4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.home .reviews-band__quotes.reviews-carousel-mobile::-webkit-scrollbar {
    display: none;
  }

  body.home .reviews-band__quotes.reviews-carousel-mobile > .review-quote {
    flex: 0 0 86%;
    scroll-snap-align: center;
    min-width: 0;
  }
}

/* Tables */
@media (max-width: 600px) {
  .kosten-overzicht table {
    display: table;
    width: 100%;
  }

  .kosten-overzicht td {
    padding: 8px 4px;
    font-size: 14px;
  }
}

/* Footer */
@media (max-width: 768px) {
  .footer-mid {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }
}

/* Modals bottom-sheet */
@media (max-width: 600px) {
  .modal,
  .portal-modal,
  .contact-modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal__inner,
  .portal-modal__inner,
  .contact-modal__panel {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    margin: 0;
    padding-bottom: calc(20px + var(--safe-bot));
  }
}

/* Full-screen nav drawer (bestaande nav-overlay) */
@media (max-width: 900px) {
  .nav-overlay {
    background: #fff;
    transform: translateX(-100%);
    padding-top: var(--safe-top);
  }

  .nav-overlay.is-open {
    transform: translateX(0);
  }

  .nav-overlay-inner {
    min-height: 100dvh;
    padding: calc(56px + var(--safe-top)) 24px calc(40px + var(--safe-bot));
  }

  .nav-overlay-close {
    top: calc(16px + var(--safe-top));
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f4f4f5;
    color: #18181b;
  }

  .nav-overlay-links > li > a {
    display: flex;
    align-items: center;
    font-size: 17px;
    padding: 16px 0;
    border-bottom: 1px solid #fafafa;
  }

  .nav-overlay-cta.btn-accent {
    background: #ff6a1a;
    color: #fff;
    border-radius: 12px;
    text-align: center;
    margin-top: 16px;
  }
}

/* Mobile bottom bar — 3 kolommen incl. Offerte */
@media (max-width: 767px) {
  .mobile-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 8px;
    z-index: 900;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.25s ease;
  }

  .mobile-bar.is-hidden-scroll {
    transform: translateY(100%);
  }

  .mobile-bar-btn {
    min-height: var(--tap-min);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #18181b;
    background: #f4f4f5;
  }

  .mobile-bar-btn--call {
    background: #f4f4f5;
    color: #18181b;
  }

  .mobile-bar-btn--chat {
    background: #f4f4f5;
    color: #18181b;
    box-shadow: none;
  }

  .mobile-bar-btn--offerte {
    background: #ff6a1a;
    color: #fff;
  }

  .mobile-bar-btn--offerte:hover {
    background: #b91c1c;
  }

  .mobile-bar-icon {
    font-size: 22px;
    margin-bottom: 2px;
  }

  .whatsapp-float,
  .bel-float-wrap {
    display: none !important;
  }

  .mobile-cta-bar {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .mobile-bar {
    display: none !important;
  }
}

/* iOS PWA add-to-homescreen hint */
.pwa-ios-homescreen-hint {
  position: fixed;
  top: calc(12px + var(--safe-top));
  left: 12px;
  right: 12px;
  background: #fff;
  padding: 12px 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  z-index: 950;
  animation: mfxSlideDown 0.3s ease;
}

.pwa-ios-homescreen-hint[hidden] {
  display: none !important;
}

.pwa-ios-homescreen-hint__icon {
  font-size: 28px;
}

.pwa-ios-homescreen-hint__text {
  flex: 1;
  font-size: 13px;
  line-height: 1.4;
}

.pwa-ios-homescreen-hint__text strong {
  display: block;
  font-size: 14px;
}

.pwa-ios-homescreen-hint__close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f4f4f5;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

@keyframes mfxSlideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 769px) {
  .pwa-ios-homescreen-hint {
    display: none !important;
  }
}
