/* ==========================================================================
   responsive.css – Breakpoints und mobile Anpassungen
   ========================================================================== */

/* ----------------------------------------------------------
   GLOBAL: iOS Safari & Mobile-Browser Fixes
   ---------------------------------------------------------- */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* iOS Safari verhindert Zoom beim Tippen in Inputs (Schriftgröße ≥16px) */
}

body {
    -webkit-tap-highlight-color: transparent;
    /* Kein blauer Touch-Highlight beim Antippen */
}

/* iPhone-Notch / Safe-Area: Header und Footer respektieren die "ear" Bereiche */
@supports (padding: max(0px)) {
    .site-header,
    .mobile-nav,
    .cookie-banner {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    .site-footer {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
}

/* Touch-Geräte: Hover-Effekte sinnvoll deaktivieren */
@media (hover: none) and (pointer: coarse) {
    .card:hover,
    .btn-primary:hover,
    .btn-secondary:hover,
    [data-tilt]:hover {
        transform: none !important;
    }
    /* Tilt-3D-Effekt komplett aus auf Touch */
    [data-tilt]:hover::after { opacity: 0; }
}

/* Mindest-Touch-Target 44×44px (WCAG 2.5.5) */
@media (hover: none) {
    .btn,
    .nav-list a,
    .nav-mega-item,
    .nav-mega-feature,
    .footer-cookie-btn,
    .menu-toggle,
    .form-checkbox,
    .faq-item summary {
        min-height: 44px;
    }
}

/* Inputs: Schriftgröße ≥16px verhindert iOS-Auto-Zoom beim Fokus */
@media (max-width: 768px) {
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px !important;
    }
}

/* ----------------------------------------------------------
   1200px – Tablet Landscape
   ---------------------------------------------------------- */
@media (max-width: 1200px) {
    :root {
        --section-padding: 96px;
    }
}

/* ----------------------------------------------------------
   992px – Tablet & Desktop-Mega-Menu wird zum Mobile-Burger
   ---------------------------------------------------------- */
@media (max-width: 992px) {
    :root {
        --section-padding: 80px;
    }

    /* Header → Burger-Menü */
    .primary-nav { display: none; }
    .menu-toggle { display: flex; }
    .header-actions .btn { display: none; }
    .header-login { display: none; }

    /* Mega-Menu auf Mobile gar nicht erst öffnen */
    .nav-dropdown-menu {
        display: none !important;
    }

    /* Hero zweispaltig → einspaltig */
    .hero {
        min-height: auto;
        padding: 8rem 0 5rem;
    }
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }
    .hero-content {
        max-width: 720px;
        margin: 0 auto;
    }
    .hero-content > p { margin-inline: auto; }
    .hero-actions  { justify-content: center; }
    .hero-meta     { justify-content: center; }
    .hero-visual {
        max-width: 360px;
        order: -1;
    }
    .scroll-indicator { display: none; }

    /* Page-Hero mit Visual: Visual über Content */
    .page-hero-with-visual { padding: 7.5rem 0 3rem; text-align: center; }
    .page-hero-with-visual .container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .page-hero-with-visual .hero-actions { justify-content: center; }
    .page-hero-with-visual .illu-wrapper { order: -1; max-width: 360px; }

    /* Grids stärker reduzieren */
    .grid-3,
    .grid-4,
    .problem-grid,
    .services-grid,
    .solution-pillars,
    .values-grid,
    .feature-icon-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .branchen-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .grid-asym-2,
    .security-block,
    .contact-grid,
    .compare-grid,
    .big-visual-section {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .big-visual-section.reverse .big-visual-text { order: 1; }
    .big-visual-section.reverse .big-visual-illu { order: 2; }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

/* ----------------------------------------------------------
   768px – Tablet Portrait & Smartphone Landscape
   ---------------------------------------------------------- */
@media (max-width: 768px) {
    :root {
        --section-padding: 72px;
    }

    .section-header { margin-bottom: 2.5rem; }
    .hero { padding-top: 7rem; }
    .hero-content h1 { font-size: clamp(2rem, 8vw, 2.75rem); }
    .hero-content > p { font-size: 1rem; }

    .hero-actions { gap: 0.75rem; }
    .hero-actions .btn {
        flex: 1 1 auto;
        min-width: 140px;
    }
    .hero-meta {
        gap: 0.75rem 1.25rem;
        margin-top: 2rem;
    }
    .hero-meta-item {
        font-size: 0.8rem;
    }

    /* CTA-Block */
    .cta-card { padding: 3rem 1.5rem; }
    .cta-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .cta-actions .btn { width: 100%; }
    .cta-ring { width: 360px; height: 360px; }

    /* Workflow-Chain wird vertikal */
    .workflow-chain {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        max-width: 360px;
        margin: 2rem auto;
    }
    .workflow-node { max-width: none; width: 100%; }
    .workflow-arrow {
        width: 2px !important;
        height: 24px !important;
        margin: 0 auto !important;
        background: linear-gradient(180deg, var(--color-primary-light), var(--color-accent)) !important;
    }
    .workflow-arrow::after {
        right: auto !important;
        top: auto !important;
        bottom: -4px;
        left: -3px;
        border-left: 4px solid transparent !important;
        border-right: 4px solid transparent !important;
        border-top: 8px solid var(--color-accent) !important;
        border-bottom: none !important;
    }

    /* Demo-Card-Flow auf Mobile als Chips wrappen */
    .demo-card-flow {
        flex-wrap: wrap;
        gap: 0.4rem;
        font-size: 0.85rem;
    }

    /* Compare-Grid auf Mobile direkt einspaltig */
    .compare-grid { grid-template-columns: 1fr; gap: 1rem; }

    /* Form */
    .form-row { grid-template-columns: 1fr; }

    /* Cookie-Banner Aktionen vertikal */
    .cookie-banner-inner {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 1.25rem;
    }
    .cookie-banner-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-banner-actions .btn { width: 100%; }

    /* Tabellen scrollbar machen (z.B. Datenschutz Cookie-Tabelle) */
    .legal-page table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        font-size: 0.85rem !important;
    }

    /* Stat-Cards kompakter */
    .stat-card { padding: 1.5rem 1rem; }
    .stat-card-num { font-size: clamp(2rem, 8vw, 2.75rem); }

    /* Footer: Brand-Block volle Breite, Spalten klein */
    .footer-brand { grid-column: 1 / -1; }

    /* Page-Hero-Title kompakter */
    .page-hero-title { font-size: clamp(1.75rem, 7vw, 2.5rem); }
}

/* ----------------------------------------------------------
   576px – Smartphone Portrait
   ---------------------------------------------------------- */
@media (max-width: 576px) {
    :root {
        --section-padding: 64px;
    }

    .container {
        width: min(100% - 32px, var(--container-width));
    }

    .nav-list a { font-size: 0.875rem; }

    /* Alle Karten-Grids einspaltig */
    .grid-2,
    .grid-3,
    .grid-4,
    .problem-grid,
    .services-grid,
    .solution-pillars,
    .values-grid,
    .feature-icon-grid {
        grid-template-columns: 1fr;
    }
    .branchen-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Cards & Buttons kompakter */
    .card { padding: 1.5rem; }
    .feature-icon-card { padding: 1.5rem 1.25rem; }
    .feature-icon-card-icon { width: 56px; height: 56px; }
    .feature-icon-card-icon svg { width: 28px; height: 28px; }

    /* Hero-Visual klein */
    .hero-visual { max-width: 260px; }
    .illu-wrapper { max-width: 280px; }

    .page-hero {
        padding-top: 7rem;
        padding-bottom: 3rem;
    }

    /* Footer Bottom stacken */
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    .footer-claim {
        font-size: 0.8rem;
        max-width: 100%;
    }

    .eyebrow {
        font-size: 0.7rem;
        padding: 0.35em 0.85em;
    }

    .section-header h2 { font-size: clamp(1.5rem, 6vw, 2rem); }

    /* Timeline kompakter */
    .timeline { padding-left: 2rem; }
    .timeline-step-num { display: none; }
    .timeline-step { padding: 1.25rem 0 1.25rem 1rem; }
    .timeline-step::before { left: -1.6rem; }

    .cta-ring { width: 280px; height: 280px; }
    .cta-content h2 { font-size: clamp(1.4rem, 6vw, 1.8rem); }

    /* Cookie-Modal volle Breite */
    .cookie-modal-panel { max-height: 95vh; }
    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer { padding: 1.25rem; }
    .cookie-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-modal-footer .btn { width: 100%; }
    .cookie-category {
        grid-template-columns: 48px 1fr;
        gap: 0.75rem;
    }

    /* Cards mit padding-Ausnahme zurücksetzen (style="padding: 2.5rem;") */
    article.card[style*="padding"] {
        padding: 1.5rem !important;
    }
    article.card[style*="padding: 3rem"] {
        padding: 1.75rem !important;
    }

    /* Demo-Cards mit Workflow-Chain volle Breite */
    .workflow-chain {
        max-width: 100%;
    }

    /* Legal-Pages Headlines kompakter */
    .legal-page h1 { font-size: 1.85rem; }
    .legal-page h2 { font-size: 1.25rem; }
    .legal-page h3 { font-size: 1.05rem; }
}

/* ----------------------------------------------------------
   380px – Kleine Smartphones (iPhone SE etc.)
   ---------------------------------------------------------- */
@media (max-width: 380px) {
    :root {
        --section-padding: 56px;
    }

    .hero-content h1 { font-size: 1.85rem; }
    .branchen-grid { grid-template-columns: 1fr; }

    /* Logo-Text optional ausblenden, nur Mark zeigen */
    .logo-text { display: none; }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .hero-actions .btn { width: 100%; }

    /* Header-Padding kompakter */
    .header-inner { gap: 0.5rem; }

    /* Cookie-Banner sehr kompakt */
    .cookie-banner {
        left: 0.5rem;
        right: 0.5rem;
        bottom: 0.5rem;
    }
    .cookie-banner-inner { padding: 1rem; }

    /* Buttons full-width */
    .btn-large { padding: 0.95rem 1.4rem; font-size: 0.95rem; }
}

/* ----------------------------------------------------------
   Reduzierte Bewegung – Performance auf älteren Geräten
   ---------------------------------------------------------- */
@media (max-width: 768px) {
    /* Auf Mobile: weniger schwere Effekte */
    .scene-3d {
        opacity: 0.7;
    }
    .wireframe-shape:nth-child(n+5) { display: none; }
    .polygon-floater-2,
    .polygon-floater-4 { display: none; }
    .aurora-3 { display: none; }
    .starfield-layer-3 { display: none; }
}

@media (max-width: 480px) {
    /* Sehr kleine Geräte: Polygon-Floaters komplett aus */
    .polygon-floater { display: none; }
    .scene-3d { opacity: 0.6; }
}

/* ----------------------------------------------------------
   Print-Styles (z.B. Impressum / AGB drucken)
   ---------------------------------------------------------- */
@media print {
    .site-header,
    .site-footer,
    .scene-3d,
    .cookie-banner,
    .cookie-modal,
    .menu-toggle,
    .mobile-nav,
    .hero-bg,
    .reveal,
    .reveal-up,
    .reveal-left,
    .reveal-right { display: none !important; }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .legal-page {
        padding-top: 0 !important;
    }

    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
    }
}
