/**
 * Mobile App Theme
 * Inflatable Rentals - jump.undervision.com
 *
 * Loaded when admin enables "mobile_app_theme".
 * All mobile styles gated behind @media (max-width: 1024px).
 * Desktop hide rules at the top so the bottom nav never leaks.
 */

/* ═══════════════════════════════════════════════════════════
   DESKTOP — hide app-only elements unconditionally
   ═══════════════════════════════════════════════════════════ */
.app-bottom-nav,
.app-floating-cta,
.app-category-strip {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE STYLES — only at ≤768 px
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {

    /* ── Base ──────────────────────────────────────────────── */
    body.app-theme {
        font-size: 19px;
        padding-bottom: 100px;
        -webkit-overflow-scrolling: touch;
    }

    /* ── Slim App Header ──────────────────────────────────── */
    body.app-theme .site-header {
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }

    body.app-theme .nav-wrapper {
        padding: 0.4rem 0;
    }

    body.app-theme .nav-logo span {
        display: none;
    }

    body.app-theme .nav-logo img {
        height: 80px !important;
    }

    body.app-theme .nav-cart svg {
        width: 40px;
        height: 40px;
    }

    body.app-theme .cart-count {
        font-size: 16px;
        min-width: 26px;
        height: 26px;
        line-height: 26px;
    }

    body.app-theme .nav-auth-link {
        display: none !important;
    }

    body.app-theme .nav-toggle {
        display: none !important;
    }

    body.app-theme .nav-cart {
        display: flex;
    }

    /* ── Bottom Nav Bar ───────────────────────────────────── */
    .app-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 90px;
        background: #fff;
        align-items: center;
        justify-content: space-around;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
        z-index: 9999;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .app-bottom-nav__tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        flex: 1;
        text-decoration: none;
        color: var(--gray-500, #9CA3AF);
        font-size: 15px;
        font-weight: 800;
        padding: 6px 0;
        position: relative;
        -webkit-tap-highlight-color: transparent;
        background: none;
        border: none;
        cursor: pointer;
        font-family: var(--font-body);
        line-height: 1;
        transition: color 0.15s ease;
    }

    .app-bottom-nav__tab i {
        font-size: 34px;
        line-height: 1;
    }

    .app-bottom-nav__tab.active,
    .app-bottom-nav__tab:hover {
        color: var(--primary, #FF6B35);
    }

    /* Cart badge */
    .app-bottom-nav__badge {
        position: absolute;
        top: 2px;
        right: 50%;
        transform: translateX(14px);
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        font-size: 10px;
        font-weight: 800;
        line-height: 18px;
        text-align: center;
        color: #fff;
        background: var(--danger, #EF476F);
        border-radius: 9px;
        display: none;
    }

    .app-bottom-nav__badge.has-items {
        display: block;
    }

    /* Hide/show on scroll */
    .app-bottom-nav.nav-hidden {
        transform: translateY(100%);
        transition: transform 0.25s ease;
    }

    .app-bottom-nav.nav-visible {
        transform: translateY(0);
        transition: transform 0.25s ease;
    }

    /* ── Full-Width Layout ────────────────────────────────── */
    body.app-theme .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    body.app-theme .hero {
        border-radius: 0;
    }

    body.app-theme .section {
        padding: 2.5rem 0;
    }

    body.app-theme .section-lg {
        padding: 3rem 0;
    }

    body.app-theme .section-sm {
        padding: 1.5rem 0;
    }

    /* ── Card Overrides ───────────────────────────────────── */
    body.app-theme .inventory-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    body.app-theme .card {
        border-radius: var(--radius, 12px);
    }

    body.app-theme .card-image {
        aspect-ratio: 16 / 10;
        height: auto;
    }

    body.app-theme .card-title {
        font-size: 1.2rem;
    }

    body.app-theme .card-price {
        font-size: 1.4rem;
    }

    body.app-theme .card-footer .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    body.app-theme .grid-3,
    body.app-theme .grid-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* ── Horizontal Scroll Carousels ──────────────────────── */
    body.app-theme .app-scroll-container {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 0.75rem;
        padding-bottom: 0.5rem;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    body.app-theme .app-scroll-container::-webkit-scrollbar {
        display: none;
    }

    body.app-theme .app-scroll-container > * {
        min-width: 85vw;
        max-width: 85vw;
        flex-shrink: 0;
        scroll-snap-align: center;
    }

    body.app-theme .specials-section .app-scroll-container > .special-card {
        min-width: 85vw;
        max-width: 85vw;
    }

    /* ── Category Chips Strip ─────────────────────────────── */
    .app-category-strip {
        display: flex !important;
        overflow-x: auto;
        gap: 0.5rem;
        padding: 0.75rem 0.5rem;
        margin-bottom: 1rem;
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .app-category-strip::-webkit-scrollbar {
        display: none;
    }

    .app-category-strip .filter-chip {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    body.app-theme .filter-sidebar {
        display: none !important;
    }

    body.app-theme .filter-toggle-btn {
        display: none !important;
    }

    body.app-theme .inventory-layout {
        grid-template-columns: 1fr !important;
    }

    /* ── Larger Touch Targets ─────────────────────────────── */
    body.app-theme .btn {
        min-height: 48px;
        font-size: 1rem;
    }

    body.app-theme .form-control,
    body.app-theme input[type="text"],
    body.app-theme input[type="email"],
    body.app-theme input[type="tel"],
    body.app-theme input[type="password"],
    body.app-theme input[type="number"],
    body.app-theme input[type="date"],
    body.app-theme input[type="url"],
    body.app-theme select,
    body.app-theme textarea {
        min-height: 48px;
        font-size: 1rem;
    }

    /* ── Item Detail Page ─────────────────────────────────── */
    body.app-theme .item-gallery-main {
        border-radius: 0;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    body.app-theme .item-gallery-thumbs {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    body.app-theme .item-gallery-thumbs::-webkit-scrollbar {
        display: none;
    }

    body.app-theme .item-gallery-thumb {
        flex-shrink: 0;
        width: 70px;
        height: 70px;
    }

    body.app-theme .item-cart-form .btn-block {
        width: 100%;
        min-height: 52px;
        font-size: 1.1rem;
    }

    body.app-theme .item-info-title {
        font-size: 1.6rem;
    }

    body.app-theme .item-info-price {
        font-size: 2rem;
    }

    /* ── Floating Book CTA ────────────────────────────────── */
    .app-floating-cta {
        display: flex !important;
        position: fixed;
        bottom: 72px;
        left: 0.75rem;
        right: 0.75rem;
        z-index: 9998;
        padding: 0.85rem 1.5rem;
        background: var(--primary, #FF6B35);
        color: #fff;
        font-family: var(--font-heading, 'Fredoka One', cursive);
        font-size: 1.1rem;
        font-weight: 700;
        text-align: center;
        border: none;
        border-radius: var(--radius, 12px);
        box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }

    .app-floating-cta:active {
        transform: scale(0.97);
    }

    body.app-theme .app-floating-cta.cta-hidden {
        transform: translateY(calc(100% + 80px));
        transition: transform 0.25s ease;
    }

    body.app-theme .app-floating-cta.cta-visible {
        transform: translateY(0);
        transition: transform 0.25s ease;
    }

    /* ── Footer Clearance ─────────────────────────────────── */
    body.app-theme .site-footer {
        padding-bottom: 80px;
    }

} /* end @media (max-width: 1024px) */
