/* Mobile Optimizations */
/* Standardmäßig Bottom Nav ausblenden (Desktop) */
#mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
    /* Body Padding für Bottom Nav */
    body { 
        padding-bottom: 0;
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    /* --- Header & Navigation --- */
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 0;
    }

    .logo {
        margin-bottom: 0;
        font-size: 1.4rem;
        z-index: 102;
        position: relative;
    }

    .header-controls {
        gap: 15px;
    }

    .logo img {
        width: 120px;
        height: auto;
    }

    /* Hide Desktop Nav Elements */
    .hamburger, 
    #main-nav, 
    .header-controls .user-icon, 
    .header-controls .cart-icon {
        display: none !important;
    }

    /* --- Shop Controls (Search, Filter, Sort) --- */
    .shop-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .category-filters {
        flex-wrap: wrap;
        overflow-y: hidden;
        overflow-x: visible;
        max-height: 45px; /* Zeigt nur die erste Zeile */
        transition: max-height 0.3s ease-in-out;
        padding-bottom: 0;
        mask-image: none;
        -webkit-mask-image: none;
    }

    .category-filters.expanded {
        max-height: 500px; /* Genug Platz für alle Kategorien */
    }

    .filter-toggle {
        display: flex; /* Mobile: sichtbar */
    }

    .category-btn {
        flex-shrink: 0;
    }

    main {
        margin: 1rem 0 0 0; /* Reset Desktop Margins */
        padding: 0 15px; /* Sicherer Abstand */
        width: 100%;
        flex: 0 0 auto; /* Footer direkt unter Inhalt, kein Sticky-Effect */
    }

    /* --- Rest of previous mobile.css --- */
    .hero-banner {
        padding: 3rem 1.5rem;
        margin-bottom: 2rem;
        border-radius: 24px;
    }

    .hero-banner h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    /* Vertical Grid for ALL Product Lists on Mobile (Shop, Featured, Suggestions) */
    .product-grid {
        display: grid;
        grid-template-columns: 1fr 1fr !important; /* Erzwinge 2 Spalten */
        gap: 10px;
        overflow: visible;
        padding-bottom: 0;
        width: 100%;
        box-sizing: border-box;
        padding-right: 0; /* Verhindert Overflow durch Padding */
    }
    
    /* Container Fixes */
    .section, .content-wrapper, main {
        max-width: 100%;
        overflow-x: hidden;
    }

    .product-card {
        min-width: 0; /* Fix für Grid Overflow */
        max-width: none;
    }

    .scroll-btn {
        display: none;
    }

    .cart-item {
        width: 100%;
        box-sizing: border-box;
    }

    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .cart-item > div:first-child {
        width: 100%;
        border-bottom: 1px dashed #eee;
        padding-bottom: 0.5rem;
    }

    .cart-controls {
        width: 100%;
        justify-content: space-between;
    }

    /* Cart Suggestions Fix */
    .cart-suggestions {
        width: 100%;
    }

    #checkout {
        padding: 0;
        place-items: end center;
    }
    
    .checkout-wizard {
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        min-height: 0;
        width: 100%;
    }

    .wizard-header, .wizard-content, .wizard-footer {
        padding: 1.5rem;
    }

    .wizard-header > button {
        top: 1.5rem !important;
        right: 1.5rem !important;
    }

    .wizard-header h2 {
        font-size: 1.6rem;
        padding-right: 2rem;
    }

    /* Prevent Zoom on iOS inputs */
    input, select, textarea {
        font-size: 16px !important;
    }

    #checkout-form-step1 > div, 
    .payment-options {
        grid-template-columns: 1fr !important;
    }

    .payment-card {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1.5rem;
        text-align: left;
    }

    .payment-icon {
        margin-bottom: 0;
        font-size: 2rem;
    }

    #toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 90px; /* Über der Bottom Nav */
        width: auto;
    }

    .toast {
        min-width: 0;
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }

    /* Product Detail Mobile */
    .product-detail-wrapper {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    .detail-content h1 {
        font-size: 2rem;
    }

    /* --- Account Dashboard Mobile --- */
    .account-container {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
        overflow: hidden; /* Verhindert seitliches Ausbrechen */
    }

    .account-sidebar {
        padding: 1rem;
        border-radius: 16px;
        width: 100%;
    }

    .profile-summary {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .logout-icon-btn {
        display: flex;
        margin-left: auto;
        background: transparent;
        border: none;
        color: #ef4444;
        padding: 0.5rem;
        width: auto;
    }

    /* Horizontal Scrollable Nav */
    .account-nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        gap: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
        width: 100%;
    }
    .account-nav::-webkit-scrollbar { 
        display: none; 
    }

    .nav-item {
        flex: 0 0 auto;
        width: auto;
        padding: 0.8rem 1.2rem;
        background: #f3f4f6;
        border: 1px solid #e5e7eb;
        border-radius: 20px;
        font-size: 0.9rem;
        justify-content: center;
        white-space: nowrap;
        color: var(--text-color);
    }
    
    .nav-item.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    .nav-item svg {
        display: none; /* Icons ausblenden für mehr Platz */
    }

    .nav-item.logout {
        display: none;
    }

    .account-content {
        padding: 1.5rem;
        border-radius: 16px;
        width: 100%;
    }

    /* Recent Order Card Mobile */
    .recent-order-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        width: 100%;
    }
    .recent-order-info {
        width: 100%;
    }
    .recent-order-card button {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 0.5rem;
    }

    .order-actions {
        flex-direction: column;
    }

    .order-actions button {
        width: 100%;
    }

    /* Timeline Mobile Adjustments */
    .timeline-item {
        gap: 1rem;
        margin-left: 10px;
    }
    .timeline-icon {
        width: 36px;
        height: 36px;
    }
    .timeline-item:not(:last-child)::after {
        left: 17px; /* (36/2) - 1 */
        top: 36px;
    }
    
    /* --- NEW BOTTOM NAVIGATION --- */
    #mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(0,0,0,0.05);
        padding: 8px 0 20px 0; /* Extra padding for iPhone Home Indicator */
        justify-content: space-around;
        align-items: center;
        z-index: 9999;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.03);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: #9ca3af;
        font-size: 0.7rem;
        font-weight: 500;
        gap: 4px;
        padding: 5px 10px;
        transition: all 0.2s ease;
    }

    .mobile-nav-item svg {
        width: 24px;
        height: 24px;
    }

    .mobile-nav-item.active {
        color: var(--primary-color);
        transform: translateY(-2px);
    }

    /* --- Account Forms & Grids Mobile --- */
    .form-grid, 
    .form-grid-zip {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Order Status Page Mobile */
    .status-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .status-header h2 {
        font-size: 1.5rem;
    }
    
    /* Order Card Adjustments */
    .order-card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .order-card-status {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* --- Footer Mobile Optimization --- */
    footer {
        position: static;
        background: white;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-radius: 0;
        margin: 2rem 0 0 0;
        padding: 2rem 1rem 90px 1rem; /* Platz für Bottom Nav */
        font-size: 0.8rem;
        color: #9ca3af;
        border: none;
        border-top: 1px solid #f3f4f6;
        text-align: center;
    }
    footer a { color: #6b7280; text-decoration: none; font-weight: normal; }
    footer p { margin: 0.5rem 0; }
}