/* ============================================
   Mobile Optimierung – Handy & Tablet
   ============================================ */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --nav-height: 64px;
}

html {
  scroll-padding-top: calc(var(--nav-height) + var(--safe-top) + 8px);
  -webkit-text-size-adjust: 100%;
}

body {
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* Touch: kein Hover-Sticky, größere Klickflächen */
@media (hover: none), (pointer: coarse) {
  .cursor-glow {
    display: none !important;
  }

  .service-card:hover,
  .portfolio-card:hover,
  .pricing-card:hover,
  .testimonial-card:hover,
  .service-card-link:hover,
  .vorteil-card:hover,
  .warum-card:hover,
  .bedenken-card:hover,
  .testimonial-row:hover,
  .leistung-card:hover {
    transform: none;
    box-shadow: var(--shadow-card);
  }

  .btn-primary:hover,
  .btn-outline:hover,
  .btn-call:hover {
    transform: none;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --section-padding: clamp(3rem, 8vw, 5rem);
  }

  .section-header {
    margin-bottom: 2.5rem;
  }

  .section-header p {
    font-size: 1rem;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + var(--safe-top) + 1.5rem);
    padding-bottom: 2rem;
  }

  .hero-card {
    max-width: min(320px, 88vw);
    margin: 0 auto;
  }

  .hero-card--photo {
    aspect-ratio: 3 / 4;
  }

  .hero-stats {
    gap: 1.5rem;
    flex-wrap: wrap;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .services-grid,
  .portfolio-grid,
  .testimonials-grid,
  .services-teaser-grid,
  .bedenken-grid,
  .result-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  }

  .prozess-cards {
    gap: 1.25rem;
  }
}

/* Desktop schmal: Nav kompakter */
@media (min-width: 1025px) and (max-width: 1200px) {
  .nav-links {
    gap: 1rem;
  }
}

