/* ==========================================================================
   MOBILE OPTIMIZATION FIXES (2026) - ANIMATION & VISIBILITY RESTORED
   Fixes: SMM Fly-In, Camera Texts, Layout Flow
   ========================================================================== */

/* 1. GLOBAL SAFETY */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative;
        -webkit-text-size-adjust: 100%;
    }
    section, header, footer, main {
        max-width: 100vw;
        overflow-x: hidden;
    }
}

/* 2. HEADER & MOBILE MENU */
@media (max-width: 768px) {
    /* Nav Wrapper - MUSS über allem liegen! */
    .nav-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important; /* Extrem hoch gesetzt */
        height: auto !important;
        pointer-events: auto !important;
        overflow: visible !important;
    }

    /* Hover-Trigger komplett weg auf Mobile */
    .nav-hover-trigger {
        display: none !important;
    }

    /* NAV BAR - GLASOPTIK FULL HEIGHT (Statusbar + Header) */
    nav {
        /* Standardmäßig ausgeblendet, wird über JS (nav-visible-on-top) gesteuert */
        transform: translateY(-100%);
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        background: rgba(10, 10, 10, 0.35) !important; 
        backdrop-filter: blur(30px) saturate(180%) !important;
        -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
        border-bottom: none !important; 
        overflow: visible !important;
        padding-top: env(safe-area-inset-top, 20px) !important; 
        transition: background 0.3s ease, height 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s ease !important;
        height: 70px !important;
    }

    nav.nav-visible-on-top,
    nav.is-expanded,
    .nav-wrapper:hover nav {
        transform: translateY(0) !important;
    }

    nav.is-expanded {
        height: 230px !important;
        background: rgba(10, 10, 10, 0.45) !important; 
        transform: translateY(0) !important;
    }

    .nav-container {
        padding: 12px 20px !important; 
        justify-content: space-between !important;
        display: flex !important;
        align-items: center !important;
        background: transparent !important; 
        position: relative !important;
        z-index: 1002 !important;
        height: 70px !important;
    }

    .nav-logo-img { height: 24px !important; }
    .nav-right { display: flex !important; align-items: center !important; gap: 12px !important; }
    .cta-button { padding: 8px 14px !important; font-size: 13px !important; white-space: nowrap !important; }
    .nav-links { display: none !important; }

    .mobile-nav-toggle {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        width: 44px !important;
        height: 44px !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer !important;
        z-index: 1001 !important;
        padding: 0 !important;
        pointer-events: auto !important;
        position: relative !important;
    }

    .mobile-nav-toggle span {
        display: block !important;
        width: 24px !important;
        height: 2px !important;
        background-color: #fff !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border-radius: 2px !important;
        position: relative !important;
        transform-origin: center !important;
    }

    .mobile-nav-toggle.is-active span:nth-child(1) { transform: translateY(8px) rotate(45deg) !important; }
    .mobile-nav-toggle.is-active span:nth-child(2) { opacity: 0 !important; transform: translateX(-10px) !important; }
    .mobile-nav-toggle.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg) !important; }

    .mobile-menu {
        display: block !important;
        position: absolute !important;
        top: 70px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        z-index: 1001 !important; 
        border: none !important;
        box-shadow: none !important;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease 0.1s !important;
        pointer-events: none !important;
    }

    .mobile-menu.is-active {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .mobile-menu-inner { padding: 20px 15px 10px 15px !important; }

    .mobile-nav-links {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
        text-align: center !important;
    }

    .mobile-nav-links li { margin: 0 !important; display: flex !important; justify-content: center !important; align-items: center !important; }
    .mobile-nav-links a { font-size: 15px !important; font-weight: 500 !important; color: #d4d4d4 !important; text-decoration: none !important; display: block !important; padding: 8px 4px !important; background: transparent !important; border-radius: 6px !important; width: auto !important; transition: color 0.2s ease !important; }
    .mobile-nav-links a:active, .mobile-nav-links a:hover { color: #fff !important; background: rgba(255,255,255,0.05) !important; }

    .mobile-lang-switch {
        grid-column: span 2 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
        margin-top: 0px !important;
        font-size: 14px !important;
        opacity: 0.8 !important;
        border-top: 1px solid rgba(255,255,255,0.05) !important;
        padding-top: 10px !important;
        padding-bottom: 5px !important;
        width: 100% !important;
    }

    .mobile-lang-switch .lang-de.active, .mobile-lang-switch .lang-en.active { color: var(--brand-red) !important; font-weight: 700 !important; }
    .mobile-lang-switch .lang-en, .mobile-lang-switch .lang-de { color: #d4d4d4 !important; text-decoration: none !important; font-size: 14px !important; }
    .mobile-lang-switch .lang-sep { opacity: 0.3 !important; }
    .mobile-menu-footer { display: none !important; }
}

/* 3. HERO */
@media (max-width: 768px) {
    .hero-content { padding: 0 20px !important; margin-top: 20px !important; width: 100%; }
    .hero-main-text { font-size: clamp(32px, 9vw, 42px) !important; line-height: 1.2 !important; word-wrap: break-word; hyphens: auto; }
    .hero-line { white-space: normal !important; display: block !important; }
    .hero-video-placeholder { right: -35% !important; width: 85vw !important; opacity: 0.5; }
}

/* 4. PARTNER */
@media (max-width: 768px) {
    :root { --section-spacing: 80px !important; }
    #partners { margin-top: 20px !important; padding-bottom: 60px !important; margin-bottom: 0 !important; }
    #partners .section-header { margin-bottom: 0 !important; }
    #partners .section-title { margin-bottom: 0 !important; }
    #partners .marquee { margin-top: 0 !important; }
    #partners .logo-img { height: 60px !important; max-width: 170px !important; }
}

/* 5. EDITORIAL - SAFETY VISIBILITY FIX & ANIMATION */
@media (max-width: 768px) {
    #editorial { 
        padding-top: 100px !important;
        padding-bottom: 80px !important; 
        overflow: visible !important; 
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
    }
    
    #editorial .ed-sticky-wrap, #editorial .ed-sticky, #editorial .ed-grid, #editorial .ed-head, #editorial .ed-copy { 
        display: block !important; opacity: 1 !important; transform: none !important; visibility: visible !important; position: relative !important; height: auto !important;
    }

    #editorial .ed-copy { padding: 0 !important; margin: 0 !important; }

    #editorial .ed-head .section-title {
        font-size: clamp(36px, 4vw, 56px) !important; 
        white-space: normal !important; 
        line-height: 1.2 !important;
        margin-bottom: 0px !important;
        text-align: left; background: none; -webkit-text-fill-color: #fff;
    }
    #editorial .ed-head .section-subtitle { margin-bottom: 0px !important; padding-bottom: 0px !important; }

    #editorial .ed-pane, #editorial .ed-pane.is-active {
        display: block !important;
        position: relative !important;
        top: auto !important; left: auto !important; right: auto !important; bottom: auto !important;
        height: auto !important;
        margin-bottom: 80px !important;
        opacity: 0 !important; 
        transform: translateY(40px) !important; 
        transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
        will-change: opacity, transform;
        pointer-events: none !important; 
    }

    #editorial .ed-pane.in-view, #editorial .ed-pane.is-active.in-view {
        opacity: 1 !important; transform: translateY(0) !important; pointer-events: auto !important;
    }

    #editorial .ed-head + .ed-pane { margin-top: 60px !important; padding-top: 0 !important; }

    #editorial .cf, #editorial .cf-stage, #editorial .cf-card { display: none !important; }
}

