/* ===== BROWSER-UI UNTERDRÜCKUNG ===== */
/* Diese Styles funktionieren sofort im Browser-Modus */

/* Verhindert Browser-UI-Elemente */
html.browser-fullscreen {
    overflow: hidden !important;
    height: 100% !important;
    position: relative !important;
    width: 100% !important;
}

body.browser-fullscreen {
    /* Flexbox-Layout */
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--milka-blue);
}

/* Verhindert Scrollen außerhalb der App */
* {
    -webkit-overflow-scrolling: touch;
}

/* Verhindert Text-Selektion */
.browser-fullscreen * {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
    /* margin-top:-30px; */
}

/* Ausnahme: Wishlist-Cards erlauben Text-Selektion */
.browser-fullscreen .wishlist-card,
.browser-fullscreen .wishlist-card * {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

/* Verhindert Zoom */
input, textarea, select {
    font-size: 16px !important;
}

/* Mobile Browser-spezifische Optimierungen */
@media screen and (max-width: 768px) {
    /* Verhindert Adressleiste-Animation */
    html.browser-fullscreen, body.browser-fullscreen {
        position: relative !important;
        overflow: hidden !important;
        height: 100vh !important;
        height: 100dvh !important;
    }
    
    /* Pull-to-Refresh deaktivieren - verwende nur JavaScript-Implementierung */
    body.browser-fullscreen {
        overscroll-behavior: none !important;
        -webkit-overflow-scrolling: touch !important;
        /* Native Pull-to-Refresh deaktivieren */
        overscroll-behavior-y: none !important;
    }
    
    /* Pull-to-Refresh für den Hauptinhalt deaktivieren */
    main.container.browser-fullscreen {
        overscroll-behavior-y: none !important;
        -webkit-overflow-scrolling: touch !important;
        flex: 1 !important;
        overflow-y: auto !important;
    }
    
    /* Footer Flexbox-Layout */
    footer.browser-fullscreen {
        flex-shrink: 0 !important;
    }
}

/* iOS Safari-spezifische Optimierungen */
@supports (-webkit-touch-callout: none) {
    html.browser-fullscreen, body.browser-fullscreen {
        -webkit-text-size-adjust: 100% !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }
    
    /* iPhone Footer Flexbox */
    footer.browser-fullscreen {
        flex-shrink: 0 !important;
        /* Safe Area nur als Padding */
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    }
    
    /* Verhindert Body-Padding auf iPhone */
    body.browser-fullscreen {
        padding-bottom: 0 !important;
    }
    
    /* Main Content Flexbox auf iPhone */
    main.container.browser-fullscreen {
        flex: 1 !important;
        overflow-y: auto !important;
    }
}

/* Android Chrome-spezifische Optimierungen */
@media screen and (max-width: 768px) {
    html.browser-fullscreen, body.browser-fullscreen {
        /* Verhindert Android Chrome Adressleiste-Animation */
        position: fixed !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
    }
    
    .header-content.browser-fullscreen {
        position: relative;
        top: 20px;
    }
}
