/* ==========================================================================
   MIETKOCHEN – Mobile-first responsive (phone, tablet, desktop)
   ========================================================================== */

/* Base: prevent horizontal scroll on all devices */
html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

img, video, iframe, svg {
  max-width: 100%;
  height: auto;
}

.container {
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

/* Touch-friendly minimum targets (WCAG 2.5) */
.btn, .nav-link, .form-control, .form-select, .accordion-button,
.navbar-toggler, .cookie-close, .map-load-btn, .video-load-btn {
  min-height: 44px;
}

.form-control, .form-select, .form-pill {
  font-size: 16px; /* prevents iOS zoom on focus */
}

/* Mobile top strip (phone only) */
.mobile-strip {
  display: none;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  padding: 0.4rem 0;
}
.mobile-strip a {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.mobile-strip a:active { color: var(--brand-yellow); }

/* Navbar mobile */
@media (max-width: 991.98px) {
  .mobile-strip { display: block; }

  .navbar { padding: 0.5rem 0; }
  .brand-logo-img {
    height: 40px;
    max-width: 160px;
  }
  .navbar-toggler {
    padding: 0.5rem;
    min-width: 44px;
  }
  .offcanvas.offcanvas-end {
    width: min(100%, 320px);
    max-width: 100%;
  }
  .offcanvas-body .nav-link {
    font-size: 1.05rem;
    padding: 0.75rem 0 !important;
  }
}

/* Hero */
@media (max-width: 991.98px) {
  .hero-section {
    min-height: auto;
    padding: 5.5rem 0 2.5rem;
  }
  .hero-title {
    font-size: clamp(1.65rem, 6vw, 2.25rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.25rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
  }
  .stat-item strong { font-size: 1.5rem; }
  .hero-glow-1, .hero-glow-2 { opacity: 0.5; }
}

@media (max-width: 575.98px) {
  .hero-section { padding-top: 4.75rem; }
  .hero-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.75rem;
  }
  .hero-cta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }
  .hero-cta .btn {
    width: 100%;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .stat-item { text-align: center; }
}

/* Sections */
@media (max-width: 991.98px) {
  .section { padding: 3rem 0; }
  .section-title {
    font-size: clamp(1.45rem, 5vw, 2rem);
  }
  .section-title::after { width: 48px; }
  .section-lead { font-size: 0.95rem; }
  .page-hero {
    padding: 6.5rem 0 2.5rem;
  }
  .page-hero h1, .page-hero .display-5 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }
}

/* Cards & grids */
@media (max-width: 991.98px) {
  .service-card, .feature-card, .process-card, .ref-card, .testimonial-card {
    padding: 1.35rem;
  }
  .service-card:hover, .feature-card:hover, .process-card:hover {
    transform: none; /* no hover lift on touch devices */
  }
  @media (hover: hover) {
    .service-card:hover, .feature-card:hover, .process-card:hover {
      transform: translateY(-4px);
    }
  }
}

@media (max-width: 575.98px) {
  .row.g-4 > [class*="col-"] { margin-bottom: 0.25rem; }
  .compliance-badges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .compliance-badge {
    flex: none;
    padding: 1rem 0.75rem;
    font-size: 0.8rem;
  }
  .process-row .col-md-6 { margin-bottom: 0.5rem; }
}

/* Trust bar */
@media (max-width: 767.98px) {
  .trust-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.25rem 0;
  }
  .trust-item {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    font-size: 0.75rem;
  }
}

@media (max-width: 399.98px) {
  .trust-bar { grid-template-columns: 1fr; }
}

/* CTA offer bar */
@media (max-width: 575.98px) {
  .cta-offer-bar {
    flex-direction: column;
    align-items: stretch !important;
    text-align: center;
    padding: 1.25rem;
  }
  .cta-offer-bar .btn { width: 100%; }
}

/* AI form */
@media (max-width: 575.98px) {
  .ai-recommendation-box {
    padding: 1.25rem !important;
  }
  .ai-recommendation-box .row > [class*="col-"] {
    margin-bottom: 0.25rem;
  }
}

/* Accordion FAQ */
@media (max-width: 575.98px) {
  .accordion-button {
    font-size: 0.95rem;
    padding: 1rem 1.1rem;
    line-height: 1.35;
  }
  .accordion-body { font-size: 0.9rem; }
}

/* Footer */
@media (max-width: 991.98px) {
  .site-footer .row.g-4 > div {
    text-align: center;
  }
  .footer-links { text-align: center; }
  .footer-location { text-align: center; }
  .footer-cta {
    padding: 1.5rem !important;
  }
  .footer-cta .btn {
    display: block;
    width: 100%;
    margin: 0.35rem 0 !important;
  }
  .footer-lower {
    text-align: center;
    flex-direction: column !important;
    gap: 0.5rem;
  }
}