/* 6. SERVICES */
@media (max-width: 768px) {
    .services-grid { gap: 20px !important; }
    .service-card { padding: 25px 20px !important; border-radius: 16px !important; }
    .service-icon { font-size: 32px !important; margin-bottom: 16px !important; }
    .service-card h3 { font-size: 20px !important; margin-bottom: 8px !important; }
    .service-card p { font-size: 15px !important; line-height: 1.5 !important; }
}
@media (hover: none) {
    .service-card:hover { transform: none !important; box-shadow: none !important; background: var(--card-bg) !important; }
    .service-card::after, .service-card::before { display: none !important; }
}

/* 7. WHY VARIAD */
@media (max-width: 768px) {
    #why-variad .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
    #why-variad .stat-number { font-size: 28px !important; }
    #why-variad .grid { grid-template-columns: 1fr !important; gap: 20px !important; }
    #why-variad .card.dots { min-height: auto !important; display: block !important; }
    #why-variad .card.dots .card-inner { padding: 32px 32px 10px !important; }
    #why-variad .card.dots .kicker { font-size: 18px !important; margin-bottom: 8px !important; }
    #why-variad .card.dots .desc { font-size: 16px !important; line-height: 1.5 !important; margin-bottom: 24px !important; }
    #why-variad .dot-area { display: flex !important; justify-content: center !important; width: 100% !important; padding: 0 0 32px 0 !important; }
    #why-variad .dot-grid { gap: 11px !important; grid-template-columns: repeat(10, 14px) !important; grid-auto-rows: 14px !important; justify-content: center; margin: 0 auto !important; }
    #why-variad .dot { width: 14px !important; height: 14px !important; box-shadow: none !important; border: none !important; transform: translateZ(0) scale(0.6) !important; }
    #why-variad .dot.show { transform: translateZ(0) scale(1) !important; }

    /* Doppelte Überschrift in Kachel verstecken */
    #why-variad .editorial-headline {
        display: none !important;
    }
}

