/* =====================================================================
   mobile.css — shared mobile optimizations for all digifai pages
   Loaded after each page's inline <style> so it overrides where needed.
   ===================================================================== */

/* Prevent horizontal scroll caused by oversized backgrounds/SVGs */
html, body { max-width: 100%; overflow-x: hidden; }

/* === HEADER + MOBILE NAVIGATION =================================== */

/* Hide desktop nav + lang toggle below 900px (where things start to wrap).
   The hamburger button injected by mobile-nav.js takes over. */
@media (max-width: 900px) {
    .site-header { padding: 0 20px; height: 64px; }
    .header-left { gap: 0; flex: 1; min-width: 0; }
    .nav-links { display: none !important; }
    .lang-toggle { display: none; }
    .header-right { gap: 8px; }
    .btn-demo { padding: 9px 16px; font-size: 0.8125rem; min-height: 40px; }
    .logo { height: 28px; }
}
@media (max-width: 480px) {
    .site-header { padding: 0 16px; }
    .btn-demo { padding: 8px 14px; font-size: 0.75rem; }
}

/* Hamburger button (injected by mobile-nav.js) */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin-left: 4px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1100;
    -webkit-tap-highlight-color: transparent;
}
.mobile-menu-btn:focus { outline: none; }
.mobile-menu-btn span,
.mobile-menu-btn span::before,
.mobile-menu-btn span::after {
    display: block;
    width: 24px;
    height: 2px;
    background: #1a1a2e;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease,
                top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-menu-btn span { position: relative; }
.mobile-menu-btn span::before,
.mobile-menu-btn span::after {
    content: '';
    position: absolute;
    left: 0;
}
.mobile-menu-btn span::before { top: -8px; }
.mobile-menu-btn span::after  { top: 8px; }
.mobile-menu-btn.open span { background: transparent; }
.mobile-menu-btn.open span::before { top: 0; transform: rotate(45deg); }
.mobile-menu-btn.open span::after  { top: 0; transform: rotate(-45deg); }

@media (max-width: 900px) {
    .mobile-menu-btn { display: inline-flex; }
}

/* Backdrop behind the slide-out panel */
.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.55);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.mobile-nav-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* Slide-out panel */
.mobile-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 340px;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 88px 24px 32px;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
}
.mobile-nav-panel.open { transform: translateX(0); }

.mobile-nav-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.mobile-nav-panel li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.mobile-nav-panel li.group-label {
    border-bottom: none;
    padding: 24px 0 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8a8a8a;
}
.mobile-nav-panel li.group-label:first-child { padding-top: 0; }
.mobile-nav-panel a {
    display: block;
    padding: 14px 0;
    font-size: 1rem;
    font-weight: 500;
    color: #2d2d2d;
    text-decoration: none;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: rgba(245, 79, 33, 0.1);
}
.mobile-nav-panel a:hover,
.mobile-nav-panel a:active { color: #f54f21; }
.mobile-nav-panel a.active {
    color: #f54f21;
    font-weight: 700;
}
.mobile-nav-panel li.sub a {
    padding-left: 16px;
    font-size: 0.9375rem;
    color: #5a5a5a;
}

.mobile-nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding: 16px 24px;
    background: #f54f21;
    color: #fff !important;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(245, 79, 33, 0.25);
}
.mobile-nav-cta:hover,
.mobile-nav-cta:active { background: #d9411a; color: #fff !important; }

/* Lock body scroll when panel is open */
body.mobile-nav-open { overflow: hidden; touch-action: none; }

/* === HERO ========================================================== */
@media (max-width: 900px) {
    .hero { padding: 64px 0 80px !important; }
    .hero .container {
        grid-template-columns: 1fr !important;
        gap: 48px !important;
        text-align: center;
    }
    .hero-content { text-align: center; }
    .hero h1 { font-size: 2.25rem !important; line-height: 1.18 !important; }
    .hero-subtitle {
        font-size: 1.0625rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 560px !important;
    }
    .hero-actions { justify-content: center !important; }
    .hero-image { max-width: 540px; margin: 0 auto; }
}
@media (max-width: 640px) {
    .hero { padding: 48px 0 64px !important; }
    .hero h1 { font-size: 1.75rem !important; letter-spacing: -0.02em; }
    .hero-subtitle { font-size: 1rem !important; line-height: 1.6 !important; margin-bottom: 32px !important; }
    .hero-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        max-width: 320px;
        margin: 0 auto;
    }
    .hero-actions .btn-primary,
    .hero-actions .btn-secondary {
        width: 100% !important;
        justify-content: center !important;
        padding: 14px 24px !important;
        font-size: 1rem !important;
        min-height: 48px;
    }
    .hero-image .overlay-badge {
        left: 12px !important;
        bottom: 12px !important;
        right: auto !important;
        top: auto !important;
        padding: 10px 14px !important;
        gap: 10px !important;
    }
    .overlay-badge .badge-icon { width: 36px !important; height: 36px !important; }
    .overlay-badge .badge-icon svg { width: 18px !important; height: 18px !important; }
    .overlay-badge .badge-value { font-size: 0.95rem !important; }
    .overlay-badge .badge-text { font-size: 0.7rem !important; }
    .hero-badge { font-size: 0.75rem !important; padding: 5px 14px !important; }
}

/* === SECTIONS GENERAL ============================================== */
@media (max-width: 640px) {
    section { padding: 56px 0 !important; }
    .section-title { font-size: 1.625rem !important; line-height: 1.25 !important; }
    .section-subtitle { font-size: 0.9375rem !important; }
    .section-header { margin-bottom: 36px !important; }
    .container { padding: 0 20px; }
}
@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .section-title { font-size: 1.5rem !important; }
}

