/* Mobile Modern 2025 Design - Meta-inspired */

/* Floating scanner button removed - keeping only inline barcode button */
.floating-scanner-btn {
    display: none !important; /* Permanently hidden */
}

/* Show camera button on mobile by default within mobile viewport */
@media (max-width: 768px) {
    .btn-camera-mobile {
        display: inline-flex !important;
    }
}

/* Mobile search form vertical layout */
.mobile-search-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Desktop - horizontal layout */
@media (min-width: 769px) {
    .mobile-search-vertical {
        flex-direction: row !important;
        align-items: center;
    }
    .mobile-search-vertical input {
        flex: 1;
        margin: 0 !important;
        width: auto !important;
    }
    .mobile-search-vertical button {
        width: auto !important;
    }
}

/* Mobile-First Design System */
@media (max-width: 768px) {
    /* Reset and Base */
    body {
        background: linear-gradient(180deg, #ffffff 0%, #f8fafb 100%);
        min-height: 100vh;
    }
    
    /* Modern Navigation Bar */
    .navbar {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    .navbar .logo {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .navbar .logo-text {
        font-size: 1.25rem;
        font-weight: 700;
        background: linear-gradient(135deg, #7FB069 0%, #5a8a4c 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    /* Hero Card Redesign */
    .scanner-card {
        background: transparent;
        box-shadow: none;
        padding: 24px 16px 20px;
        margin: 0;
    }
    
    .scanner-card .card-header {
        text-align: center;
        margin-bottom: 28px;
    }
    
    .hero-mascot {
        width: 120px;
        height: auto;
        margin: 0 auto 16px;
        display: block;
        animation: fadeInScale 0.6s ease-out;
    }
    
    @keyframes fadeInScale {
        from {
            opacity: 0;
            transform: scale(0.9);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }
    
    .scanner-card .card-title {
        font-size: 1.75rem;
        font-weight: 800;
        line-height: 1.2;
        color: #1c1e21;
        margin-bottom: 8px;
        letter-spacing: -0.02em;
    }
    
    .scanner-card .card-subtitle {
        font-size: 0.95rem;
        color: #65676b;
        font-weight: 400;
        line-height: 1.4;
    }
    
    /* Modern Search Section */
    .manual-entry-primary {
        padding: 0;
        margin-bottom: 20px;
    }
    
    /* Floating Search Container */
    .mobile-search-group {
        background: white;
        border-radius: 28px;
        padding: 8px;
        box-shadow: 
            0 4px 20px rgba(0, 0, 0, 0.08),
            0 1px 3px rgba(0, 0, 0, 0.05);
        display: flex;
        gap: 8px;
        align-items: center;
        position: relative;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .mobile-search-group:focus-within {
        box-shadow: 
            0 8px 30px rgba(127, 176, 105, 0.15),
            0 2px 8px rgba(0, 0, 0, 0.08);
        transform: translateY(-2px);
    }
    
    /* Modern Input Field */
    .mobile-search-group .input-modern {
        background: transparent;
        border: none;
        box-shadow: none;
        font-size: 16px;
        font-weight: 400;
        color: #1c1e21;
        padding: 14px 16px;
        height: auto;
        flex: 1;
    }
    
    .mobile-search-group .input-modern::placeholder {
        color: #8a8d91;
        font-weight: 400;
    }
    
    .mobile-search-group .input-modern:focus {
        outline: none;
        box-shadow: none;
    }
    
    /* Redesigned Buttons */
    .mobile-search-group .btn {
        border-radius: 20px;
        border: none;
        font-weight: 600;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 16px;
    }
    
    /* Search Button - Primary Action */
    .mobile-search-group #search-manual-btn {
        background: linear-gradient(135deg, #7FB069 0%, #6fa058 100%);
        color: white;
        box-shadow: 0 2px 8px rgba(127, 176, 105, 0.3);
    }
    
    .mobile-search-group #search-manual-btn:active {
        transform: scale(0.95);
        box-shadow: 0 1px 4px rgba(127, 176, 105, 0.3);
    }
    
    /* Camera Button - Same size as Search Button */
    .mobile-search-group .btn-icon-camera {
        background: #f0f2f5;
        border: none;
        color: #1c1e21;
        height: 44px;
        min-width: 80px;
        padding: 0 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 20px;
        font-weight: 600;
    }
    
    .mobile-search-group .btn-icon-camera:active {
        background: #e4e6e9;
        transform: scale(0.95);
    }
    
    .mobile-search-group .btn-icon-camera svg {
        width: 20px;
        height: 20px;
        stroke-width: 2;
    }
    
    /* Hide button text on mobile */
    .search-btn-text,
    .camera-btn-text {
        display: none;
    }
    
    /* Search Examples - Modern Pills */
    .input-hint {
        text-align: center;
        font-size: 0.875rem;
        color: #65676b;
        margin-top: 20px;
        line-height: 1.6;
    }
    
    .input-hint a {
        display: inline-block;
        background: #f0f2f5;
        color: #1877f2 !important;
        padding: 6px 12px;
        border-radius: 16px;
        text-decoration: none !important;
        font-weight: 500;
        margin: 4px 4px;
        transition: all 0.2s ease;
        font-size: 0.875rem;
    }
    
    .input-hint a:active {
        background: #e4e6e9;
        transform: scale(0.95);
    }
    
    /* Category Section - Modern Cards */
    .category-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 16px;
        margin-top: 32px;
    }
    
    .category-card {
        background: white;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
    }
    
    .category-card:active {
        transform: scale(0.98);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    }
    
    .category-card-link {
        text-decoration: none;
        display: block;
    }
    
    .category-card-image {
        width: 100%;
        height: 120px;
        object-fit: cover;
        background: linear-gradient(135deg, #f0f2f5 0%, #e4e6e9 100%);
    }
    
    .category-card-content {
        padding: 12px;
    }
    
    .category-card-title {
        font-size: 0.925rem;
        font-weight: 600;
        color: #1c1e21;
        margin-bottom: 4px;
        line-height: 1.2;
    }
    
    .category-card-count {
        font-size: 0.8rem;
        color: #8a8d91;
        font-weight: 400;
    }
    
    /* Recent Products - Horizontal Scroll */
    .products-section {
        margin-top: 32px;
        padding: 0 16px;
    }
    
    .products-section-header {
        margin-bottom: 16px;
    }
    
    .products-section-title {
        font-size: 1.125rem;
        font-weight: 700;
        color: #1c1e21;
        margin-bottom: 4px;
    }
    
    .product-cards-grid {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 12px;
        margin: 0 -16px;
        padding: 0 16px 12px;
    }
    
    .product-cards-grid::-webkit-scrollbar {
        display: none;
    }
    
    .product-card-wrapper {
        flex: 0 0 160px;
        scroll-snap-align: start;
    }
    
    .product-card {
        background: white;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        transition: all 0.2s ease;
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
    
    /* Floating scanner button removed - using only inline barcode button */
    /* Bottom Navigation Hint */
    .bottom-nav-hint {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(to top, white 0%, rgba(255, 255, 255, 0) 100%);
        height: 100px;
        pointer-events: none;
        z-index: 900;
    }
    
    /* Animations */
    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .scanner-card {
        animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .category-card {
        animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
    }
    
    .category-card:nth-child(2) { animation-delay: 0.05s; }
    .category-card:nth-child(3) { animation-delay: 0.1s; }
    .category-card:nth-child(4) { animation-delay: 0.15s; }
    
    /* Remove old divider */
    .divider-with-text {
        display: none;
    }
    
    /* Hide desktop camera section on mobile */
    .camera-section-secondary {
        display: none;
    }
    
    /* Results Container Modern Style */
    #results-container {
        padding: 16px;
    }
    
    .result-card {
        background: white;
        border-radius: 20px;
        padding: 24px;
        box-shadow: 
            0 4px 20px rgba(0, 0, 0, 0.08),
            0 1px 3px rgba(0, 0, 0, 0.05);
    }
    
    /* Footer Spacing */
    .site-footer {
        margin-top: 60px;
        background: white;
        border-top: 1px solid rgba(0, 0, 0, 0.04);
    }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-card-wrapper {
        flex: 0 0 200px;
    }
}

