/* Mobile App Specific Styles */

/* Hide horizontal scrollbar and handle mobile layout */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Sticky Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Fix forms for touch devices */
input, select, textarea, button, .btn {
    min-height: 44px;
    font-size: 16px; /* prevent iOS zoom */
}

/* Bottom Navigation Bar */
.mobile-bottom-nav {
    display: none; /* hidden by default on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1001;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    padding-bottom: env(safe-area-inset-bottom, 10px);
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6B7280;
    font-size: 12px;
}

.mobile-bottom-nav a svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    fill: currentColor;
}

.mobile-bottom-nav a.active {
    color: #16A34A; /* primary color */
}

.cart-mobile-checkout { display: none; }

/* Hide some elements on webview / mobile */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
    
    /* Hide floating contact buttons if they block bottom nav */
    .floating-contact {
        bottom: 80px;
    }
    .back-to-top {
        bottom: 80px;
    }
    body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
    .cart-mobile-checkout {
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(66px + env(safe-area-inset-bottom, 0px));
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 14px;
        background: #fff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -8px 24px rgba(15,23,42,.12);
    }
    .cart-mobile-checkout div { display: grid; min-width: 92px; }
    .cart-mobile-checkout small { color: #64748b; font-size: 11px; }
    .cart-mobile-checkout strong { color: #0f172a; font-size: 15px; }
    .cart-mobile-checkout .btn { width: auto; flex: 1; max-width: 260px; }
    .page-cart .floating-contact { bottom: 164px !important; }
    
    /* Fix checkout layout to be mobile first */
    .checkout-grid {
        display: flex;
        flex-direction: column-reverse;
    }
    
    /* Make product card buttons sticky / block */
    .product-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .product-actions .btn {
        width: 100%;
    }
}

/* In-App WebView Specific overrides (detected by JS/PHP) */
.is-webview .topbar {
    display: none; /* Usually apps don't need topbars */
}

.is-webview footer.footer {
    padding-bottom: 80px; /* Space for bottom nav */
}
