/* Mobile CSS - FreshMart Grocery Delivery App */
/* Native Mobile App Experience */

@media (max-width: 767px) {
    /* Hide Desktop Header on Mobile */
    .desktop-header {
        display: none !important;
    }
    
    /* Mobile App Bar */
    .mobile-app-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background: var(--primary-color);
        color: white;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .menu-toggle {
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .app-bar-logo {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 1.3rem;
        font-weight: 800;
    }
    
    .app-bar-logo i {
        font-size: 1.5rem;
    }
    
    .app-bar-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .search-toggle,
    .cart-btn-mobile {
        background: none;
        border: none;
        color: white;
        font-size: 1.3rem;
        cursor: pointer;
        padding: 0.5rem;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .cart-badge {
        position: absolute;
        top: 0;
        right: 0;
        background: var(--danger-color);
        color: white;
        font-size: 0.7rem;
        font-weight: 700;
        padding: 0.15rem 0.4rem;
        border-radius: 10px;
        min-width: 18px;
        text-align: center;
    }
    
    /* Mobile Search Bar */
    .mobile-search-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: white;
        z-index: 1001;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .mobile-search-bar.active {
        transform: translateY(0);
    }
    
    .search-input-container {
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    
    .search-back,
    .search-clear {
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 1.3rem;
        cursor: pointer;
        padding: 0.5rem;
    }
    
    .search-input-container input {
        flex: 1;
        border: none;
        outline: none;
        font-size: 1rem;
        padding: 0.5rem;
    }
    
    /* Side Navigation Drawer */
    .side-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1100;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .side-nav-overlay.active {
        opacity: 1;
        pointer-events: all;
    }
    
    .side-nav {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background: white;
        z-index: 1101;
        transition: left 0.3s ease;
        display: flex;
        flex-direction: column;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .side-nav.active {
        left: 0;
    }
    
    .side-nav-header {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        color: white;
        padding: 1.5rem;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }
    
    .user-profile {
        display: flex;
        gap: 1rem;
        align-items: center;
    }
    
    .user-avatar {
        font-size: 3rem;
        color: rgba(255, 255, 255, 0.9);
    }
    
    .user-info h3 {
        font-size: 1.1rem;
        font-weight: 700;
        margin-bottom: 0.2rem;
    }
    
    .user-info p {
        font-size: 0.85rem;
        opacity: 0.9;
    }
    
    .side-nav-close {
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.3rem;
    }
    
    .side-nav-content {
        flex: 1;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    
    .side-nav-menu {
        list-style: none;
        padding: 0;
        margin: 0;
        flex: 1;
    }
    
    .side-nav-item {
        border-bottom: 1px solid var(--border-color);
    }
    
    .side-nav-item.active {
        background: var(--bg-secondary);
    }
    
    .side-nav-item a {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem 1.5rem;
        color: var(--text-primary);
        text-decoration: none;
        transition: background 0.2s ease;
    }
    
    .side-nav-item a:active {
        background: var(--bg-tertiary);
    }
    
    .side-nav-item i {
        font-size: 1.3rem;
        color: var(--primary-color);
        width: 24px;
        text-align: center;
    }
    
    .side-nav-item span {
        font-size: 1rem;
        font-weight: 500;
    }
    
    .side-nav-footer {
        padding: 1rem 1.5rem;
        border-top: 1px solid var(--border-color);
        background: var(--bg-secondary);
    }
    
    .location-info {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 1rem;
        color: var(--text-secondary);
        font-size: 0.9rem;
    }
    
    .location-info i {
        color: var(--primary-color);
        font-size: 1.1rem;
    }
    
    .change-location-btn {
        width: 100%;
        background: white;
        color: var(--primary-color);
        border: 2px solid var(--primary-color);
        padding: 0.7rem;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .change-location-btn:active {
        background: var(--primary-color);
        color: white;
    }
    
    /* Bottom Navigation Bar */
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        background: white;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        padding: 0.5rem 0;
    }
    
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--text-light);
        font-size: 0.75rem;
        font-weight: 500;
        padding: 0.3rem 0.8rem;
        border-radius: 8px;
        transition: all 0.2s ease;
        position: relative;
        flex: 1;
        max-width: 80px;
    }
    
    .bottom-nav-item i {
        font-size: 1.4rem;
        margin-bottom: 0.2rem;
    }
    
    .bottom-nav-item.active {
        color: var(--primary-color);
    }
    
    .bottom-nav-item.active i {
        transform: scale(1.1);
    }
    
    .cart-badge-bottom {
        position: absolute;
        top: 0;
        right: 20%;
        background: var(--danger-color);
        color: white;
        font-size: 0.7rem;
        font-weight: 700;
        padding: 0.15rem 0.4rem;
        border-radius: 10px;
        min-width: 18px;
        text-align: center;
    }
    
    /* Adjust Body Padding for Mobile */
    body {
        padding-top: 56px;
        padding-bottom: 60px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* Hero Section Mobile */
    .hero {
        padding: 1.5rem 0;
        margin-top: 0;
    }
    
    .hero-content {
        gap: 1.5rem;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .hero-text h1 {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    
    .hero-text p {
        font-size: 0.9rem;
        margin-bottom: 1.2rem;
    }
    
    .hero-search {
        padding: 0.5rem;
        border-radius: 12px;
    }
    
    .hero-search input {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    .search-btn {
        padding: 0.75rem 1.2rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    
    .hero-features {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .feature-badge {
        font-size: 0.85rem;
    }
    
    .feature-badge i {
        font-size: 1rem;
    }
    
    .offer-badge {
        width: 70px;
        height: 70px;
        padding: 0.7rem;
    }
    
    .offer-percent {
        font-size: 1.4rem;
    }
    
    .offer-text {
        font-size: 0.8rem;
    }
    
    .hero-offer p {
        font-size: 0.8rem;
    }
    
    /* Categories Section Mobile */
    .categories {
        padding: 1.5rem 0;
    }
    
    .section-header {
        margin-bottom: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
    }
    
    .section-header p {
        font-size: 0.9rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.8rem;
    }
    
    .category-card {
        padding: 0.7rem 0.4rem;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .category-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 0.5rem;
    }
    
    .category-card h3 {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
    }
    
    .category-card p {
        font-size: 0.65rem;
    }
    
    /* Products Section Mobile */
    .products {
        padding: 1.5rem 0;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .product-card {
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .product-image {
        height: 140px;
    }
    
    .product-badge {
        padding: 0.25rem 0.5rem;
        font-size: 0.65rem;
        border-radius: 6px;
    }
    
    .product-wishlist {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
    
    .product-content {
        padding: 0.8rem;
    }
    
    .product-title {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }
    
    .product-weight {
        font-size: 0.75rem;
        margin-bottom: 0.6rem;
    }
    
    .product-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .current-price {
        font-size: 1.1rem;
    }
    
    .original-price {
        font-size: 0.75rem;
    }
    
    .add-to-cart {
        width: 100%;
        padding: 0.6rem;
        font-size: 0.85rem;
        border-radius: 8px;
        justify-content: center;
    }
    
    /* Features Section Mobile */
    .features {
        padding: 1.5rem 0;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .feature-card {
        padding: 1rem;
        border-radius: 12px;
        display: flex;
        align-items: center;
        gap: 1rem;
        text-align: left;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
        margin: 0;
        flex-shrink: 0;
    }
    
    .feature-card h3 {
        font-size: 1rem;
        margin-bottom: 0.2rem;
    }
    
    .feature-card p {
        font-size: 0.85rem;
    }
    
    /* App Download Section Mobile */
    .app-download {
        padding: 1.5rem 0;
    }
    
    .app-download-content {
        gap: 1.5rem;
    }
    
    .app-text h2 {
        font-size: 1.5rem;
        margin-bottom: 0.7rem;
    }
    
    .app-text p {
        font-size: 0.9rem;
        margin-bottom: 1.2rem;
    }
    
    .app-buttons {
        flex-direction: column;
        gap: 0.7rem;
    }
    
    .app-btn {
        padding: 0.7rem 1rem;
        width: 100%;
        justify-content: center;
    }
    
    .app-btn i {
        font-size: 1.6rem;
    }
    
    .app-btn span {
        font-size: 0.7rem;
    }
    
    .app-btn strong {
        font-size: 0.95rem;
    }
    
    .app-features {
        gap: 0.5rem;
    }
    
    .app-feature {
        font-size: 0.85rem;
    }
    
    .app-feature i {
        font-size: 1rem;
    }
    
    .app-image img {
        max-width: 200px;
    }
    
    /* Footer Mobile */
    .footer {
        padding: 1.5rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .footer-logo {
        font-size: 1.2rem;
        margin-bottom: 0.7rem;
        justify-content: center;
    }
    
    .footer-logo i {
        font-size: 1.6rem;
    }
    
    .footer-section p {
        font-size: 0.85rem;
        margin-bottom: 0.7rem;
    }
    
    .footer-section h3 {
        font-size: 1rem;
        margin-bottom: 0.7rem;
    }
    
    .footer-section ul li {
        margin-bottom: 0.4rem;
    }
    
    .footer-section ul li a {
        font-size: 0.85rem;
    }
    
    .social-links {
        justify-content: center;
        gap: 0.7rem;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
        border-radius: 8px;
        font-size: 0.9rem;
    }
    
    .contact-info p {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
        justify-content: center;
    }
    
    .contact-info i {
        width: 18px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
        padding-top: 1.2rem;
        font-size: 0.8rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .footer-links a {
        font-size: 0.8rem;
    }
    
    /* Cart Sidebar Mobile */
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .cart-sidebar.active {
        right: 0;
    }
    
    .cart-header {
        padding: 1rem;
    }
    
    .cart-header h3 {
        font-size: 1.2rem;
    }
    
    .close-cart {
        font-size: 1.2rem;
    }
    
    .cart-items {
        padding: 1rem;
    }
    
    .cart-footer {
        padding: 1rem;
    }
    
    .cart-total {
        font-size: 1rem;
        margin-bottom: 0.7rem;
    }
    
    .cart-total strong {
        font-size: 1.2rem;
    }
    
    .checkout-btn {
        padding: 0.85rem;
        font-size: 1rem;
        border-radius: 10px;
    }
}

/* Small Mobile (320px - 479px) */
@media (max-width: 479px) {
    .app-bar-logo span {
        font-size: 1.1rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-icon {
        width: 45px;
        height: 45px;
    }
    
    .category-card h3 {
        font-size: 0.7rem;
    }
    
    .category-card p {
        font-size: 0.6rem;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-title {
        font-size: 0.85rem;
    }
    
    .current-price {
        font-size: 1rem;
    }
    
    .bottom-nav-item {
        font-size: 0.7rem;
    }
    
    .bottom-nav-item i {
        font-size: 1.2rem;
    }
}

/* Hide on Larger Screens */
@media (min-width: 768px) {
    .mobile-app-bar,
    .mobile-search-bar,
    .side-nav,
    .side-nav-overlay,
    .bottom-nav {
        display: none !important;
    }
    
    body {
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    .product-card:hover,
    .category-card:hover,
    .feature-card:hover {
        transform: none;
    }
    
    .add-to-cart:hover,
    .cart-btn:hover,
    .checkout-btn:hover {
        transform: none;
    }
    
    .product-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .add-to-cart:active,
    .bottom-nav-item:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}