/* 8. SMM SHOWCASE */
@media (max-width: 768px) {
    #smm { min-height: auto !important; height: auto !important; padding: 80px 20px !important; display: block !important; overflow: visible !important; }
    #smm .showcase { position: static !important; height: auto !important; display: flex !important; flex-direction: column !important; align-items: center !important; gap: 30px !important; opacity: 1 !important; transform: none !important; padding: 0 !important; pointer-events: auto !important; }
    #smm .section-header { order: 1 !important; margin-bottom: 20px !important; }
    #smm .content-slides { position: static !important; inset: auto !important; display: flex !important; flex-direction: column !important; gap: 16px !important; width: 100% !important; max-width: 100% !important; opacity: 1 !important; visibility: visible !important; pointer-events: auto !important; order: 2 !important; }
    #smm .content-slide { 
        position: static !important; 
        inset: auto !important; 
        display: block !important; 
        width: 100% !important; 
        height: auto !important; 
        padding: 0 !important; 
        margin: 0 !important; 
        opacity: 0.1; 
        transform: scale(0.9);
        transition: opacity 0.4s ease, transform 0.4s ease;
        visibility: visible !important; 
    }
    #smm .content-slide .slide-text { 
        position: static !important; 
        top: auto !important; 
        left: auto !important; 
        right: auto !important; 
        bottom: auto !important; 
        inset: auto !important; 
        transform: none !important; 
        width: 100% !important; 
        max-width: 100% !important; 
        opacity: 1 !important; 
        visibility: visible !important; 
        display: block !important; 
        text-align: center !important; 
        margin: 0 auto !important; 
    }
    /* Text Box Styling - Die großen Beschreibungstexte über/unter dem Handy */
    #smm .slide-text p {
        font-size: 26px !important; /* Massively increased to 26px */
        font-weight: 700 !important; /* Slightly bolder for impact */
        line-height: 1.3 !important; /* Tighter line height for large text */
        color: #fff !important;
        background: none !important;
        padding: 15px 0 !important; /* Mehr Abstand zwischen den Blöcken */
        margin: 0 !important;
        text-shadow: 0 2px 10px rgba(0,0,0,0.5) !important;
        text-transform: none !important; /* Kein All-Caps für Fließtext */
    }

    /* Wörter DIREKT im Handy-Display (falls sie dort separat angesprochen werden können) */
    /* Da sie im HTML dieselbe Struktur haben, verkleinern wir sie via Transform im Phone-Wrapper */
    #smm .phone .slide-text p {
        font-size: 10px !important;
        text-transform: uppercase !important;
        font-weight: 800 !important;
    }
    #smm .slide-text::before { display: none !important; }
    #smm .phone-wrap { display: block !important; width: 55% !important; max-width: 200px !important; margin: 10px auto 0 auto !important; order: 3 !important; position: relative !important; transform: none !important; opacity: 1 !important; }

    /* Ring enger ans Handy ziehen */
    #smm .ring {
        inset: -8px !important;
        border-radius: 38px !important;
    }
    #smm .ring::before {
        border-radius: 38px !important;
    }

    /* Messages & Emojis Scaling for Mobile BACKGROUND (floating behind text) */
    #smm .msg {
        font-size: 14px !important; 
        padding: 6px 10px !important;
        border-radius: 12px !important;
        opacity: 0.4; 
        box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
    }

    #smm .emoji {
        width: 20px !important;
        height: 20px !important;
        opacity: 0.4; 
    }

    /* Text Slide Z-Index Check: ensure text is always on top */
    #smm .content-slide .slide-text {
        z-index: 50 !important;
    }

    /* Cards & Labels within the Phone Frame - MUST STAY SMALL */
    #smm .card {
        height: 38px !important; 
        border-radius: 8px !important;
    }
    #smm .card.big {
        height: 58px !important;
    }
    #smm .card .label {
        font-size: 12px !important;
        line-height: 1.0 !important;
        text-transform: uppercase !important;
        font-weight: 900 !important;
    }
    #smm .card.big .label {
        font-size: 12px !important;
    }

    @keyframes msgPopFloat {
      0%   { transform: translate(calc(0px + var(--sx,0px)), calc(0px + var(--sy,0px))) scale(1); opacity: 0.4 }
      70%  { opacity: 0.3 }
      100% { transform: translate(calc(var(--dx,0px) + var(--sx,0px)), calc(var(--dy,0px) + var(--sy,0px) - var(--rise,80px))) scale(1); opacity: 0 }
    }
    @keyframes popFloat {
      0%   { transform: translate(calc(0px + var(--sx,0px)), calc(0px + var(--sy,0px))) scale(1); opacity: 0.4 }
      60%  { opacity: 0.25 }
      100% { transform: translate(calc(var(--dx,0px) + var(--sx,0px)), calc(var(--dy,0px) + var(--sy,0px) - var(--rise,80px))) scale(0.95); opacity: 0 }
    }
}