/* Handy */
@media (max-width: 768px) {
  :root {
    --section-padding: 3rem;
    --container-padding: 1rem;
    --nav-height: 56px;
  }

  body {
    font-size: 15px;
  }

  a, button {
    -webkit-tap-highlight-color: rgba(0, 212, 255, 0.12);
  }

  h1 { font-size: clamp(1.75rem, 7vw, 2.25rem); }
  h2 { font-size: clamp(1.5rem, 5.5vw, 1.875rem); }
  h3 { font-size: 1.125rem; }

  /* Navbar */
  .navbar {
    padding: calc(0.65rem + var(--safe-top)) 0 0.65rem;
  }

  .navbar.scrolled {
    padding: calc(0.5rem + var(--safe-top)) 0 0.5rem;
  }

  .logo {
    max-width: none;
  }

  .logo-img {
    height: 34px;
    max-width: min(160px, 50vw);
  }

  .hamburger {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu {
    padding-top: calc(var(--nav-height) + var(--safe-top));
    padding-bottom: calc(1.5rem + var(--safe-bottom));
    gap: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }

  .mobile-menu a:not(.btn) {
    font-size: 1.125rem;
    padding: 0.625rem 1rem;
    min-height: 48px;
    width: min(320px, 90vw);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu .btn {
    width: min(280px, 90vw);
    margin-top: 0.75rem;
    flex-shrink: 0;
  }

  /* Hero */
  .hero {
    padding-top: calc(var(--nav-height) + var(--safe-top) + 1rem);
    padding-bottom: 1.5rem;
  }

  .hero-badge {
    font-size: 0.8125rem;
    padding: 0.4rem 0.85rem;
    margin-bottom: 1rem;
  }

  .hero-description {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 2rem;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    padding: 0.875rem 1.25rem;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    width: 100%;
  }

  .stat-item {
    text-align: center;
  }

  .stat-number {
    font-size: 1.375rem;
  }

  .stat-label {
    font-size: 0.6875rem;
    line-height: 1.3;
  }

  .hero-visual {
    margin-bottom: 0.5rem;
  }

  .hero-card {
    max-width: min(280px, 90vw);
  }

  .hero-card--photo {
    aspect-ratio: 3 / 4;
  }

  /* Trust Bar */
  .trust-bar {
    padding: 1rem 0;
  }

  .trust-bar-inner {
    flex-direction: column;
    gap: 0.5rem;
  }

  .trust-bar-items {
    justify-content: center;
    text-align: center;
    line-height: 1.5;
  }

  .trust-text {
    font-size: 0.8125rem;
  }

  .trust-emoji {
    font-size: 1rem;
  }

  /* Sections */
  section {
    padding: var(--section-padding) 0;
  }

  .section-header {
    margin-bottom: 2rem;
    text-align: left;
  }

  .section-label {
    font-size: 0.75rem;
  }

  .section-header p {
    font-size: 0.9375rem;
    margin-top: 0.75rem;
  }

  /* Cards */
  .service-card,
  .testimonial-card,
  .pricing-card {
    padding: 1.5rem;
  }

  .service-icon,
  .warum-emoji,
  .was-icon,
  .leistung-icon {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }

  .services-grid,
  .portfolio-grid,
  .testimonials-grid,
  .process-steps {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Pricing */
  .pricing-toggle {
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
  }

  .toggle-switch {
    min-width: 52px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .price-amount {
    font-size: 2.25rem;
  }

  .pricing-card .btn {
    min-height: 48px;
  }

  .pricing-card.featured {
    order: -1;
  }

  /* Process */
  .process-step {
    text-align: left;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
  }

  .step-number {
    width: 44px;
    height: 44px;
    font-size: 1rem;
    margin: 0;
    flex-shrink: 0;
  }

  .process-step h3 {
    margin-bottom: 0.35rem;
  }

  .process-step p {
    font-size: 0.875rem;
  }

  /* Portfolio */
  .portfolio-grid {
    gap: 1.25rem;
  }

  .portfolio-info {
    padding: 1.25rem;
  }

  .portfolio-image {
    font-size: 2.5rem;
  }

  /* FAQ */
  .faq-question {
    font-size: 0.9375rem;
    padding: 1.125rem 0;
    min-height: 48px;
  }

  .faq-icon {
    width: 32px;
    height: 32px;
  }

  .faq-answer-inner {
    font-size: 0.875rem;
    padding-bottom: 1.25rem;
  }

  /* Contact */
  .contact-wrapper {
    gap: 2rem;
  }

  .contact-info {
    text-align: left;
  }

  .contact-info > p {
    font-size: 0.9375rem;
  }

  .contact-detail {
    gap: 0.875rem;
  }

  .contact-detail span {
    font-size: 0.875rem;
    word-break: break-word;
  }

  .contact-form {
    padding: 1.5rem;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px;
    padding: 0.875rem;
    min-height: 48px;
  }

  .form-group textarea {
    min-height: 140px;
  }

  .contact-form .btn-primary {
    width: 100%;
    min-height: 48px;
  }

  /* Footer */
  .footer {
    padding: 2.5rem 0 calc(1.5rem + var(--safe-bottom));
  }

  .footer-grid {
    gap: 1.75rem;
  }

  .footer-brand p {
    font-size: 0.875rem;
  }

  .footer-col h4 {
    margin-bottom: 0.75rem;
  }

  .footer-col ul a {
    font-size: 0.875rem;
    display: inline-block;
    padding: 0.25rem 0;
    min-height: 36px;
  }

  .footer-legal {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .social-link {
    width: 44px;
    height: 44px;
  }

  /* Legal pages */
  .legal-page {
    padding-top: calc(var(--nav-height) + var(--safe-top) + 1.5rem);
    padding-bottom: 2rem;
  }

  .legal-page h1 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
  }

  .legal-page h2 {
    font-size: 1.125rem;
    margin: 1.5rem 0 0.75rem;
  }

  .legal-page p,
  .legal-page li {
    font-size: 0.9375rem;
  }

  .cta-banner-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-banner-actions .btn,
  .cta-banner-actions .btn-phone {
    width: 100%;
    min-height: 48px;
    white-space: normal;
    text-align: center;
  }

  .cta-big-buttons .btn,
  .cta-big-buttons .btn-phone {
    white-space: normal;
    text-align: center;
  }

  .contact-call-or::before,
  .contact-call-or::after {
    display: none;
  }

  .contact-call-or {
    margin: 1.5rem 0 1.25rem;
  }

  .testimonial-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1.25rem;
  }

  .testimonial-row .t-avatar {
    width: 48px;
    height: 48px;
  }

  .testimonial-row .t-stars {
    justify-self: start;
  }

  .testimonial-big {
    padding: 1.5rem 1.25rem;
  }

  .testimonial-big blockquote {
    font-size: 1rem;
  }

  .bedenken-grid,
  .services-teaser-grid,
  .result-grid,
  .vorteil-grid,
  .warum-grid {
    grid-template-columns: 1fr;
  }

  .vorteil-card {
    padding: 1.5rem 1.25rem;
  }

  .vorteil-num {
    font-size: 2.75rem;
  }

  .ki-box {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1rem;
  }

  .ueber-grid {
    gap: 1.75rem;
  }

  .ueber-img-placeholder {
    max-width: min(320px, 100%);
    margin: 0 auto;
  }

  .include-box,
  .zahlung-box {
    padding: 1.25rem;
  }

  .include-box {
    grid-template-columns: 1fr;
  }

  .guarantee-row {
    flex-direction: column;
    align-items: center;
  }

  .guarantee-item {
    width: 100%;
    max-width: 20rem;
    justify-content: center;
    text-align: center;
  }

  .leistung-detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .leistung-detail-actions .btn,
  .leistung-detail-actions .btn-phone {
    width: 100%;
    min-height: 48px;
  }

  .cta-big {
    padding: 1.75rem 1.25rem;
  }

  .cta-big h2 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .service-card--mockup .service-card-body {
    padding: 1.25rem 1.25rem 1.5rem;
  }

  .footer-col ul a,
  .footer-brand p {
    overflow-wrap: anywhere;
  }

  .footer-col ul a {
    word-break: break-word;
  }

  .page-hero {
    padding-top: calc(var(--nav-height) + var(--safe-top) + 1.5rem);
    text-align: left;
  }

  .page-back {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .page-hero p {
    font-size: 0.9375rem;
  }

  .legal-nav-desktop {
    display: none !important;
  }

  .legal-nav-cta {
    display: none !important;
  }

  .legal-back {
    display: inline-flex !important;
  }
}

/* Sehr kleine Handys */
@media (max-width: 380px) {
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }
}

/* Phone CTAs – touch-friendly */
@media (max-width: 768px) {
  .btn-phone,
  .btn-phone-big {
    width: 100%;
    justify-content: center;
  }

  .kontakt-phone-big {
    padding: 1.75rem 1.25rem;
  }

  .cta-big-buttons {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Legal pages: Zurück-Button (nur Mobile sichtbar) */
.legal-back {
  display: none;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent-cyan);
  min-height: 44px;
  padding: 0.25rem 0;
}
