/* ============================================================
   Return My Cart – Mobile / PWA enhancements
   Layered on top of compiled Tailwind (app.css). Keep this small
   and mobile-first so the desktop layout remains untouched.
   ============================================================ */

/* Treat installed/standalone as a true app: lock scrolling chrome */
@media (display-mode: standalone) {
    html, body {
        overscroll-behavior-y: none;
        touch-action: manipulation;
    }
    /* Hide footer when installed - the bottom nav is the chrome */
    footer { display: none !important; }
}

/* iOS: prevent input zoom by ensuring >=16px font on focusable controls */
@media (max-width: 640px) {
    input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
    select,
    textarea,
    button {
        font-size: 16px;
    }

    /* Bigger, easier to tap primary inputs */
    input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
    select,
    textarea {
        min-height: 44px;
        padding: 0.65rem 0.85rem;
        border-radius: 0.75rem;
    }

    /* Make Tailwind .rounded buttons feel app-like */
    button,
    .btn,
    a.bg-sky-600,
    a.bg-emerald-600,
    a.bg-rose-600,
    button.bg-sky-600,
    button.bg-emerald-600,
    button.bg-rose-600 {
        min-height: 44px;
    }

    /* Tap feedback */
    button:active,
    a:active,
    .tab:active { transform: scale(0.97); }

    /* Tighter, page-like cards on phones */
    .rounded-xl,
    .rounded-2xl { border-radius: 1rem; }

    /* Ensure content never hides under the bottom nav */
    main { padding-bottom: calc(6rem + env(safe-area-inset-bottom)) !important; }
}

/* ---------- Bottom nav: bigger touch targets on phones ---------- */
.bottom-nav .tab {
    min-height: 56px;
    padding-top: 0.5rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px) * 0.0);
    position: relative;
}
.bottom-nav .tab i { font-size: 1.25rem; }
.bottom-nav .tab span { font-size: 0.7rem; }

/* Active tab indicator pill */
.bottom-nav .tab-active::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    box-shadow: 0 4px 10px -2px rgba(14,165,233,0.45);
}

/* ---------- Install prompt button (PWA) ---------- */
.install-fab {
    position: fixed;
    right: 1rem;
    bottom: calc(5.5rem + env(safe-area-inset-bottom));
    z-index: 45;
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 12px 24px -8px rgba(14,165,233,0.55);
    transition: transform .15s ease, opacity .15s ease;
}
.install-fab:active { transform: scale(0.95); }
.install-fab.show { display: inline-flex; }

@media (min-width: 641px) {
    .install-fab {
        right: 1.5rem;
        bottom: 1.5rem;
    }
}

/* ---------- App-like update toast ---------- */
.update-toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(5.5rem + env(safe-area-inset-bottom));
    z-index: 60;
    display: none;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    border-radius: 9999px;
    background: #0f172a;
    color: #f1f5f9;
    font-size: 0.85rem;
    box-shadow: 0 12px 32px -10px rgba(0,0,0,0.5);
}
.update-toast.show { display: inline-flex; }
.update-toast button {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #fff;
    border-radius: 9999px;
    padding: 0.3rem 0.75rem;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ---------- Smooth iOS-feel scrolling for scrollable regions ---------- */
.overflow-x-auto,
.overflow-y-auto { -webkit-overflow-scrolling: touch; }

/* Disable text selection on tab bar (feels app-like) */
.bottom-nav, .app-bar { user-select: none; -webkit-user-select: none; }