/* ==========================================================================
   MOBILE RESPONSIVE FIXES - IT-Bas Website
   Optimiert für 480px (kleine Smartphones) und 375px (sehr kleine Geräte)
   ========================================================================== */

/* ========== GLOBAL MOBILE FIXES ========== */
body {
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* ========== 480px BREAKPOINT (iPhone SE, kleine Smartphones) ========== */
@media (max-width: 480px) {

    /* Typography */
    h1 {
        font-size: clamp(1.875rem, 8vw, 2.5rem) !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: clamp(1.5rem, 7vw, 2rem) !important;
        line-height: 1.3 !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    h4 {
        font-size: 1.125rem !important;
    }

    p {
        font-size: 0.9375rem !important; /* 15px */
        line-height: 1.6 !important;
    }

    /* Hero Sections */
    .hero h1,
    div[style*="font-size: 3.5rem"] h1,
    h1[style*="font-size: 3.5rem"],
    h1[style*="3.5rem"] {
        font-size: clamp(1.75rem, 8vw, 2.5rem) !important;
        line-height: 1.2 !important;
        word-break: break-word !important;
        hyphens: auto !important;
        max-width: 100% !important;
        padding: 0 10px !important;
    }

    .hero p,
    p[style*="font-size: 1.3rem"] {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        margin-bottom: 25px !important;
    }

    /* Section-2025 Hero Padding */
    .section-2025[style*="padding: 150px"] {
        padding: 60px 0 40px 0 !important;
    }

    /* Hero Content Container */
    .section-2025 .section-content > div[style*="max-width: 800px"] {
        max-width: 100% !important;
        padding: 0 20px !important;
    }

    /* Alle H1 Überschriften auf Unterseiten - Mobile Fix */
    .section-2025 h1,
    .section-content h1,
    div[style*="text-align: center"] h1,
    div[style*="max-width: 800px"] h1,
    h1[style*="font-size: 3.5rem"],
    h1[style*="font-weight: 800"] {
        font-size: clamp(1.75rem, 7vw, 2.5rem) !important;
        line-height: 1.2 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        padding: 0 15px !important;
        white-space: normal !important;
        max-width: 100% !important;
    }

    /* H2 Überschriften - Mobile Fix */
    .section-2025 h2,
    .section-content h2,
    h2[style*="2.5rem"],
    h2[style*="font-size: 2."] {
        font-size: clamp(1.5rem, 6vw, 2rem) !important;
        line-height: 1.3 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        padding: 0 15px !important;
    }

    /* Hero Buttons Container */
    div[style*="display: flex"][style*="justify-content: center"] a[style*="border-radius: 50px"] {
        padding: 12px 24px !important;
        font-size: 14px !important;
        white-space: nowrap !important;
    }

    /* Hero Section mit Background Image - Mobile Fix */
    .section[style*="height: 70vh"] {
        height: 60vh !important;
        min-height: 500px !important;
    }

    .section[style*="height: 70vh"] img[alt*="Modern Office"] {
        object-fit: cover !important;
        width: 100% !important;
        height: 100% !important;
        object-position: center !important;
    }

    /* Hero Content Overlay - besser lesbar auf Mobile */
    .section[style*="height: 70vh"] > div[style*="position: absolute"] {
        padding: 20px !important;
    }

    .section[style*="height: 70vh"] h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    .section[style*="height: 70vh"] p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
    }

    /* Sections & Containers */
    .section-2025 {
        padding: clamp(30px, 5vw, 60px) 0 !important;
    }

    .section-content {
        padding: 0 15px !important;
    }

    /* Cards */
    .card-2025 {
        padding: 24px 16px !important;
        margin-bottom: 20px !important;
    }

    /* Buttons */
    .btn-2025,
    .cta-button,
    button[class*="btn"] {
        width: 100% !important;
        max-width: 100% !important;
        padding: 14px 24px !important;
        font-size: 14px !important;
        min-height: 48px !important;
    }

    /* Grid Layouts */
    .grid-2025,
    div[style*="grid-template-columns: repeat(3, 1fr)"],
    div[style*="grid-template-columns: repeat(2, 1fr)"],
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Two-Column Video Section - Stack auf Mobile */
    div[style*="grid-template-columns: 1fr 1fr"][style*="gap: 60px"] {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        padding: 20px !important;
    }

    /* Video auf Mobile - volle Breite */
    video,
    video[id*="hero-video"] {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        border-radius: 8px !important;
    }

    /* Service Cards */
    .service-card-3d {
        padding: 30px 20px !important;
    }

    /* Icons */
    .icon-3d {
        width: 80px !important;
        height: 80px !important;
        margin-bottom: 20px !important;
    }

    .icon-3d img {
        width: 64px !important;
        height: 64px !important;
    }

    /* Footer */
    .footer-2025 {
        padding: 40px 15px 15px !important;
    }

    .footer-content {
        gap: 30px !important;
    }

    .footer-column h4 {
        font-size: 17px !important;
        margin-bottom: 10px !important;
    }

    .footer-column p,
    .footer-column a {
        font-size: 14px !important;
    }

    /* Navigation Touch Targets */
    .nav-link {
        padding: 16px 12px !important;
        min-height: 48px !important;
        font-size: 14px !important;
    }

    /* Forms */
    .form-2025 {
        padding: 24px 16px !important;
    }

    .form-input,
    .form-textarea,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea {
        padding: 14px !important;
        font-size: 15px !important;
        min-height: 48px !important;
    }

    /* Hero Video/Image Height */
    div[style*="height: 70vh"] {
        height: 50vh !important;
        min-height: 400px !important;
    }

    /* Scroll Buttons */
    #scroll_to_content,
    .scroll-btn {
        width: 48px !important;
        height: 48px !important;
        right: 16px !important;
        bottom: 72px !important;
    }

    /* Overflow Protection */
    * {
        max-width: 100%;
    }

    .grid-2025,
    .items_group,
    div[style*="grid-template-columns"] {
        overflow-x: hidden;
    }
}

/* ========== 375px BREAKPOINT (iPhone 12 Mini, sehr kleine Geräte) ========== */
@media (max-width: 375px) {

    /* Typography - Extra klein */
    h1 {
        font-size: 1.875rem !important; /* 30px */
        line-height: 1.15 !important;
    }

    h2 {
        font-size: 1.5rem !important; /* 24px */
        line-height: 1.25 !important;
    }

    h3 {
        font-size: 1.125rem !important; /* 18px */
    }

    h4 {
        font-size: 1rem !important; /* 16px */
    }

    p {
        font-size: 0.875rem !important; /* 14px */
        line-height: 1.65 !important;
    }

    /* Sections */
    .section-content {
        padding: 0 12px !important;
    }

    .section-2025 {
        padding: 25px 0 !important;
    }

    /* Cards */
    .card-2025 {
        padding: 20px 15px !important;
        margin-bottom: 16px !important;
    }

    /* Buttons */
    .btn-2025,
    .cta-button {
        padding: 12px 20px !important;
        font-size: 13px !important;
        min-height: 44px !important;
    }

    /* Footer */
    .footer-2025 {
        padding: 30px 12px 12px !important;
    }

    .footer-column h4 {
        font-size: 16px !important;
    }

    .footer-column p,
    .footer-column a {
        font-size: 13px !important;
    }

    .footer-bottom p {
        font-size: 12px !important;
    }

    /* Service Cards */
    .service-card-3d {
        padding: 25px 15px !important;
    }

    /* Icons */
    .icon-3d {
        width: 70px !important;
        height: 70px !important;
    }

    .icon-3d img {
        width: 56px !important;
        height: 56px !important;
    }

    /* Grid Gap */
    .grid-2025,
    div[style*="grid-template-columns"] {
        gap: 16px !important;
    }

    /* Hero */
    div[style*="height: 70vh"],
    div[style*="height: 60vh"] {
        height: 45vh !important;
        min-height: 350px !important;
    }

    .hero h1 {
        font-size: 1.75rem !important;
        margin-bottom: 12px !important;
    }

    .hero p {
        font-size: 0.9375rem !important;
        margin-bottom: 20px !important;
    }

    /* Forms */
    .form-input,
    .form-textarea {
        font-size: 14px !important;
    }

    /* Navigation */
    .nav-link {
        font-size: 13px !important;
        padding: 14px 10px !important;
    }
}

/* ========== TABLET LANDSCAPE (769px - 1024px) ========== */
@media (min-width: 769px) and (max-width: 1024px) {

    /* Service Cards - 2 Spalten statt 3 */
    div[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 25px !important;
    }

    /* Hero Font Size */
    .hero h1 {
        font-size: 3rem !important;
    }
}

/* ========== LANDSCAPE ORIENTATION FIX ========== */
@media (max-height: 500px) and (orientation: landscape) {

    /* Hero reduzieren im Landscape */
    div[style*="height: 70vh"],
    div[style*="height: 60vh"],
    div[style*="height: 50vh"] {
        height: 85vh !important;
        min-height: unset !important;
    }

    /* Navigation kompakter */
    .header-2025 {
        height: 56px !important;
    }

    .nav-link {
        padding: 10px 12px !important;
    }
}

/* ========== ACCESSIBILITY - TOUCH TARGETS ========== */
@media (max-width: 768px) {

    /* Minimum Touch Target 48x48px (WCAG AAA) */
    a,
    button,
    input[type="submit"],
    input[type="button"],
    .nav-link,
    .btn,
    .cta-button {
        min-height: 48px !important;
        min-width: 48px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Links mit mehr Abstand */
    a {
        padding: 8px 4px !important;
    }

    /* Footer Links */
    .footer-column a {
        padding: 10px 4px !important;
        display: inline-block;
    }
}

/* ========== IMAGE OPTIMIZATION ========== */
@media (max-width: 768px) {

    /* Alle Bilder responsive */
    img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Hero Bilder */
    .hero img,
    div[style*="position: absolute"] img {
        object-fit: cover !important;
        width: 100% !important;
        height: 100% !important;
    }
}

/* ========== ANIMATION PERFORMANCE ========== */
@media (max-width: 768px) {

    /* Reduziere Animationen auf Mobile für Performance */
    .icon-3d,
    .service-card-3d,
    .card-2025 {
        transition: transform 0.2s ease !important;
    }

    /* Keine 3D Transforms auf schwachen Geräten */
    .icon-3d:hover,
    .service-card-3d:hover {
        transform: scale(1.02) !important;
    }
}

/* ========== COOKIE BANNER MOBILE ========== */
/* Cookie Banner styles are now managed by css/cookie-banner.css */

/* ========== NAVIGATION OVERLAY (wenn aktiviert) ========== */
@media (max-width: 768px) {
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .nav-overlay.active {
        display: block;
    }
}

/* ========== ZUSÄTZLICHER H1 FIX - HÖCHSTE PRIORITÄT ========== */
@media (max-width: 768px) {
    /* Extrem spezifischer Selektor für alle H1 mit inline styles */
    body h1[style],
    main h1[style],
    .section-2025 h1[style],
    div.section-2025 div.section-content div h1[style],
    h1[style*="3.5rem"],
    h1[style*="font-size: 3.5rem"],
    div[style*="text-align: center"] h1[style*="3.5rem"],
    .section-2025 div[style*="max-width: 800px"] h1[style*="font-size"] {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
        padding: 0 10px !important;
        word-break: break-word !important;
        white-space: normal !important;
        max-width: 100% !important;
    }

    /* Für größere Mobile Screens */
    @media (min-width: 480px) and (max-width: 768px) {
        body h1[style],
        main h1[style],
        .section-2025 h1[style],
        h1[style*="3.5rem"],
        h1[style*="font-size: 3.5rem"] {
            font-size: 2rem !important;
        }
    }
}

/* ========== NUCLEAR OPTION - ALLE H1 ELEMENTE MIT 3.5REM ========== */
@media screen and (max-width: 768px) {
    h1[style*="3.5"] {
        font-size: 1.75rem !important;
    }
}

@media screen and (max-width: 480px) {
    h1[style*="3.5"] {
        font-size: 1.5rem !important;
    }
}

@media screen and (max-width: 375px) {
    h1[style*="3.5"] {
        font-size: 1.375rem !important;
    }
}

/* ========== MOBILE BRUTE-FORCE SPACER - VERHINDERT HEADER ÜBERLAPPUNG ========== */
/* Standard: Spacer ist unsichtbar auf Desktop */
.mobile-brute-force-spacer {
    display: none;
    width: 100%;
}

/* Mobile: Spacer wird sichtbar und schafft Platz unter dem Header */
@media (max-width: 768px) {
    .mobile-brute-force-spacer {
        display: block !important;
        height: 140px !important;
        background: transparent;
        clear: both;
    }

    /* Hero Section Padding anpassen */
    #hero-start,
    .section-2025[style*="padding: 150px"] {
        padding-top: 50px !important;
    }
}
