/**
 * Business Profile - Mobile Optimizations
 * Mobile-first action hierarchy for business profiles
 */

/* ========================================
   MOBILE: BREADCRUMB FIXES
   ======================================== */

@media (max-width: 768px) {
    .business-profile-enhanced .profile-back-nav {
        padding: 12px 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .business-profile-enhanced .breadcrumb-nav {
        flex-wrap: nowrap;
        gap: 8px;
        white-space: nowrap;
        min-width: min-content;
    }
    
    .business-profile-enhanced .breadcrumb-item {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .business-profile-enhanced .breadcrumb-separator {
        flex-shrink: 0;
    }
    
    /* Hide scrollbar but keep functionality */
    .business-profile-enhanced .profile-back-nav::-webkit-scrollbar {
        display: none;
    }
    .business-profile-enhanced .profile-back-nav {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    /* Remove side padding from profile sections */
    .profile-content-enhanced {
        padding: 0;
    }
    
    .profile-main-enhanced,
    .profile-sidebar-enhanced {
        padding-left: 0;
        padding-right: 0;
    }
    
    .profile-section-enhanced,
    .about-details-enhanced,
    .team-grid-enhanced,
    .funding-timeline-enhanced {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* Hide desktop action buttons on mobile */
    .profile-actions-enhanced {
        display: none !important;
    }
    
    /* Hide the businesses bottom menu when viewing business profile */
    .business-profile-enhanced ~ .mobile-bottom-menu {
        display: none !important;
    }
    
    /* Alternative: Hide bottom menu when section is business-profile */
    body[data-section="business-profile"] .mobile-bottom-menu,
    .ap-content:has(.business-profile-enhanced) ~ .mobile-bottom-menu {
        display: none !important;
    }
    
    /* Move Follow button to header for mobile */
    .profile-info-enhanced {
        position: relative;
    }
    
    .mobile-follow-btn {
        position: absolute;
        top: 0;
        right: 0;
        padding: 8px 16px;
        border-radius: 8px;
        border: 1px solid #E5E7EB;
        background: white;
        color: #374151;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        transition: all 0.2s;
    }
    
    .mobile-follow-btn.following {
        background: #F3F4F6;
        border-color: #D1D5DB;
    }
    
    .mobile-follow-btn:active {
        transform: scale(0.95);
    }
}

/* ========================================
   MOBILE: HIDE DESKTOP ELEMENTS
   ======================================== */

@media (min-width: 769px) {
    .mobile-business-bottom-bar,
    .mobile-business-floating-btn,
    .mobile-business-drawer,
    .mobile-business-drawer-overlay {
        display: none !important;
    }
    
    .mobile-follow-btn {
        display: none !important;
    }
}

/* ========================================
   MOBILE: SHOW MOBILE ELEMENTS
   ======================================== */

@media (max-width: 768px) {
    .mobile-business-bottom-bar {
        display: flex !important;
        align-items: center;
    }
    
    .mobile-business-floating-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* ========================================
   MOBILE: FLOATING BUTTON
   ======================================== */

.mobile-business-floating-btn {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    z-index: 998;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .mobile-business-floating-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.mobile-business-floating-btn:active {
    transform: scale(0.95);
}

/* ========================================
   MOBILE: BOTTOM STICKY ACTION BAR
   ======================================== */

.mobile-business-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #E5E7EB;
    padding: 12px 16px;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    gap: 12px;
}

@media (max-width: 768px) {
    .mobile-business-bottom-bar {
        display: flex !important;
        align-items: center;
    }
}

.mobile-business-action-chat {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    background: white;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mobile-business-action-chat:active {
    background: #F3F4F6;
}

.mobile-business-action-primary {
    flex: 1;
    height: 48px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.mobile-business-action-primary:active {
    transform: scale(0.98);
}

.mobile-business-action-more {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    background: white;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mobile-business-action-more:active {
    background: #F3F4F6;
}

/* ========================================
   MOBILE: DRAWER OVERLAY
   ======================================== */

.mobile-business-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: none;
}

.mobile-business-drawer-overlay.active {
    display: block;
}

/* ========================================
   MOBILE: DRAWER BASE
   ======================================== */

.mobile-business-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
}

@media (max-width: 768px) {
    .mobile-business-drawer {
        display: block;
    }
}

.mobile-business-drawer.open {
    transform: translateY(0);
}

.mobile-business-drawer-handle {
    width: 40px;
    height: 4px;
    background: #D1D5DB;
    border-radius: 2px;
    margin: 12px auto 8px;
}

.mobile-business-drawer-header {
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
}

.mobile-business-drawer-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.mobile-business-drawer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #6B7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-business-drawer-body {
    padding: 20px;
}

/* ========================================
   MOBILE: MORE MENU DRAWER
   ======================================== */

.mobile-business-more-menu {
    padding: 0;
}

.mobile-business-menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border: none;
    background: white;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #F3F4F6;
}

.mobile-business-menu-item:active {
    background: #F9FAFB;
}

.mobile-business-menu-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    flex-shrink: 0;
}

.mobile-business-menu-content {
    flex: 1;
}

.mobile-business-menu-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 2px 0;
}

.mobile-business-menu-desc {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
}

/* ========================================
   MOBILE: SMART REQUEST MODAL
   ======================================== */

@media (max-width: 768px) {
    .smart-request-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .smart-request-modal {
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
    }
    
    .modal-categories-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .modal-header {
        padding: 20px 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-category-card {
        padding: 14px;
    }
    
    .modal-section-title {
        font-size: 16px;
    }
    
    .modal-section-subtitle {
        font-size: 13px;
    }
}

/* ========================================
   MOBILE: PADDING BOTTOM FOR STICKY BAR
   ======================================== */

@media (max-width: 768px) {
    .business-profile-enhanced {
        padding-bottom: 80px;
    }
}
