/* Mobile App-Like UI Framework */
/* Quick implementation for mobile users */

:root {
    --app-primary: #6366f1;
    --app-secondary: #8b5cf6;
    --app-success: #10b981;
    --app-danger: #ef4444;
    --app-warning: #f59e0b;
    --app-bg: #ffffff;
    --app-surface: #f8fafc;
    --app-border: #e2e8f0;
    --app-text: #1e293b;
    --app-text-secondary: #64748b;
    --app-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --app-shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --bottom-nav-height: 60px;
    --top-bar-height: 56px;
}

/* Mobile-only styles */
@media (max-width: 767px) {
    /* Body adjustments for fixed navigation */
    body {
        padding-bottom: var(--bottom-nav-height);
        padding-top: var(--top-bar-height);
        overflow-x: hidden;
    }

    /* Hide desktop header on mobile */
    .desktop-header {
        display: none !important;
    }

    /* Mobile App Bar (Top) */
    .mobile-app-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--top-bar-height);
        background: var(--app-bg);
        border-bottom: 1px solid var(--app-border);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        z-index: 1000;
        box-shadow: var(--app-shadow);
    }

    .mobile-app-bar .logo {
        font-size: 20px;
        font-weight: 700;
        color: var(--app-primary);
        text-decoration: none;
    }

    .mobile-app-bar .actions {
        display: flex;
        gap: 12px;
        align-items: center;
    }

    .mobile-app-bar .icon-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: var(--app-text);
        font-size: 20px;
        cursor: pointer;
        transition: all 0.2s;
        position: relative;
    }

    .mobile-app-bar .icon-btn:active {
        transform: scale(0.95);
        background: var(--app-surface);
    }

    .mobile-app-bar .badge {
        position: absolute;
        top: 4px;
        right: 4px;
        background: var(--app-danger);
        color: white;
        font-size: 10px;
        font-weight: 700;
        min-width: 18px;
        height: 18px;
        border-radius: 9px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
    }

    /* Bottom Navigation */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--bottom-nav-height);
        background: var(--app-bg);
        border-top: 1px solid var(--app-border);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    }

    .mobile-bottom-nav .nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px;
        text-decoration: none;
        color: var(--app-text-secondary);
        transition: all 0.2s;
        position: relative;
    }

    .mobile-bottom-nav .nav-item i {
        font-size: 24px;
        transition: all 0.2s;
    }

    .mobile-bottom-nav .nav-item span {
        font-size: 11px;
        font-weight: 500;
    }

    .mobile-bottom-nav .nav-item.active {
        color: var(--app-primary);
    }

    .mobile-bottom-nav .nav-item.active i {
        transform: scale(1.1);
    }

    .mobile-bottom-nav .nav-item:active {
        transform: scale(0.95);
    }

    .mobile-bottom-nav .nav-item .badge {
        position: absolute;
        top: 4px;
        right: 50%;
        transform: translateX(12px);
        background: var(--app-danger);
        color: white;
        font-size: 10px;
        font-weight: 700;
        min-width: 18px;
        height: 18px;
        border-radius: 9px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
    }

    /* Main Content Area */
    .mobile-content {
        min-height: calc(100vh - var(--bottom-nav-height) - var(--top-bar-height));
        padding: 16px;
    }

    /* Product Cards - Mobile Optimized */
    .product-card-mobile {
        background: var(--app-bg);
        border-radius: 12px;
        overflow: hidden;
        box-shadow: var(--app-shadow);
        margin-bottom: 16px;
        transition: all 0.2s;
    }

    .product-card-mobile:active {
        transform: scale(0.98);
        box-shadow: var(--app-shadow-lg);
    }

    .product-card-mobile .image {
        position: relative;
        padding-top: 100%;
        background: var(--app-surface);
    }

    .product-card-mobile .image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .product-card-mobile .wishlist-btn {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
        border-radius: 18px;
        background: rgba(255,255,255,0.9);
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        color: var(--app-danger);
        cursor: pointer;
        box-shadow: var(--app-shadow);
    }

    .product-card-mobile .content {
        padding: 12px;
    }

    .product-card-mobile .title {
        font-size: 14px;
        font-weight: 600;
        color: var(--app-text);
        margin: 0 0 4px 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-card-mobile .price {
        font-size: 16px;
        font-weight: 700;
        color: var(--app-primary);
        margin: 4px 0;
    }

    .product-card-mobile .old-price {
        font-size: 13px;
        color: var(--app-text-secondary);
        text-decoration: line-through;
        margin-left: 6px;
    }

    .product-card-mobile .rating {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 12px;
        color: var(--app-warning);
        margin: 4px 0;
    }

    /* Buttons - Touch Friendly */
    .btn-mobile {
        min-height: 48px;
        padding: 12px 24px;
        border-radius: 12px;
        font-size: 16px;
        font-weight: 600;
        border: none;
        cursor: pointer;
        transition: all 0.2s;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .btn-mobile:active {
        transform: scale(0.97);
    }

    .btn-primary-mobile {
        background: var(--app-primary);
        color: white;
    }

    .btn-secondary-mobile {
        background: var(--app-surface);
        color: var(--app-text);
        border: 1px solid var(--app-border);
    }

    /* Category Pills - Horizontal Scroll */
    .category-pills {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 12px 0;
        margin: 0 -16px;
        padding-left: 16px;
        padding-right: 16px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .category-pills::-webkit-scrollbar {
        display: none;
    }

    .category-pill {
        flex-shrink: 0;
        padding: 8px 16px;
        border-radius: 20px;
        background: var(--app-surface);
        border: 1px solid var(--app-border);
        color: var(--app-text);
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
        white-space: nowrap;
        transition: all 0.2s;
    }

    .category-pill.active {
        background: var(--app-primary);
        color: white;
        border-color: var(--app-primary);
    }

    .category-pill:active {
        transform: scale(0.95);
    }

    /* Search Bar - Mobile */
    .search-bar-mobile {
        position: relative;
        margin: 16px 0;
    }

    .search-bar-mobile input {
        width: 100%;
        height: 48px;
        padding: 0 48px 0 48px;
        border-radius: 24px;
        border: 1px solid var(--app-border);
        background: var(--app-surface);
        font-size: 15px;
        outline: none;
        transition: all 0.2s;
    }

    .search-bar-mobile input:focus {
        border-color: var(--app-primary);
        background: var(--app-bg);
    }

    .search-bar-mobile .icon-left {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 20px;
        color: var(--app-text-secondary);
    }

    .search-bar-mobile .icon-right {
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 20px;
        color: var(--app-text-secondary);
        cursor: pointer;
    }

    /* Floating Action Button */
    .fab {
        position: fixed;
        bottom: calc(var(--bottom-nav-height) + 16px);
        right: 16px;
        width: 56px;
        height: 56px;
        border-radius: 28px;
        background: var(--app-primary);
        color: white;
        border: none;
        font-size: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: var(--app-shadow-lg);
        cursor: pointer;
        z-index: 999;
        transition: all 0.2s;
    }

    .fab:active {
        transform: scale(0.9);
    }

    /* Pull to Refresh Indicator */
    .pull-to-refresh {
        position: absolute;
        top: var(--top-bar-height);
        left: 50%;
        transform: translateX(-50%);
        padding: 8px 16px;
        background: var(--app-primary);
        color: white;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 600;
        opacity: 0;
        transition: opacity 0.2s;
        z-index: 999;
    }

    .pull-to-refresh.show {
        opacity: 1;
    }

    /* Loading Skeleton */
    .skeleton {
        background: linear-gradient(90deg, var(--app-surface) 25%, #e2e8f0 50%, var(--app-surface) 75%);
        background-size: 200% 100%;
        animation: skeleton-loading 1.5s infinite;
        border-radius: 8px;
    }

    @keyframes skeleton-loading {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }

    /* Toast Notification */
    .toast-mobile {
        position: fixed;
        bottom: calc(var(--bottom-nav-height) + 16px);
        left: 16px;
        right: 16px;
        background: var(--app-text);
        color: white;
        padding: 16px;
        border-radius: 12px;
        font-size: 14px;
        box-shadow: var(--app-shadow-lg);
        z-index: 9999;
        transform: translateY(100px);
        opacity: 0;
        transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    }

    .toast-mobile.show {
        transform: translateY(0);
        opacity: 1;
    }

    .toast-mobile.success {
        background: var(--app-success);
    }

    .toast-mobile.error {
        background: var(--app-danger);
    }

    /* Smooth Animations */
    .fade-in {
        animation: fadeIn 0.3s ease-in;
    }

    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .slide-up {
        animation: slideUp 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    }

    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    /* Hide elements on mobile */
    .hide-mobile {
        display: none !important;
    }
}

/* Desktop - Keep normal layout */
@media (min-width: 768px) {
    .mobile-app-bar,
    .mobile-bottom-nav,
    .fab {
        display: none !important;
    }

    body {
        padding-bottom: 0;
        padding-top: 0;
    }
}
