/* ============================================
   MOBILE APP EXPERIENCE — FlavorDash Mobile
   Applied at ≤768px — transforms site into app
   ============================================ */

/* Hide mobile buttons on desktop */
@media (min-width: 769px) {
    .navbar .mobile-search-btn { display: none !important }
}

@media (max-width: 768px) {

/* ── App Shell ── */
html, body { height: 100%; overflow-x: hidden }
body { padding-bottom: 70px; padding-top: 56px; background: var(--bg-secondary) }

/* ── Compact Top Bar ── */
.navbar {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    z-index: 1000 !important;
    height: 56px;
    padding: 0 12px !important;
    background: var(--bg-card) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important;
}
.navbar .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100% !important;
    padding: 0 !important;
}
.nav-brand { font-size: 1.2rem !important; gap: 6px !important; flex-shrink: 0 }
.nav-brand .site-logo { height: 32px !important }
.navbar .search-bar { display: none }
.navbar .mobile-search-btn { display: flex !important; width: 40px; height: 40px; align-items: center; justify-content: center; border: none; background: none; font-size: 1.15rem; color: var(--text-primary); cursor: pointer }
.navbar .mobile-menu-btn { display: flex !important; width: 40px; height: 40px; align-items: center; justify-content: center; border: none; background: none; font-size: 1.3rem; color: var(--text-primary); cursor: pointer }
.navbar .nav-links { display: none !important }

/* Search overlay for mobile */
.mobile-search-overlay {
    display: none;
    position: fixed;
    top: 56px; left: 0; right: 0;
    background: var(--bg-card);
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 999;
    animation: slideDown 0.2s ease;
}
.mobile-search-overlay.active { display: block }
.mobile-search-overlay form { display: flex; gap: 8px }
.mobile-search-overlay input {
    flex: 1;
    height: 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 16px;
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.mobile-search-overlay button {
    width: 44px; height: 44px;
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    cursor: pointer;
}

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0 }
    to { transform: translateY(0); opacity: 1 }
}

/* ── Bottom Tab Bar ── */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1000;
    height: 64px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 12px;
    min-width: 56px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.mobile-bottom-nav a i { font-size: 1.25rem; transition: var(--transition) }
.mobile-bottom-nav a.active { color: var(--primary) }
.mobile-bottom-nav a.active i { transform: scale(1.1) }
.mobile-bottom-nav a:active { transform: scale(0.92) }

/* Cart badge on bottom nav */
.mobile-bottom-nav .cart-badge {
    position: absolute;
    top: 0; right: 4px;
    min-width: 18px; height: 18px;
    background: var(--primary);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(var(--primary-rgb),0.4);
    pointer-events: none;
}

/* ── Hero Section (Mobile) ── */
.hero {
    min-height: auto !important;
    padding: 70px 0 40px !important;
    overflow: hidden;
}
.hero::before, .hero::after { display: none !important }
.hero .container {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    text-align: center !important;
    padding: 0 16px !important;
}
.hero-content {
    padding: 0 !important;
    order: 1;
}
.hero-content .hero-badge {
    font-size: 0.7rem !important;
    padding: 6px 14px !important;
    margin-bottom: 10px !important;
    display: inline-block;
}
.hero-content h1 {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
    margin-bottom: 10px !important;
    padding: 0 4px;
}
.hero-content p {
    font-size: 0.82rem !important;
    margin: 0 auto 18px !important;
    max-width: 300px !important;
    line-height: 1.6 !important;
}
.hero-buttons {
    display: flex;
    flex-direction: column !important;
    gap: 10px !important;
    justify-content: center !important;
    padding: 0 4px;
}
.hero-buttons .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 14px 24px !important;
    font-size: 0.92rem !important;
    border-radius: 14px !important;
}
.hero-buttons .btn-primary {
    box-shadow: 0 6px 20px rgba(var(--primary-rgb),0.35) !important;
}
.hero-image {
    display: block !important;
    order: 0;
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto !important;
    position: relative;
}
.hero-image img {
    width: 100% !important;
    height: 190px !important;
    object-fit: cover !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1) !important;
}
.hero-image .floating-card {
    display: flex !important;
    position: absolute;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 8px 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    align-items: center;
    gap: 6px;
    animation: float 3s ease-in-out infinite;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: var(--bg-card);
    z-index: 2;
}
.hero-image .floating-card i {
    font-size: 1rem !important;
    color: var(--primary);
}
.hero-image .floating-card span {
    font-size: 0.7rem !important;
    font-weight: 600;
    white-space: nowrap;
}
.hero-image .floating-card:nth-child(2) {
    top: 10px;
    right: 10px;
    animation-delay: 0.3s;
}
.hero-image .floating-card:nth-child(3) {
    bottom: 10px;
    left: 10px;
    animation-delay: 0.8s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) }
    50% { transform: translateY(-6px) }
}