/* Fixed floating elements – stack for phone */
:root {
  --fab-bottom-1: calc(1rem + env(safe-area-inset-bottom, 0px));
  --fab-bottom-2: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  --fab-bottom-3: calc(8.5rem + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 991.98px) {
  .floating-cta {
    bottom: var(--fab-bottom-1);
    right: max(0.75rem, env(safe-area-inset-right));
    left: auto;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    z-index: 1045;
  }
  .floating-cta span { display: inline; }

  .whatsapp-float {
    bottom: var(--fab-bottom-2);
    right: max(0.75rem, env(safe-area-inset-right));
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
    z-index: 1044;
  }

  .back-to-top {
    bottom: var(--fab-bottom-3);
    right: max(0.75rem, env(safe-area-inset-right));
    width: 42px;
    height: 42px;
    z-index: 1043;
  }

  .cookie-revisit-btn {
    bottom: var(--fab-bottom-2);
    left: max(0.75rem, env(safe-area-inset-left));
    z-index: 1042;
  }

  .cookie-banner {
    padding: 0.5rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  }
  .cookie-banner-inner {
    max-width: 100%;
    margin: 0;
    padding: 1.25rem;
  }
  .cookie-banner .d-flex.flex-wrap.gap-2 {
    flex-direction: column;
  }
  .cookie-banner .d-flex.flex-wrap.gap-2 .btn {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  :root {
    --fab-bottom-2: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    --fab-bottom-3: calc(9.25rem + env(safe-area-inset-bottom, 0px));
  }
  /* When cookie banner visible, push FABs up */
  body.cookie-banner-open {
    --fab-bottom-1: calc(11rem + env(safe-area-inset-bottom, 0px));
    --fab-bottom-2: calc(15rem + env(safe-area-inset-bottom, 0px));
    --fab-bottom-3: calc(19rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Maps */
@media (max-width: 575.98px) {
  .map-embed, .map-embed-wrap { min-height: 200px; }
  .map-card { margin-bottom: 1rem; }
}

/* Founders */
@media (max-width: 575.98px) {
  .founders-img-main { max-width: 100%; }
  .founder-card { margin-bottom: 0.75rem; }
}

/* MWM page mobile */
@media (max-width: 991.98px) {
  .mwm-hero { padding: 5.5rem 0 2rem; }
  .mwm-main .row { flex-direction: column; }
  .mwm-visual { order: -2; margin-bottom: 1.5rem; }
  .mwm-reward { order: -1; margin-bottom: 1.5rem; }
  .mwm-form-col { order: 0; padding: 1.35rem; }
  .mwm-circle-wrap { width: min(280px, 78vw); }
  .mwm-prize { font-size: clamp(3.5rem, 18vw, 5rem); }
  .mwm-reward ul { text-align: left; }
}

@media (max-width: 575.98px) {
  .mwm-form-col { padding: 1.15rem; }
  .form-pill { padding: 0.75rem 1.15rem !important; }
  .mwm-step-card { padding: 1.35rem 1rem; margin-bottom: 0.75rem; }
  .mwm-hero-title { font-size: 1.55rem; }
  .mwm-reward { text-align: center; }
  .mwm-reward ul { display: inline-block; text-align: left; }
  .mwm-visual-caption { font-size: 0.85rem; text-align: center; }
  .glass-panel { padding: 1.15rem !important; }
  .page-hero .container { text-align: center; }
  .page-hero .lead { margin-left: auto; margin-right: auto; max-width: 28rem; }
}

@media (max-width: 399.98px) {
  .mwm-prize { font-size: clamp(2.75rem, 16vw, 4rem); }
  .hero-title { font-size: 1.5rem; }
  .floating-cta span { display: none; }
  .floating-cta { padding: 0.65rem; min-width: 44px; justify-content: center; }
}

/* Modals */
@media (max-width: 575.98px) {
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  .modal-fullscreen-sm-down {
    max-width: 100%;
    margin: 0;
  }
}

/* Legal long text */
@media (max-width: 575.98px) {
  .legal-content { font-size: 0.9rem; }
  .legal-content h2 { font-size: 1.15rem; }
}

/* Tables overflow */
.table-responsive {
  -webkit-overflow-scrolling: touch;
}

/* Desktop dropdown hover */
@media (min-width: 992px) {
  .navbar .dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0;
  }
}

/* Large screens */
@media (min-width: 1400px) {
  .hero-section { min-height: 85vh; }
}

/* Long text / emails on narrow screens */
@media (max-width: 575.98px) {
  .topbar-link, .mobile-strip a, .footer-location a {
    word-break: break-word;
  }
  .content-img-wrap { overflow: hidden; border-radius: var(--radius-lg); }
  .testimonial-card, .ref-card { min-height: 0; }
}

/* Admin dashboard */
@media (max-width: 767.98px) {
  .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-stat-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 399.98px) {
  .admin-stat-grid { grid-template-columns: 1fr !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .hero-bg { transform: none !important; }
}
