/**
 * OYROPA CRITICAL FIXES - P1 BLOCKER
 * Date: 02.10.2025
 * Purpose: Fix all critical issues from Final Check Report
 */

/* ============================================================================
   1. WCAG AA COMPLIANCE - ALL BUTTONS MIN 44x44px
   ============================================================================ */

/* Primary Buttons */
button,
.btn,
.cta-button,
a.button,
input[type="submit"],
input[type="button"],
.nav-button,
.menu-button,
.mobile-toggle {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 12px 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* Navigation Links */
nav a,
.nav-link,
.nav-menu a,
header a {
    min-height: 44px !important;
    padding: 12px 16px !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Footer Links */
footer a {
    min-height: 44px !important;
    padding: 10px 8px !important;
    display: inline-block !important;
}

/* CTA Buttons (größer für Conversion) */
.hero-cta,
.primary-cta,
.checkout-button {
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 14px 24px !important;
}

/* Icon Buttons */
.icon-button,
.social-button,
.share-button {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 10px !important;
}

/* Mobile Menu Toggle */
.hamburger,
.menu-icon,
.mobile-menu-toggle {
    min-width: 48px !important;
    min-height: 48px !important;
}

/* ============================================================================
   2. HEADER BACKGROUND FIX - CORPORATE NAVY #1A365D
   ============================================================================ */

header,
.header,
.nav-header,
.main-header,
.site-header,
.page-header,
.mobile-nav {
    background: #1A365D !important;
    background-color: #1A365D !important;
}

/* Header Links - White on Navy */
header a,
.header a,
.nav-header a,
.mobile-nav a {
    color: #FFFFFF !important;
    text-shadow: none !important;
}

header a:hover,
.header a:hover,
.nav-header a:hover {
    color: #D69E2E !important;
    background: rgba(214, 158, 46, 0.1) !important;
}

/* Logo in Header */
.logo,
.site-logo,
.nav-logo {
    color: #FFFFFF !important;
}

/* ============================================================================
   3. MOBILE SCROLLING FIX - NO HORIZONTAL OVERFLOW
   ============================================================================ */

/* Body & Root Containers */
body,
html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    position: relative !important;
}

/* All Containers */
.container,
.content,
.main-content,
.page-content,
section,
article,
div[class*="container"] {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* Tables - Responsive */
table {
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    max-width: 100% !important;
}

@media (max-width: 768px) {
    table {
        font-size: 0.9em !important;
    }
}

/* Images */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* Prevent text overflow */
h1, h2, h3, h4, h5, h6, p, li {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Fix wide content */
pre,
code {
    overflow-x: auto !important;
    max-width: 100% !important;
}

/* ============================================================================
   4. NAVIGATION ENHANCEMENT
   ============================================================================ */

/* Ensure all navigation links are visible */
.nav-menu,
.navigation,
.main-nav {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
}

.nav-menu a,
.navigation a,
.main-nav a {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
}

/* Dropdown Menus */
.dropdown,
.nav-dropdown {
    position: relative !important;
}

.dropdown-content,
.dropdown-menu {
    display: none !important;
    position: absolute !important;
    background: #1A365D !important;
    min-width: 200px !important;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2) !important;
    z-index: 1000 !important;
}

.dropdown:hover .dropdown-content,
.dropdown:hover .dropdown-menu {
    display: block !important;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column !important;
        width: 100% !important;
    }

    .nav-menu.active {
        display: flex !important;
    }
}

/* ============================================================================
   5. UNIFIED HEADER/FOOTER STRUCTURE
   ============================================================================ */

/* Fixed Header */
header {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 999 !important;
    background: #1A365D !important;
    padding: 1rem 0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

/* Header Inner Container */
.header-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Footer Structure */
footer {
    background: #1A365D !important;
    color: #FFFFFF !important;
    padding: 3rem 1rem 1rem !important;
    margin-top: 4rem !important;
}

.footer-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 2rem !important;
}

footer h3 {
    color: #D69E2E !important;
    margin-bottom: 1rem !important;
    font-size: 1.1rem !important;
}

footer a {
    color: #FFFFFF !important;
    text-decoration: none !important;
}

footer a:hover {
    color: #D69E2E !important;
}

.footer-bottom {
    text-align: center !important;
    margin-top: 2rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid rgba(255,255,255,0.2) !important;
    font-size: 0.9rem !important;
}

/* ============================================================================
   6. Z-INDEX HIERARCHY - FIX OVERLAPS
   ============================================================================ */

/* Modal overlays */
.modal,
.overlay,
.popup {
    z-index: 1050 !important;
}

/* Header */
header,
.header,
.main-header {
    z-index: 1000 !important;
}

/* Dropdown Menus */
.dropdown-menu,
.dropdown-content {
    z-index: 1001 !important;
}

/* Mobile Menu */
.mobile-menu {
    z-index: 999 !important;
}

/* Sticky Elements */
.sticky,
.fixed {
    z-index: 100 !important;
}

/* Footer */
footer {
    z-index: 10 !important;
}

/* Content */
main,
.main-content,
section {
    z-index: 1 !important;
}

/* Cards */
.card,
.service-card,
.product-card {
    z-index: 2 !important;
    position: relative !important;
}

/* ============================================================================
   7. RESPONSIVE SPACING - PREVENT OVERLAPS
   ============================================================================ */

/* Card Spacing */
.card,
.service-card,
.product-card {
    margin: 1rem 0 !important;
    padding: 1.5rem !important;
}

@media (max-width: 768px) {
    .card,
    .service-card,
    .product-card {
        margin: 1.5rem 0 !important;
        padding: 1rem !important;
    }
}

/* Section Spacing */
section {
    margin: 2rem 0 !important;
    padding: 1rem !important;
}

/* Grid Layouts */
.grid,
.card-grid {
    display: grid !important;
    gap: 2rem !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
}

@media (max-width: 768px) {
    .grid,
    .card-grid {
        gap: 1.5rem !important;
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================================
   8. MOBILE-SPECIFIC FIXES
   ============================================================================ */

@media (max-width: 768px) {
    /* Larger touch targets on mobile */
    button,
    a,
    input[type="submit"],
    input[type="button"] {
        min-height: 48px !important;
        font-size: 16px !important; /* Prevent iOS zoom */
    }

    /* Better padding */
    body {
        padding: 0 !important;
    }

    .container {
        padding: 0 1rem !important;
    }

    /* Readable font sizes */
    body {
        font-size: 16px !important;
    }

    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    /* Mobile menu */
    .mobile-menu {
        position: fixed !important;
        top: 70px !important;
        left: 0 !important;
        right: 0 !important;
        background: #1A365D !important;
        max-height: calc(100vh - 70px) !important;
        overflow-y: auto !important;
    }

    /* Safe areas for notch devices */
    body {
        padding-top: env(safe-area-inset-top) !important;
        padding-bottom: env(safe-area-inset-bottom) !important;
    }
}

/* ============================================================================
   9. ACCESSIBILITY ENHANCEMENTS
   ============================================================================ */

/* Focus States */
button:focus,
a:focus,
input:focus {
    outline: 3px solid #D69E2E !important;
    outline-offset: 2px !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    button,
    a {
        border: 2px solid currentColor !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================================
   10. PERFORMANCE OPTIMIZATIONS
   ============================================================================ */

/* GPU Acceleration */
.card,
.button,
.nav-menu {
    transform: translateZ(0) !important;
    will-change: auto !important;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth !important;
}

/* ============================================================================
   END OF CRITICAL FIXES
   ============================================================================ */
