/* =====================================================
   ENHANCEVISION - COMPLETE MOBILE OPTIMIZATION
   Comprehensive Mobile-First Responsive Design
   Updated: 24.02.2026
   ===================================================== */

/* =====================================================
   GLOBAL MOBILE FIXES
   ===================================================== */
@media (max-width: 768px) {
    /* Prevent horizontal overflow */
    html {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        position: relative;
    }
    
    body.menu-open {
        overflow: hidden !important;
    }
    
    * {
        max-width: 100%;
    }
    
    /* Containers */
    .container,
    .hero-container,
    .section-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
    }
    
    /* Responsive images */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* =====================================================
   NAVIGATION - HAMBURGER MENU (TABLET + MOBILE)
   ===================================================== */

/* Hamburger-Button: ab 768px sichtbar */
.nav-toggle {
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1002;
}

.nav-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex !important;
    }
    
    /* Nav-Liste auf Mobile: klappt unter der Navbar auf */
    .nav-list {
        display: none !important;
        position: static !important;
        transform: none !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: none !important;
        background: #0f172a !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
        list-style: none !important;
        border-top: 1px solid #334155;
    }
    
    .nav-list.mobile-open {
        display: flex !important;
    }
    
    .nav-list li {
        width: 100% !important;
        max-width: none !important;
        border-bottom: 1px solid #334155;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .nav-list li:last-child {
        border-bottom: none;
    }
    
    .nav-list .nav-link {
        display: block !important;
        padding: 1.1rem 1.5rem !important;
        font-size: 1.15rem !important;
        font-weight: 500;
        color: #cbd5e1 !important;
        text-align: left !important;
        text-decoration: none;
        width: 100% !important;
        max-width: none !important;
    }
    
    .nav-list .nav-link:hover,
    .nav-list .nav-link.active {
        color: #3b82f6 !important;
        background: rgba(59, 130, 246, 0.1) !important;
    }
    
    /* Navbar selbst: backdrop-filter entfernen (erzeugt Stacking-Context der fixed children kaputt macht) */
    .navbar {
        z-index: 10000 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: #0f172a !important;
    }
    
    /* Nav Container Layout auf Mobile */
    .nav-container {
        padding: 0 1rem;
        height: 60px;
    }
    
    .nav-logo {
        font-size: 1.1rem;
        flex-shrink: 0;
    }
    
    .nav-logo img {
        width: 28px !important;
        height: 28px !important;
    }
    
    .nav-actions {
        display: flex;
        gap: 0.5rem;
        margin-left: auto;
        align-items: center;
    }
    
    .cart-btn,
    .user-btn {
        width: 38px;
        height: 38px;
        padding: 0.4rem;
        font-size: 1rem;
    }
}

/* =====================================================
   MOBILE PHONE (max-width: 480px)
   ===================================================== */