/* 9. KAMERA / CONTENT PRODUCTION - MOBILE: NORMALER SCROLL */
@media (max-width: 768px) {
    /* KRITISCH: Kein Sticky, keine riesige Höhe, normaler Scroll, TRANSPARENTER Hintergrund */
    #content-production {
        position: relative !important;
        min-height: auto !important;
        height: auto !important;
        padding: 80px 20px !important;
        margin: 0 !important;
        display: block !important;
        overflow: visible !important;
        background: transparent !important;
    }

    /* KEIN STICKY - normaler Dokumentenfluss, KEINE feste Höhe */
    .camera-viewfinder {
        position: static !important;
        top: auto !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        display: block !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* HEADER OBEN */
    .camera-header {
        margin-bottom: 110px !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: relative !important;
        display: block !important;
        text-align: center !important;
    }
    .camera-header h2 {
        font-size: clamp(36px, 8vw, 48px) !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
        margin-bottom: 16px !important;
    }
    .camera-header p {
        font-size: 16px !important;
        opacity: 0.8 !important;
    }
    .camera-header .eyebrow {
        display: none !important;
    }

    /* ALLES VERSTECKEN: Wireframe, Grid, Settings, Steps */
    .camera-wireframe,
    .camera-grid,
    .camera-settings,
    .production-steps,
    .camera-body-wrapper > svg {
        display: none !important;
    }

    /* Camera Interface - normaler Block */
    .camera-interface {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Camera Body Wrapper - KEIN aspect-ratio! */
    .camera-body-wrapper {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        max-width: none !important;
        overflow: visible !important;
        aspect-ratio: unset !important;
    }

    /* Camera Screen - KRITISCH: Alle Desktop-Positionierungen zurücksetzen */
    .camera-screen {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        inset: auto !important;
        transform: none !important;
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    /* TEXT KARTEN CONTAINER - Collective Outline on Mobile */
    .production-cards {
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 60px !important; 
        width: 100% !important;
        height: auto !important; 
        overflow: visible !important;
        padding: 40px 20px !important;
        border: 2.5px solid #ff2200 !important;
        border-radius: 24px !important;
        box-shadow: 0 0 15px rgba(255, 34, 0, 0.2) !important;
        background: transparent !important;
        background-color: transparent !important;
        justify-content: flex-start !important;
        margin: 0 auto 40px auto !important;
        box-sizing: border-box !important;
    }

    /* Remove redundant frame style if present */
    .production-text-frame {
        display: contents !important;
    }

    /* PRODUCTION CARD - Alle Varianten */
    .production-card,
    .production-card.active {
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
        box-shadow: none !important;
        justify-content: flex-start !important;
        align-items: center !important;
    }

    /* Card Content - Einfacher Text */
    .card-content {
        position: static !important;
        padding: 0 !important;
        opacity: 1 !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        border: none !important;
        border-radius: 0 !important;
        margin: 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        background: transparent !important;
        background-color: transparent !important;
        box-shadow: none !important;
        inset: auto !important; 
        transform: none !important; 
    }

    .card-content .step-number {
        font-size: 12px !important;
        letter-spacing: 2px !important;
        opacity: 1 !important;
        margin-bottom: 8px !important;
        color: #ff2200 !important;
        display: block !important;
        text-align: center !important;
        width: 100% !important;
    }

    .card-content .step-title {
        font-size: 24px !important;
        font-weight: 700 !important;
        opacity: 1 !important;
        margin-bottom: 12px !important;
        display: block !important;
        color: #fff !important;
        text-align: center !important;
        width: 100% !important;
        min-height: 1.2em !important;
    }

    .card-content .step-desc {
        font-size: 17px !important;
        line-height: 1.6 !important;
        opacity: 0.9 !important;
        display: block !important;
        color: #e5e5e5 !important;
        text-align: center !important;
        width: 100% !important;
        min-height: 4.8em !important;
    }
}

/* 10. CONTACT - KEIN INTERNER SCROLL! */
@media (max-width: 768px) {
    #contact {
        padding: 60px 15px !important;
        min-height: auto !important;
        height: auto !important;
        display: block !important;
        opacity: 1 !important;
        overflow: visible !important;
    }

    #contact .section-title {
        margin-bottom: 40px !important; /* Weiter vergrößerter Abstand zum Untertitel */
    }

    .contact-wrapper {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    .contact-right {
        margin-top: 80px !important; /* Deutlicher Abstand zur Founder Card auf Mobile */
    }

    .contact-left {
        height: auto !important;
        overflow: visible !important;
    }

    .modern-form-container {
        width: 100% !important;
        padding: 30px 20px !important;
        border-radius: 20px !important;
        overflow: visible !important;
        height: auto !important;
    }

    /* WIZARD - Feste Höhe mit absolut positionierter Navigation */
    .wizard,
    #contact-wizard {
        position: relative !important;
        min-height: 600px !important;
        height: 600px !important;
        overflow: visible !important;
        padding-bottom: 80px !important;
    }

    .wiz-viewport {
        position: relative !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Inaktive Steps verstecken */
    .wiz-step {
        display: none !important;
        position: relative !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
    }

    .wiz-step.is-active {
        display: block !important;
    }

    /* Schritt 1 (Beschreibung) auf Mobile weiter nach unten schieben */
    .wiz-step[data-step="1"].is-active {
        padding-top: 40px !important;
    }

    /* Navigation ABSOLUT FIXIERT am unteren Rand des Wizards */
    .wiz-nav {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 20px 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }

    /* KONTAKTFORMULAR KOMPAKTER - Labels verstecken, nur Placeholders */
    .form-mini label {
        display: none !important;
    }

    .form-mini input {
        margin-top: 0 !important;
        padding: 12px 0 !important;
        font-size: 15px !important;
    }

    .form-mini {
        margin-bottom: 0 !important;
    }

    .grid-two {
        gap: 0 !important;
        margin-bottom: 0 !important;
    }

    .wiz-step[data-step="3"] .grid-two + .grid-two {
        margin-top: 0 !important;
    }

    .chip-grid {
        height: auto !important;
        overflow: visible !important;
    }

    textarea#wiz-note {
        min-height: 380px !important;
        height: 380px !important; 
        font-size: 17px !important; 
        padding: 20px !important;
        box-sizing: border-box !important;
    }
    input[type=range] { height: 60px !important; }
}