/* ── Sections ── */
.section { padding: 40px 0 !important }
.page-hero { padding: 80px 0 30px !important }
.page-hero h1 { font-size: 1.4rem !important }
.page-hero p { font-size: 0.85rem !important }

/* ── Menu Grid ── */
.menu-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important }
.menu-card { margin: 0 }
.menu-card-image { height: 130px !important }
.card-carousel, .menu-card-image.card-carousel { height: 130px !important }
.menu-card-body { padding: 10px !important }
.menu-card-body h3 { font-size: 0.85rem !important }
.menu-card-body p { display: none }
.menu-card-footer .price { font-size: 1.1rem !important }
.menu-card-footer .sale-price { font-size: 1.1rem !important }
.menu-card-footer .regular-price { font-size: 0.8rem !important }
.add-to-cart-btn { width: 34px !important; height: 34px !important; font-size: 0.9rem !important }

/* ── Categories Grid (Home) ── */
.categories-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 10px !important }
.category-card { padding: 16px 10px !important }
.category-card .icon { font-size: 1.5rem !important }
.category-card h4 { font-size: 0.8rem !important }

/* ── Features Grid ── */
.features-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important }
.feature-card { padding: 20px !important }
.feature-card .icon { font-size: 1.5rem !important }
.feature-card h3 { font-size: 0.9rem !important }
.feature-card p { font-size: 0.8rem !important }

/* ── Testimonials ── */
.testimonials-grid { grid-template-columns: 1fr !important; gap: 12px !important }

/* ── Menu Filters (Mobile) ── */
.menu-filters {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 12px;
    gap: 6px;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
}
.menu-filters::-webkit-scrollbar { display: none }
.filter-btn {
    white-space: nowrap;
    padding: 8px 16px !important;
    font-size: 0.8rem !important;
    flex-shrink: 0;
}

/* ── Item Detail (Mobile) ── */
.item-detail { grid-template-columns: 1fr !important; gap: 20px !important }
.item-detail-section { padding: 80px 0 30px !important }
.item-detail-images { min-width: auto !important }
.item-main-image { height: 280px !important }
.item-detail-info h1 { font-size: 1.4rem !important }
.item-detail-info .item-price-lg { font-size: 1.6rem !important }
.item-price-lg .sale-price { font-size: 1.6rem !important }
.item-actions .btn { flex: 1; justify-content: center }
.item-actions { flex-wrap: wrap }

/* ── Cart Page (Mobile) ── */
.cart-layout { flex-direction: column !important; gap: 20px !important }
.cart-items { width: 100% !important }
.cart-summary { width: 100% !important; position: static !important }
.cart-item { flex-wrap: wrap; gap: 8px }
.cart-item-controls { width: 100%; justify-content: flex-start }

/* ── Checkout (Mobile) ── */
.checkout-layout { flex-direction: column !important; gap: 20px !important }
.checkout-form { width: 100% !important }
.payment-gateways { gap: 6px !important }
.gw-option { padding: 10px 12px !important }

/* ── Auth Pages (Mobile) ── */
.auth-section, .forgot-section { padding: 100px 16px 40px !important }
.auth-box { padding: 30px 24px !important }