@media (max-width: 480px) {
    
    /* ROOT OVERFLOW FIX */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        position: relative;
    }
    
    /* Typography Scale Down */
    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    h4 { font-size: 1.1rem !important; }
    
    body {
        font-size: 14px;
    }    

    /* =====================================================
       HERO SECTION MOBILE
       ===================================================== */
    .hero {
        padding: 80px 0 40px !important;
        margin-bottom: 2rem !important;
    }
    
    .hero-container {
        grid-template-columns: 1fr !important;
        gap: 2rem;
        padding: 0 1rem !important;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero-title {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .hero-subtitle {
        font-size: 0.95rem !important;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        gap: 0.75rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 100%;
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
        justify-content: center;
        white-space: normal;
        line-height: 1.4;
    }
    
    .hero-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        width: 100%;
    }
    
    .stat {
        padding: 0.75rem 0.5rem;
        text-align: center;
    }
    
    .stat-number {
        font-size: 1.4rem;
        display: block;
    }
    
    .stat-label {
        font-size: 0.75rem;
        display: block;
    }
    
    /* Hero Images Mobile */
    .hero-visual {
        width: 100%;
        padding: 0 1rem;
    }
    
    .preview-container {
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        width: 100%;
    }
    
    .before-after {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        width: 100%;
    }
    
    .image-box {
        width: 90%;
        max-width: 300px;
        height: 400px;
        margin: 0 auto;
        border-radius: 12px;
        overflow: hidden;
    }
    
    .comparison-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .arrow-transform {
        transform: rotate(90deg);
        margin: 0.5rem 0;
    }
    
    .arrow-transform span {
        display: none;
    }
    
    /* =====================================================
       BUTTONS, SECTIONS & GRIDS MOBILE
       ===================================================== */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        word-wrap: break-word;
        text-align: center;
        white-space: normal;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    section {
        padding: 3rem 0 !important;
        overflow: visible !important;
        height: auto !important;
    }
    
    .section-header {
        margin-bottom: 2rem;
        padding: 0 1rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .section-header p {
        font-size: 0.95rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .feature-card {
        padding: 1.25rem;
        text-align: left;
    }
    
    .feature-icon {
        width: 45px;
        height: 45px;
        margin: 0 0 1rem 0;
    }
    
    .feature-icon i {
        font-size: 1.1rem;
    }
    
    .feature-card h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .feature-card p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .product-card {
        padding: 1.5rem;
        width: 100%;
        max-width: 100%;
    }
    
    .product-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
        top: -8px;
        right: 10px;
    }
    
    .product-image i {
        font-size: 3rem;
    }
    
    .product-content h3 {
        font-size: 1.25rem;
    }
    
    .product-description {
        font-size: 0.9rem;
    }
    
    .product-features li {
        font-size: 0.85rem;
        gap: 0.5rem;
    }
    
    .product-price .price {
        font-size: 1.75rem;
    }
    
    .product-price .price-note {
        font-size: 0.8rem;
    }
    
    .add-to-cart {
        width: 100%;
        padding: 1rem;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem;
        padding: 0 1rem;
    }
    
    .testimonial-card {
        padding: 1.25rem;
    }
    
    .testimonial-card p {
        font-size: 0.9rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr !important;
        gap: 2rem;
        padding: 0 1rem;
    }
    
    .contact-info h2 {
        font-size: 1.5rem;
    }
    
    .contact-info p {
        font-size: 0.95rem;
    }
    
    .contact-methods {
        gap: 1rem;
    }
    
    .contact-method {
        padding: 1rem;
    }
    
    .contact-method i {
        font-size: 1.25rem;
        width: 35px;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.75rem;
        font-size: 0.95rem;
        width: 100%;
    }
    
    .form-group textarea {
        min-height: 120px;
    }
    
    .footer {
        padding: 2.5rem 0 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem;
        text-align: center;
        padding: 0 1rem;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-section h3 {
        text-align: center !important;
    }
    
    .footer-section ul {
        text-align: center !important;
    }
    
    .footer-logo {
        font-size: 1.25rem;
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.5rem 1rem 0;
    }
    
    .footer-bottom p {
        font-size: 0.85rem;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 5% auto;
        padding: 0;
    }
    
    .modal-header {
        padding: 1.25rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1.25rem;
        max-height: 60vh;
    }
    
    .modal-footer {
        padding: 1.25rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    
    table {
        font-size: 0.8rem;
        min-width: 100%;
    }
    
    table th,
    table td {
        padding: 0.6rem 0.4rem;
        white-space: nowrap;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .cart-item-info h4 {
        font-size: 1rem;
    }
    
    .cart-item-info p {
        font-size: 0.85rem;
    }
    
    .cart-item-price {
        font-size: 1.1rem;
    }
    
    .cart-total {
        font-size: 1.1rem;
        padding: 1rem;
    }
}

/* =====================================================
   EXTRA SMALL MOBILE (max-width: 360px)
   ===================================================== */
@media (max-width: 360px) {
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.3rem !important; }
    h3 { font-size: 1.15rem !important; }
    
    body {
        font-size: 13px;
    }
    
    .container,
    .hero-container,
    .section-container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.85rem !important;
    }
    
    .hero-buttons .btn {
        padding: 0.75rem 0.875rem;
        font-size: 0.85rem;
    }
    
    .nav-logo {
        font-size: 1rem;
    }
    
    .cart-btn,
    .user-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }
    
    .section-header h2 {
        font-size: 1.3rem;
    }
    
    .product-card,
    .feature-card,
    .testimonial-card {
        padding: 1rem;
    }
}

/* =====================================================
   TOUCH & PERFORMANCE OPTIMIZATIONS
   ===================================================== */
@media (max-width: 768px) {
    button,
    .btn,
    a.btn,
    input[type="button"],
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    * {
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
    }
    
    html {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}
