/* Mobile App-Like UI */

/* Mobile Navigation Menu */
@media (max-width: 768px) {
    /* Hide desktop navigation on mobile */
    .nav-links {
        display: none !important;
    }
    
    /* Mobile Header */
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .navbar-main {
        padding: 0.75rem 0 !important;
    }
    
    /* Mobile Logo */
    .logo {
        font-size: 1.5rem !important;
        flex: 1;
    }
    
    /* Hamburger Menu Button */
    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        font-size: 1.75rem;
        cursor: pointer;
        padding: 0.5rem;
        color: var(--text-dark);
        order: -1;
    }
    
    /* Mobile Menu Overlay */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: white;
        box-shadow: 2px 0 20px rgba(0,0,0,0.2);
        z-index: 2000;
        transition: left 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-menu.active {
        left: 0;
    }
    
    /* Mobile Menu Overlay Background */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 1999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Mobile Menu Header */
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1.25rem 1rem;
        background: var(--primary);
        color: var(--text-dark);
    }
    
    .mobile-menu-header h3 {
        font-size: 1.25rem;
        font-weight: 700;
    }
    
    .mobile-menu-close {
        background: none;
        border: none;
        font-size: 1.75rem;
        cursor: pointer;
        color: var(--text-dark);
        padding: 0;
    }
    
    /* Mobile Menu Items */
    .mobile-menu-items {
        padding: 0;
        list-style: none;
    }
    
    .mobile-menu-items li {
        border-bottom: 1px solid var(--border);
    }
    
    .mobile-menu-items a {
        display: flex;
        align-items: center;
        padding: 1rem 1.25rem;
        color: var(--text);
        text-decoration: none;
        font-weight: 500;
        transition: background 0.2s;
        gap: 0.75rem;
    }
    
    .mobile-menu-items a:active {
        background: var(--bg);
    }
    
    .mobile-menu-items .icon {
        font-size: 1.25rem;
        width: 24px;
        text-align: center;
    }
    
    /* User Section in Mobile Menu */
    .mobile-user-section {
        padding: 1rem 1.25rem;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
    }
    
    .mobile-user-section .user-name {
        font-weight: 600;
        margin-bottom: 0.25rem;
        color: var(--text-dark);
    }
    
    .mobile-user-section .user-email {
        font-size: 0.875rem;
        color: var(--text-light);
    }
    
    /* Bottom Navigation Bar */
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 999;
        display: flex;
        justify-content: space-around;
        padding: 0.5rem 0;
        border-top: 1px solid var(--border);
    }
    
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        padding: 0.5rem 0.75rem;
        text-decoration: none;
        color: var(--text-light);
        transition: all 0.2s;
        position: relative;
        flex: 1;
        max-width: 80px;
    }
    
    .bottom-nav-item.active {
        color: var(--primary-dark);
    }
    
    .bottom-nav-item:active {
        transform: scale(0.95);
    }
    
    .bottom-nav-item svg {
        width: 24px;
        height: 24px;
    }
    
    .bottom-nav-item span {
        font-size: 0.7rem;
        font-weight: 500;
    }
    
    .bottom-nav-badge {
        position: absolute;
        top: 0;
        right: 15%;
        background: var(--error);
        color: white;
        font-size: 0.65rem;
        padding: 0.125rem 0.375rem;
        border-radius: 10px;
        font-weight: 600;
    }
    
    /* Add padding to content to account for fixed nav */
    body {
        /* padding-top: 60px !important; */
        padding-bottom: 70px !important;
    }
    
    .container {
        padding: 0 0.75rem !important;
        max-width: 100% !important;
    }
    
    main {
        padding-top: 0.5rem !important;
    }
    
    /* Mobile Cards */
    .product-card {
        border-radius: 16px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
        overflow: hidden;
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
    
    /* Mobile Product Image */
    .product-image {
        border-radius: 16px 16px 0 0 !important;
    }
    
    /* Mobile Buttons */
    .btn {
        border-radius: 12px !important;
        font-weight: 600;
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn:active {
        transform: scale(0.97);
    }
    
    /* Mobile Search Bar */
    .search-input {
        border-radius: 25px !important;
        padding: 0.875rem 1rem !important;
        font-size: 1rem !important;
        border: 2px solid var(--border) !important;
    }
    
    .search-input:focus {
        border-color: var(--primary) !important;
        box-shadow: 0 0 0 3px rgba(255, 223, 32, 0.1) !important;
    }
    
    /* Mobile Top Bar */
    .navbar-top {
        font-size: 0.75rem !important;
        padding: 0.5rem 0 !important;
    }
    
    .navbar-top-content {
        flex-direction: row !important;
        gap: 0.5rem !important;
        font-size: 0.7rem !important;
    }
    
    .navbar-top-content div {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Hide desktop-only elements on mobile */
    .navbar-content .nav-actions {
        display: none !important;
    }
    
    /* Show mobile-only elements */
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    /* Mobile Header Actions */
    .mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .mobile-icon-btn {
        background: none;
        border: none;
        position: relative;
        padding: 0.5rem;
        color: var(--text-dark);
        cursor: pointer;
    }
    
    .mobile-icon-btn svg {
        width: 22px;
        height: 22px;
    }
    
    /* Smooth Animations */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    a, button {
        touch-action: manipulation;
    }
    
    /* Pull to Refresh Indicator */
    .pull-to-refresh {
        position: fixed;
        top: 0;
        left: 50%;
        transform: translateX(-50%) translateY(-100%);
        padding: 0.5rem 1rem;
        background: var(--primary);
        color: var(--text-dark);
        border-radius: 0 0 12px 12px;
        font-size: 0.875rem;
        font-weight: 600;
        z-index: 1001;
        transition: transform 0.3s;
    }
    
    /* Mobile Category Pills */
    .category-scroll {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.75rem 0;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .category-scroll::-webkit-scrollbar {
        display: none;
    }
    
    .category-pill {
        background: white;
        border: 2px solid var(--primary);
        color: var(--text-dark);
        padding: 0.5rem 1rem;
        border-radius: 20px;
        white-space: nowrap;
        font-weight: 600;
        font-size: 0.9rem;
        text-decoration: none;
        flex-shrink: 0;
    }
    
    .category-pill.active {
        background: var(--primary);
        color: var(--text-dark);
    }
    
    /* Mobile Modal Full Screen */
    .modal {
        align-items: flex-end !important;
    }
    
    .modal-content {
        border-radius: 20px 20px 0 0 !important;
        max-height: 90vh !important;
        animation: slideUp 0.3s ease !important;
    }
    
    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    /* Floating Action Button */
    .fab {
        position: fixed;
        bottom: 85px;
        right: 1rem;
        width: 56px;
        height: 56px;
        background: var(--primary);
        color: var(--text-dark);
        border: none;
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        font-size: 1.5rem;
        cursor: pointer;
        z-index: 998;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .fab:active {
        transform: scale(0.95);
    }
    
    /* Product List Page - Hide Filters Sidebar on Mobile */
    .filters-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 85% !important;
        max-width: 350px !important;
        height: 100vh !important;
        z-index: 2000 !important;
        overflow-y: auto !important;
        transition: left 0.3s ease !important;
        padding: 1rem !important;
        margin: 0 !important;
    }
    
    .filters-sidebar.active {
        left: 0 !important;
    }
    
    .filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 1999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .filter-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-filter-btn {
        position: fixed !important;
        bottom: 85px !important;
        right: 1rem !important;
        width: 56px !important;
        height: 56px !important;
        background: var(--primary) !important;
        color: var(--text-dark) !important;
        border: none !important;
        border-radius: 50% !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
        font-size: 1.5rem !important;
        cursor: pointer !important;
        z-index: 998 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .mobile-filter-btn:active {
        transform: scale(0.95);
    }
    
    .products-section {
        width: 100% !important;
        flex: none !important;
    }
    
    .filter-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid var(--border);
    }
    
    .filter-close-btn {
        background: none;
        border: none;
        font-size: 2rem;
        cursor: pointer;
        color: var(--text);
        padding: 0;
    }
    
    /* Product Detail Page Responsive */
    .product-detail-grid,
    .product-detail-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .product-images,
    .product-details {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .product-image-main {
        width: 100% !important;
        height: auto !important;
        max-height: 400px !important;
        object-fit: contain !important;
    }
    
    .product-thumbnails {
        display: flex !important;
        gap: 0.5rem !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .product-thumbnail {
        flex-shrink: 0 !important;
        width: 60px !important;
        height: 60px !important;
    }
    
    /* Shop Detail Page */
    .shop-header,
    .shop-info {
        padding: 1rem !important;
    }
    
    .shop-stats {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .shop-stat-card {
        padding: 0.75rem !important;
        text-align: center !important;
    }
    
    /* Profile Pages */
    .profile-container,
    .account-container {
        padding: 0 !important;
    }
    
    .profile-grid,
    .account-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .profile-card {
        margin-bottom: 1rem !important;
        padding: 1rem !important;
    }
    
    /* Order List */
    .order-list {
        padding: 0 !important;
    }
    
    .order-card {
        margin-bottom: 1rem !important;
        padding: 1rem !important;
        border-radius: 12px !important;
    }
    
    .order-items {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    /* Address Cards */
    .address-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .address-card {
        padding: 1rem !important;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.85rem !important;
        padding: 0.5rem 0 !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Remove excessive padding from sections */
    section {
        padding: 1rem 0 !important;
    }
    
    .hero-section,
    .featured-section,
    .categories-section {
        padding: 1rem 0 !important;
    }
    
    /* Category Cards */
    .category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .category-card {
        padding: 1rem !important;
        min-height: 120px !important;
    }
    
    /* Wishlist */
    .wishlist-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Cart Page */
    .cart-container {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .cart-items {
        width: 100% !important;
        margin-bottom: 1rem !important;
    }
    
    .cart-summary {
        width: 100% !important;
        position: static !important;
    }
    
    .cart-item {
        display: flex !important;
        gap: 0.75rem !important;
        padding: 0.75rem !important;
    }
    
    .cart-item-image {
        width: 80px !important;
        height: 80px !important;
        flex-shrink: 0 !important;
    }
    
    .cart-item-details {
        flex: 1 !important;
    }
    
    /* Tables Responsive */
    table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Forms */
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    
    .form-group {
        margin-bottom: 1rem !important;
    }
    
    label {
        font-size: 0.9rem !important;
    }
    
    input, select, textarea {
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 0.75rem !important;
    }
    
    /* Remove hover states on mobile */
    .product-card:hover,
    .category-card:hover,
    .shop-card:hover {
        transform: none !important;
    }
    
    /* Quantity Selector */
    .quantity-selector {
        display: flex !important;
        align-items: center !important;
        gap: 1rem !important;
    }
    
    .quantity-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.25rem !important;
    }
    
    /* Price Display */
    .price {
        font-size: 1.5rem !important;
    }
    
    .original-price {
        font-size: 1rem !important;
    }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .bottom-nav {
        display: none;
    }
    
    body {
        padding-bottom: 0 !important;
    }
    
    .filters-sidebar {
        display: block !important;
    }
}

/* Desktop */
@media (min-width: 769px) {
    .mobile-menu-btn,
    .mobile-menu,
    .mobile-menu-overlay,
    .bottom-nav,
    .mobile-only,
    .fab {
        display: none !important;
    }
}