/* ── Orders (Mobile) ── */
.order-card { padding: 16px !important }
.order-header { flex-direction: column; gap: 8px; align-items: flex-start !important }
.tracking-timeline { gap: 0; justify-content: space-between }
.tracking-step .step-icon { width: 36px; height: 36px; font-size: 0.85rem }
.tracking-step .step-label { font-size: 0.65rem }

/* ── Profile (Mobile) ── */
.profile-layout { flex-direction: column !important }
.profile-sidebar { width: 100% !important }
.profile-content { width: 100% !important }
.fav-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important }

/* ── Auth Box ── */
.auth-box { width: 100% !important; max-width: 100% !important }

/* ── Reservation (Mobile) ── */
.reservation-layout { flex-direction: column !important; gap: 20px !important }

/* ── Contact (Mobile) ── */
.contact-grid { grid-template-columns: 1fr !important; gap: 20px !important }

/* ── About (Mobile) ── */
.about-grid { grid-template-columns: 1fr !important; gap: 20px !important }
.about-image { display: none }
.about-stats { flex-direction: column; gap: 20px !important }

/* ── Footer (Mobile) ── */
.footer { padding: 40px 0 80px !important }
.footer-grid { grid-template-columns: 1fr 1fr !important; gap: 20px !important }
.footer-bottom { text-align: center; font-size: 0.8rem }

/* ── Toast Notifications ── */
.toast { bottom: 80px !important; left: 16px !important; right: 16px !important; max-width: none !important; border-radius: 12px !important }

/* ── Page Hero Compact ── */
.page-hero { min-height: auto !important }

/* ── Forms ── */
.form-group input, .form-group select, .form-group textarea { font-size: 16px !important } /* prevent zoom on iOS */
.btn { min-height: 48px; font-size: 0.95rem }
.btn-sm { min-height: 38px; font-size: 0.85rem }

/* ── Empty States ── */
.empty-state { padding: 30px 16px !important }

/* ── Invoice ── */
.invoice { padding: 24px !important }
.invoice-header { flex-direction: column; gap: 10px; text-align: center }
.invoice-addresses { flex-direction: column; gap: 15px !important }

/* ── Mobile Hamburger Menu ── */
.nav-links.active {
    display: flex !important;
    position: fixed;
    top: 56px; left: 0; right: 0; bottom: 64px;
    background: var(--bg-card);
    flex-direction: column;
    padding: 20px;
    gap: 4px;
    z-index: 999;
    overflow-y: auto;
    animation: slideDown 0.2s ease;
}
.nav-links.active a, .nav-links.active button {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
}
.nav-links.active a i, .nav-links.active button i { width: 24px; text-align: center; font-size: 1.2rem }
.nav-links.active a.active { background: rgba(var(--primary-rgb),0.08); color: var(--primary) }
.nav-links.active a:active { background: var(--bg-secondary) }
.nav-links.active .theme-toggle { justify-content: flex-start; margin-top: 8px; padding: 14px 16px }

/* ── Mobile Floating Add to Cart Toast ── */
.mobile-add-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    white-space: nowrap;
}
.mobile-add-toast.show { transform: translateX(-50%) translateY(0) }
.mobile-add-toast .toast-icon { color: #2ecc71; font-size: 1.3rem }
.mobile-add-toast .toast-text { font-weight: 500; font-size: 0.9rem }
.mobile-add-toast .toast-action { color: var(--primary); font-weight: 600; font-size: 0.85rem; cursor: pointer; padding: 6px 12px; border-radius: 8px; background: rgba(var(--primary-rgb),0.1) }

/* ── Smooth Page Transitions ── */
.page-transition {
    animation: fadeInUp 0.3s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px) }
    to { opacity: 1; transform: translateY(0) }
}

/* ── Touch-friendly adjustments ── */
button, a, .gw-option, .filter-btn, .category-card { cursor: pointer; -webkit-tap-highlight-color: transparent }
* { -webkit-overflow-scrolling: touch }

/* ── Admin pages: hide bottom nav ── */
.admin-body .mobile-bottom-nav { display: none }
.admin-body { padding-bottom: 0 !important }

} /* End media query */
