/* ============================================
   COMPREHENSIVE MOBILE OPTIMIZATIONS
   Added by Antigravity for mobile device support
   ============================================ */

/* iOS Safe Area Support */
@media (max-width: 768px) {
    :root {
        --safe-area-inset-top: env(safe-area-inset-top);
        --safe-area-inset-right: env(safe-area-inset-right);
        --safe-area-inset-bottom: env(safe-area-inset-bottom);
        --safe-area-inset-left: env(safe-area-inset-left);
    }

    body {
        padding-top: var(--safe-area-inset-top);
        padding-bottom: var(--safe-area-inset-bottom);
    }

    /* Header Mobile Optimizations */
    header {
        top: calc(10px + var(--safe-area-inset-top));
        width: 95%;
        height: 56px;
        padding: 0 16px;
        max-width: none;
        border-radius: var(--radius-pill);
        /* Keep rounded on mobile */
    }

    .header-inner {
        padding: 0 12px;
    }

    .logo-img {
        height: 28px;
    }

    nav {
        display: none;
        /* Mobile menu needed */
    }

    /* Hero Section Mobile */
    .hero {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 80px 20px 40px;
        /* Reduced top padding */
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow: hidden;
        /* Ensure grid doesn't overflow container */
        position: relative;
        /* Context for absolute positioning */
    }

    /* Grid Motion Background - Mobile (dctinyshop style) */
    .gridMotion-container {
        width: 200vw !important;
        height: 200vh !important;
        gap: 0.5rem !important;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) rotate(-15deg) !important;
        /* Center and keep rotation */
        z-index: 0;
    }

    .gridMotion-container .row {
        gap: 0.5rem !important;
    }

    /* Hero Text Optimizations */
    .eyebrow {
        font-size: 11px;
        padding: 8px 16px;
        margin-bottom: 24px;

        /* Configurator Mobile Optimization */
        .configurator-container {
            padding: 32px 16px;
            /* Reduced side padding */
            padding-bottom: 100px;
            /* Space for sticky bar */
            max-width: 100vw;
            overflow-x: hidden;
            /* Critical: Prevent horizontal overflow */

            /* Price Summary Mobile Optimization - Kompakte Version */
            .form-summary {
                display: flex !important;
                grid-template-columns: none !important;
                flex-direction: column !important;
                align-items: stretch !important;
                gap: 16px !important;
                /* Reduziert von 24px */
                margin-top: 24px !important;
                /* Reduziert von 32px */
                border-top: none !important;
                width: 100% !important;
                max-width: 100% !important;
                box-sizing: border-box !important;
            }

            .price-summary {
                width: 100% !important;
                box-sizing: border-box !important;
                background: rgba(255, 255, 255, 0.03);
                border: 1px solid rgba(255, 255, 255, 0.05);
                border-radius: 10px;
                /* Reduziert von 12px */
                padding: 14px !important;
                /* Reduziert von 20px */
                overflow: hidden;
            }

            .summary-row {
                flex-wrap: wrap !important;
                gap: 6px;
                /* Reduziert von 8px */
                width: 100% !important;
                box-sizing: border-box !important;
                padding: 8px 0 !important;
                /* Reduziert von 12px */
                font-size: 14px !important;
                /* Reduziert von 15px */
            }

            .summary-row span:first-child {
                font-size: 14px !important;
                /* Label kompakter */
            }

            .summary-row span:last-child {
                font-size: 14px !important;
                /* Wert kompakter */
                font-weight: 700;
            }

            .summary-total {
                padding: 12px 0 8px !important;
                /* Kompakter */
            }

            .summary-total span:first-child {
                font-size: 15px !important;
                /* Label etwas größer als normale rows */
            }

            .summary-total span:last-child {
                font-size: 22px !important;
                /* Reduziert von 26px -> 32px */
                word-break: break-word !important;
            }

            .price-note {
                font-size: 11px !important;
                /* Reduziert von 12px */
                margin-top: 8px !important;
            }

            .btn-submit {
                width: 100% !important;
                max-width: 100% !important;
                box-sizing: border-box !important;
                margin: 0 !important;
                display: flex !important;
                flex-wrap: wrap !important;
                justify-content: center;
                align-items: center;
                padding: 14px 16px !important;
                /* Kompakter */
                font-size: 15px !important;
                /* Reduziert von 16px */
                min-width: 0 !important;
                white-space: normal !important;
                word-break: break-word !important;
                text-align: center;
                line-height: 1.2;
                height: auto !important;
            }
        }

        /* Enhanced Package Selection for Touch */
        .package-options {
            grid-template-columns: 1fr !important;
            gap: 16px;
        }

        .package-option {
            position: relative;
        }

        .package-option input:checked+.package-option-card {
            border-color: #c4ff00;
            background: rgba(196, 255, 0, 0.08);
            /* More visible active state */
            box-shadow: 0 4px 20px rgba(196, 255, 0, 0.15);
            transform: translateY(-2px);
        }

        .package-check {
            width: 24px;
            height: 24px;
            font-size: 14px;
            /* Larger checkmark */
        }

        /* Addon Checkbox Touch Targets */
        .addon-checkbox {
            padding: 16px;
            /* Larger touch area */
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.02);
            margin-bottom: 12px;
            display: flex;
            align-items: center;
        }

        .addon-checkbox input:checked+.addon-checkbox-label span:first-child {
            color: #c4ff00;
            /* Highlight text */
        }


        .eyebrow-icon {
            width: 14px;
            height: 14px;
        }

        .statement-text {
            font-size: clamp(40px, 11vw, 60px);
            /* Optimized size */
            margin-bottom: 24px;
            line-height: 1.1;
            /* Tighter line-height */
            text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
            /* Improved readability */
        }

        .sub-statement {
            font-size: clamp(14px, 4vw, 18px);
            margin-bottom: 32px;
            line-height: 1.6;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
            /* Improved readability */
        }

        /* Hero Buttons - Mobile Friendly */
        .hero-actions {
            flex-direction: column;
            gap: 12px;
            width: 100%;
            max-width: 350px;
            margin: 0 auto;
        }

        .btn-hero-primary,
        .btn-hero-secondary {
            width: 100%;
            padding: 16px 24px;
            justify-content: center;
            font-size: 15px;
            min-height: 52px;
            /* Touch-optimized */
        }

        .btn-hero-primary {
            padding-right: 52px;
        }

        .btn-hero-primary .btn-icon {
            right: 20px;
        }

        /* Hide Floating Elements on Mobile */
        /* Scroll Indicator - Mobile Adjusted */
        .scroll-indicator {
            display: flex;
            bottom: 20px;
            transform: scale(0.7) translateX(-50%);
            opacity: 0.8;
            pointer-events: none;
        }

        .stat-card {
            display: none;
        }

        /* Sections Mobile */
        .section {
            padding: 60px 0;
        }

        .section-head {
            margin-bottom: 40px;
            text-align: center;
        }

        .section-head h2 {
            font-size: clamp(28px, 8vw, 36px);
        }

        .section-head p {
            font-size: 16px;
            line-height: 1.6;
        }

        .section-label {
            font-size: 12px;
        }

        /* Expertise Cards Mobile */
        .expertise-grid {
            grid-template-columns: 1fr !important;
            gap: 20px;
        }

        .expertise-card {
            padding: 24px;
        }

        .expertise-card h3 {
            font-size: 20px;
        }

        .expertise-icon {
            width: 48px;
            height: 48px;
            margin-bottom: 16px;
        }

        .expertise-icon svg {
            width: 28px;
            height: 28px;
        }

        /* Pricing Mobile */
        .pricing-grid {
            grid-template-columns: 1fr !important;
            gap: 24px;
        }

        .pricing-card {
            padding: 28px 24px;
        }

        .pricing-badge {
            font-size: 12px;
            padding: 6px 12px;
        }

        .price-amount {
            font-size: 36px;
        }

        .pricing-features li {
            font-size: 14px;
        }

        /* Configurator Mobile */
        .configurator-container {
            padding: 32px 20px;
        }

        .package-options {
            grid-template-columns: 1fr !important;
            gap: 16px;
        }

        .form-grid {
            grid-template-columns: 1fr !important;
            gap: 20px;
        }

        .form-group label {
            font-size: 14px;
        }

        .form-group input,
        .form-group textarea,
        .form-group select {
            font-size: 16px;
            /* Prevents iOS zoom */
            padding: 14px;
            min-height: 48px;
            /* Touch-friendly */
            font-family: 'Inter', sans-serif;
        }

        .form-group select {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background-color: rgba(255, 255, 255, 0.05);
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a855f7' d='M1.41 0L6 4.58 10.59 0 12 1.42l-6 6-6-6z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 16px center;
            background-size: 12px;
            padding-right: 40px;
            cursor: pointer;
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .form-group select option {
            background-color: #0f1419;
            color: white;
            padding: 12px;
        }

        .form-group select:focus {
            outline: 2px solid #a855f7;
            outline-offset: 2px;
            background-color: rgba(255, 255, 255, 0.08);
            border-color: #a855f7;
        }

        .form-group textarea {
            min-height: 120px;
        }

        /* Add-ons Grid Mobile */
        .addons-grid {
            grid-template-columns: 1fr !important;
            gap: 24px;
        }

        .addon-item {
            font-size: 14px;
        }

        /* Maintenance Section Mobile */
        .maintenance-card {
            padding: 24px 20px;
        }

        .maintenance-offer h4 {
            font-size: 18px;
        }

        /* Contact Mobile */
        .contact-grid {
            grid-template-columns: 1fr !important;
            gap: 20px;
        }

        .contact-card {
            padding: 24px;
        }

        .contact-icon svg {
            width: 28px;
            height: 28px;
        }

        .contact-card h3 {
            font-size: 18px;
        }

        /* Footer Mobile - Comprehensive Redesign */
        footer {
            padding: 60px 0 20px;
            text-align: center;
        }

        .footer-section {
            padding: 50px 0 20px;
            text-align: center;
        }

        footer * {
            text-align: center;
        }

        /* Footer CTA Mobile */
        .footer-cta {
            padding: 40px 24px;
            flex-direction: column;
            text-align: center;
            gap: 24px;
            border-radius: 16px;
            margin-bottom: 48px;
        }

        .cta-content h3 {
            font-size: clamp(22px, 6vw, 28px);
            margin-bottom: 12px;
        }

        .cta-content p {
            font-size: 15px;
            line-height: 1.6;
        }

        .cta-buttons {
            flex-direction: column;
            width: 100%;
            gap: 12px;
        }

        .btn-cta-primary,
        .btn-cta-secondary {
            width: 100%;
            justify-content: center;
            min-height: 52px;
            font-size: 15px;
            padding: 16px 24px;
        }

        /* Footer Links Grid */
        .footer-links {
            grid-template-columns: 1fr !important;
            gap: 40px;
            padding: 0 20px;
            margin-bottom: 40px;
        }

        .footer-column {
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .footer-column h4 {
            font-size: 16px;
            margin-bottom: 16px;
            text-align: center;
        }

        .footer-column ul {
            display: flex;
            flex-direction: column;
            gap: 12px;
            align-items: center;
            width: 100%;
        }

        .footer-column li {
            text-align: center;
            width: 100%;
        }

        .footer-column a {
            font-size: 14px;
            padding: 8px 0;
            display: inline-block;
            text-align: center;
        }

        /* Footer Bottom */
        .footer-bottom {
            flex-direction: column;
            gap: 24px;
            padding: 24px 20px;
            text-align: center;
        }

        .footer-legal {
            flex-direction: column;
            gap: 16px;
            align-items: center;
        }

        .footer-legal a {
            font-size: 13px;
            padding: 4px 0;
        }

        .footer-copyright {
            font-size: 13px;
            text-align: center;
        }

        /* Social Links in Footer */
        .footer-socials {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 24px;
            margin-left: auto;
            margin-right: auto;
        }

        .footer-socials a {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 50%;
            transition: all 0.3s;
        }

        .footer-socials a:hover {
            background: rgba(168, 85, 247, 0.2);
            transform: translateY(-2px);
        }

        /* Footer Logo */
        .footer-logo,
        .footer-brand {
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 0 auto 24px;
            width: 100%;
        }

        .footer-logo img {
            max-width: 150px;
            height: auto;
            margin: 0 auto;
        }

        /* Touch Optimizations */
        * {
            -webkit-tap-highlight-color: transparent;
        }

        button,
        .btn-hero-primary,
        .btn-hero-secondary,
        .btn-pill,
        .btn-pricing,
        .btn-submit,
        a[class*="btn"] {
            min-width: 44px;
            min-height: 44px;
        }

        /* Submit Button Mobile Fix */
        .btn-submit {
            width: 100%;
            padding: 18px 24px;
            font-size: 15px;
            justify-content: center;
            white-space: normal;
            text-align: center;
            min-height: 56px;
        }

        .btn-submit span:first-child {
            flex: 1;
        }

        .btn-arrow {
            flex-shrink: 0;
        }



        /* Typography Adjustments */
        h1 {
            font-size: clamp(32px, 10vw, 48px);
        }

        h2 {
            font-size: clamp(24px, 7vw, 32px);
        }

        h3 {
            font-size: clamp(18px, 5vw, 24px);
        }

        p {
            font-size: clamp(14px, 4vw, 16px);
            line-height: 1.6;
        }
    }

    /* Ultra-Narrow Screens - Configurator Extra Compact */
    @media (max-width: 497px) {
        .configurator-container {
            padding: 24px 12px !important;
            /* Noch kompakter */

            .project-form {
                padding: 24px 12px !important;
                /* Reduziert */
            }

            .form-summary {
                gap: 12px !important;
                margin-top: 20px !important;
            }

            .price-summary {
                padding: 10px !important;
                /* Sehr kompakt */
                border-radius: 8px;
            }

            .summary-row {
                padding: 6px 0 !important;
                font-size: 13px !important;
                /* Noch kleiner */
                gap: 4px;
            }

            .summary-row span:first-child {
                font-size: 13px !important;
            }

            .summary-row span:last-child {
                font-size: 13px !important;
            }

            .summary-total span:first-child {
                font-size: 14px !important;
            }

            .summary-total span:last-child {
                font-size: 18px !important;
                /* Deutlich kleiner */
            }

            .price-note {
                font-size: 10px !important;
            }

            .btn-submit {
                padding: 12px 14px !important;
                font-size: 14px !important;
                gap: 6px;
            }

            .btn-arrow {
                font-size: 16px;
                /* Kleiner Pfeil */
            }
        }
    }

    /* Small Mobile Devices */
    @media (max-width: 375px) {
        .header-inner {
            padding: 0 8px;
        }

        .hero {
            padding: 90px 16px 50px;
        }

        .statement-text {
            font-size: clamp(32px, 11vw, 60px);
        }

        .btn-hero-primary,
        .btn-hero-secondary {
            font-size: 14px;
            padding: 14px 20px;
            min-height: 50px;
        }

        .section {
            padding: 50px 0;
        }

        .section-head h2 {
            font-size: 26px;
        }
    }

    /* Landscape Mobile */
    @media (max-width: 768px) and (orientation: landscape) {
        .hero {
            min-height: auto;
            padding: 80px 20px 40px;
        }

        .statement-text {
            font-size: clamp(28px, 8vw, 48px);
            margin-bottom: 16px;
        }

        .sub-statement {
            font-size: clamp(13px, 3.5vw, 16px);
            margin-bottom: 24px;
        }

        .hero-actions {
            flex-direction: row;
            max-width: 100%;
            justify-content: center;
        }

        .btn-hero-primary,
        .btn-hero-secondary {
            width: auto;
            min-width: 160px;
        }
    }

    /* Performance Optimizations */
    @media (max-width: 768px) {

        /* Reduce animations for better performance */
        @media (prefers-reduced-motion: reduce) {

            *,
            *::before,
            *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
        }

        /* GPU Acceleration */
        .hero-gradient-overlay,
        .gridMotion-container,
        .row {
            will-change: transform;
            transform: translateZ(0);
        }
    }