/**
 * FOOTER FIX ULTIMATE V3 - AGGRESSIVE OVERRIDE
 * 22. Oktober 2025 - 16:35 UTC
 *
 * Problem: Footer zeigt 4 Spalten trotz CSS-Fixes
 * Root Cause: Inline styles im HTML überschreiben CSS
 * Lösung: EXTREM aggressive !important auf ALLE Selektoren
 *
 * GARANTIERT 2 SPALTEN AUF DESKTOP (769px+)
 */

/* ============================================
   FOOTER - AGGRESSIVE OVERRIDE
   ============================================ */

/* Footer Container */
footer,
footer > *,
footer > div,
footer > div:first-child,
footer div[style*="grid"],
footer div[style*="column"] {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 40px 20px !important;
}

/* Footer Grid - FORCE single column on mobile */
@media (max-width: 768px) {
    footer,
    footer *,
    footer > div:first-child,
    footer > div:first-child > div,
    footer > div:first-child > div:first-child,
    footer div[style*="grid-template-columns"],
    footer div[style*="grid"],
    footer [class*="grid"],
    footer [style*="display"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 32px !important;
        grid-template-columns: none !important;
    }

    footer > div:first-child > div:first-child > div {
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-right: none !important;
    }

    footer > div:first-child > div:first-child > div:last-child {
        border-bottom: none !important;
    }
}

/* Desktop - 2 columns ALWAYS - AGGRESSIVE OVERRIDE */
@media (min-width: 769px) {
    /* ALLE möglichen Footer-Grid-Selektoren */
    footer,
    footer > div:first-child,
    footer > div:first-child > div,
    footer > div:first-child > div:first-child,
    footer div[style*="grid-template-columns"],
    footer div[style*="grid"],
    footer div[class*="grid"],
    footer [style*="grid-template-columns"] {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 40px 32px !important;
    }

    /* Verhindere 3-Spalten */
    footer div[style*="repeat(3"],
    footer div[style*="1fr 1fr 1fr"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Verhindere 4-Spalten */
    footer div[style*="repeat(4"],
    footer div[style*="1fr 1fr 1fr 1fr"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Footer Columns */
    footer > div:first-child > div:first-child > div {
        border-bottom: none !important;
        border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding: 0 20px !important;
    }

    /* Jede 2. Spalte ohne Border rechts */
    footer > div:first-child > div:first-child > div:nth-child(2n) {
        border-right: none !important;
    }

    /* KEINE 3. oder 4. Spalte Border */
    footer > div:first-child > div:first-child > div:nth-child(3),
    footer > div:first-child > div:first-child > div:nth-child(4) {
        border-right: none !important;
    }
}

/* Footer Headings */
footer h3,
footer h4 {
    color: #D69E2E !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    margin-bottom: 16px !important;
    line-height: 1.3 !important;
}

/* Footer Paragraphs */
footer p {
    font-size: 15px !important;
    line-height: 1.8 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 12px !important;
}

/* Footer Links */
footer a {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    display: inline-block !important;
    padding: 2px 0 !important;
    transition: color 0.2s ease !important;
}

footer a:hover {
    color: #D69E2E !important;
    text-decoration: underline !important;
}

/* Footer Strong text */
footer strong {
    color: white !important;
    font-weight: 600 !important;
}

/* ============================================
   COPYRIGHT SECTION
   ============================================ */

footer > div:last-child,
footer > p:last-child {
    text-align: center !important;
    padding: 24px 0 16px 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    margin-top: 32px !important;
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ============================================
   MOBILE SPECIFIC FIXES
   ============================================ */

@media (max-width: 768px) {
    footer {
        padding: 40px 16px 24px 16px !important;
    }

    footer > div:first-child {
        padding: 20px 0 !important;
    }

    footer > div:first-child > div:first-child > div {
        padding: 20px 0 !important;
        margin-bottom: 8px !important;
    }

    footer p {
        font-size: 14px !important;
    }

    footer h3,
    footer h4 {
        font-size: 16px !important;
    }

    /* Prevent ANY horizontal overflow */
    footer,
    footer * {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        word-wrap: break-word !important;
    }
}

/* ============================================
   EXTRA SMALL MOBILE
   ============================================ */

@media (max-width: 375px) {
    footer {
        padding: 32px 12px 20px 12px !important;
    }

    footer p {
        font-size: 13px !important;
        line-height: 1.7 !important;
    }

    footer h3,
    footer h4 {
        font-size: 15px !important;
    }

    footer a {
        font-size: 13px !important;
    }
}

/* ============================================
   NUCLEAR OPTION - ÜBERSCHREIBT ALLES
   ============================================ */

/* Wenn NICHTS anderes funktioniert - setze auf body level */
body footer div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, 1fr) !important;
}

@media (min-width: 769px) {
    body footer div {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