/* === GRIDS — collapse to 1-column on small phones =================== */
@media (max-width: 900px) {
    .area-grid,
    .area-grid-3,
    .news-grid,
    .course-grid,
    .webinar-grid,
    .download-grid,
    .value-grid,
    .pain-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }
}
@media (max-width: 640px) {
    .area-grid,
    .area-grid-3,
    .news-grid,
    .course-grid,
    .webinar-grid,
    .download-grid,
    .value-grid,
    .pain-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }
    .team-gallery {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }
    .team-gallery img { height: 160px !important; }
}

/* === FEATURE ROW ==================================================== */
@media (max-width: 900px) {
    .feature-row { grid-template-columns: 1fr !important; gap: 36px !important; }
    .feature-row.reverse { direction: ltr; }
    .feature-content h2 { font-size: 1.625rem !important; }
}
@media (max-width: 640px) {
    .feature-content h2 { font-size: 1.375rem !important; }
    .feature-content > p { font-size: 0.9375rem !important; }
    .feature-visual .float-card { display: none !important; }
    .feature-visual img { border-radius: 12px; }
    .feature-list li { gap: 12px !important; }
    .feature-list li div { font-size: 0.9rem !important; }
}

/* === PAIN CARDS ===================================================== */
@media (max-width: 640px) {
    .pain-card { padding: 24px !important; }
    .pain-card h3 { font-size: 1.0625rem !important; }
    .pain-card p { font-size: 0.9rem !important; }
    .pain-icon { width: 48px !important; height: 48px !important; margin-bottom: 16px !important; }
    .pain-icon svg { width: 24px !important; height: 24px !important; }
}

/* === STATS BAR ====================================================== */
@media (max-width: 640px) {
    .stats-bar { padding: 48px 0 !important; }
    .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 32px 20px !important; }
    .stat-value { font-size: 2rem !important; }
    .stat-label { font-size: 0.8125rem !important; }
}

/* === TESTIMONIAL ==================================================== */
@media (max-width: 640px) {
    .testimonial-quote { font-size: 1rem !important; line-height: 1.65 !important; padding: 0 8px; }
    .testimonial-quote::before { font-size: 3rem !important; top: -12px !important; left: 0 !important; }
}

/* === COMPARISON TABLE — horizontally scroll on mobile ============== */
@media (max-width: 768px) {
    .comparison-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .comparison-table thead th,
    .comparison-table tbody td {
        padding: 12px 14px !important;
        font-size: 0.8125rem !important;
    }
}

/* === BOOKING / CALENDLY ============================================== */
@media (max-width: 1024px) {
    .booking-wrapper { grid-template-columns: 1fr !important; gap: 32px !important; }
}
@media (max-width: 640px) {
    .booking-section { padding: 64px 0 !important; }
    .booking-info h2 { font-size: 1.5rem !important; }
    .booking-info > p { font-size: 0.9375rem !important; }
    .calendly-embed .calendly-inline-widget { height: 950px !important; }
    .booking-benefits li { font-size: 0.9rem !important; }
}

/* === CTA ============================================================ */
@media (max-width: 640px) {
    .cta-section { padding: 64px 0 !important; }
    .cta-section h2 { font-size: 1.625rem !important; }
    .cta-section p { font-size: 0.9375rem !important; }
    .cta-buttons {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        max-width: 320px;
        margin: 0 auto !important;
    }
    .cta-buttons .btn-primary,
    .cta-buttons .btn-secondary {
        width: 100% !important;
        justify-content: center !important;
        min-height: 48px;
    }
}

/* === TRUST BAR ====================================================== */
@media (max-width: 640px) {
    .trust-bar { padding: 36px 0 !important; }
    .trust-logos { gap: 24px 28px !important; }
    .trust-logos img { height: 22px !important; }
    .trust-bar p { font-size: 0.7rem !important; }
}

/* === FOOTER ========================================================= */
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 32px !important; }
}
@media (max-width: 640px) {
    .site-footer { padding: 48px 0 24px !important; }
    .footer-grid { grid-template-columns: 1fr !important; gap: 32px !important; margin-bottom: 32px !important; }
    .footer-bottom { flex-direction: column !important; gap: 14px !important; text-align: center; align-items: center; }
    .footer-legal { justify-content: center; gap: 20px !important; }
    .footer-brand { text-align: center; }
    .footer-brand .logo-footer { margin-left: auto; margin-right: auto; }
    .footer-social { justify-content: center; }
    .footer-col h4 { font-size: 0.8125rem; }
}

/* === DOWNLOAD CARDS ================================================= */
@media (max-width: 640px) {
    .download-card {
        flex-direction: column !important;
        text-align: center;
        padding: 28px 24px !important;
    }
}

/* === FAQ accordion =================================================== */
@media (max-width: 640px) {
    .faq-question { font-size: 0.9375rem !important; padding: 16px !important; }
    .faq-answer-inner { padding: 0 16px 16px !important; font-size: 0.875rem !important; }
}

/* === Form ============================================================ */
@media (max-width: 640px) {
    .contact-form input,
    .contact-form textarea,
    .contact-form select {
        font-size: 16px !important; /* prevents iOS zoom on focus */
    }
}

/* === Tap targets — minimum 44px on mobile ============================ */
@media (max-width: 900px) {
    .btn-primary,
    .btn-secondary,
    .btn-demo,
    .area-card .card-link,
    .news-card a,
    .nav-links a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* === Image quality / safety ========================================== */
img { max-width: 100%; height: auto; }

/* === Filter bar (Neuigkeiten) ======================================== */
@media (max-width: 640px) {
    .filter-bar { gap: 6px !important; }
    .filter-btn { padding: 8px 14px !important; font-size: 0.75rem !important; }
}
