/* 
   MOBILE REDESIGN - PROAQUI
   Mobile-First Overrides - Strict Separation from Desktop
*/

@media (max-width: 768px) {
    /* -----------------------------------------------------------
       1. GLOBAL RESET & BASE
       ----------------------------------------------------------- */
    html, body {
        overflow-x: hidden !important;
        background-color: #f8fafc !important; /* Very light slate/gray */
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    }

    /* ENABLE ORGANIC CURVES - Fidelity to Desktop */
    body::before {
        display: block !important;
        content: '' !important;
        opacity: 0.2 !important; /* Reduced visibility for subtle effect */
        
        /* Mobile Waves */
        background-image: 
            /* Top Left */
            url("data:image/svg+xml,%3Csvg width='800' height='800' viewBox='0 0 800 800' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M-100 0C100 0 300 100 400 300C500 500 300 700 100 750' stroke='%231E88E5' stroke-width='3' stroke-opacity='0.25' fill='none'/%3E%3Ccircle cx='0' cy='0' r='500' stroke='%2343A047' stroke-width='2' stroke-opacity='0.2' fill='none'/%3E%3Cpath d='M-50 100C150 100 350 200 450 400' stroke='%231E88E5' stroke-width='2' stroke-opacity='0.2' fill='none'/%3E%3C/svg%3E"),
            
            /* Top Right */
            url("data:image/svg+xml,%3Csvg width='800' height='800' viewBox='0 0 800 800' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M800 0C600 0 400 150 500 400C600 650 850 600 900 800' stroke='%231E88E5' stroke-width='3' stroke-opacity='0.25' fill='none'/%3E%3Ccircle cx='800' cy='0' r='600' stroke='%231E88E5' stroke-width='2' stroke-opacity='0.2' fill='none'/%3E%3Cpath d='M900 100C700 150 550 300 650 500' stroke='%2343A047' stroke-width='2' stroke-opacity='0.2' fill='none'/%3E%3C/svg%3E"),

            /* Bottom Right */
            url("data:image/svg+xml,%3Csvg width='1000' height='600' viewBox='0 0 1000 600' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 600C200 550 400 400 1000 500' stroke='%231E88E5' stroke-width='3' stroke-opacity='0.2' fill='none'/%3E%3Cpath d='M200 600C400 500 600 350 1000 450' stroke='%2343A047' stroke-width='2' stroke-opacity='0.2' fill='none'/%3E%3C/svg%3E") !important;

        background-size: 200% auto, 200% auto, 200% auto !important; /* Zoom in for mobile */
        z-index: 0 !important; /* Behind content */
    }

    /* Container Standardization */
    .container, .main-container, .wrapper, .hero .container, .hero-home .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        position: relative !important;
        z-index: 2 !important;
    }

    /* Remove legacy spacers */
    .spacer, .margin-top, .margin-bottom {
        display: none !important;
    }

    /* -----------------------------------------------------------
       2. HEADER & NAVIGATION
       ----------------------------------------------------------- */
    header, .main-header {
        position: sticky !important;
        top: 0;
        z-index: 1000;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        box-shadow: 0 1px 2px rgba(0,0,0,0.03) !important;
        padding: 12px 0 !important;
        height: auto !important;
    }

    .header-container, header .container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 20px !important;
    }

    .logo img {
        height: 48px !important; /* Increased from 32px for better visibility */
        width: auto !important;
    }

    .mobile-menu-btn {
        display: block !important;
        font-size: 24px !important;
        color: #1e293b !important;
        background: none !important;
        border: none !important;
        padding: 4px !important;
        cursor: pointer !important;
        margin-left: auto !important;
    }

    /* Navigation Menu */
    .nav-menu {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100vh - 60px) !important;
        background: #ffffff !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        padding: 24px !important;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        display: flex !important;
        box-shadow: none !important;
        border-top: 1px solid #f1f5f9 !important;
        overflow-y: auto !important;
        z-index: 999 !important;
    }

    .nav-menu.active {
        transform: translateX(0) !important;
    }

    .nav-menu li {
        width: 100% !important;
        margin: 0 !important;
        border-bottom: 1px solid #f8fafc !important;
        display: block !important;
    }

    .nav-menu a {
        display: block !important;
        padding: 16px 0 !important;
        font-size: 16px !important;
        color: #334155 !important;
        font-weight: 500 !important;
        text-align: left !important;
        text-transform: uppercase !important; /* Force uppercase for consistency */
    }

    .nav-menu .btn-professional, 
    .nav-menu .btn-outline,
    .nav-menu a[href*="register.php"] {
        background-color: #1E88E5 !important;
        color: #ffffff !important;
        text-align: center !important;
        border-radius: 12px !important;
        padding: 16px !important;
        margin-top: 24px !important;
        border: none !important;
        font-weight: 600 !important;
        display: block !important;
        width: 100% !important;
        box-shadow: 0 4px 12px rgba(30, 136, 229, 0.25) !important;
    }

    /* -----------------------------------------------------------
       3. HERO SECTION (HOME)
       ----------------------------------------------------------- */
    .d-none-mobile { display: none !important; }
    .d-block-mobile { display: block !important; }

    /* Redesign the Mobile Hero - Transparent/Clean */
    .d-block-mobile .hero {
        background: transparent !important; /* Show body curves */
        padding: 40px 20px 20px 20px !important;
        border-radius: 0 !important;
        text-align: center !important;
        margin-bottom: 20px !important;
        position: relative !important;
    }
    
    .d-block-mobile .hero::before {
        display: none !important; /* Remove dark overlay */
    }

    .hero h2,
    .d-block-mobile .hero h2 {
        font-size: 26px !important;
        font-weight: 800 !important;
        color: #1e293b !important;
        margin-bottom: 16px !important;
        line-height: 1.25 !important;
        text-shadow: none !important;
        letter-spacing: -0.02em !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .d-block-mobile .hero p {
        font-size: 16px !important;
        color: #64748b !important; /* Slate 500 */
        margin-bottom: 0 !important;
        font-weight: 400 !important;
        line-height: 1.5 !important;
        max-width: 280px !important;
        margin: 0 auto !important;
    }

/* FORCE HERO WHITE ON MOBILE TO FIX BLUE STRIP */
@media (max-width: 991px) {
    .hero {
        background-color: #ffffff !important;
        background-image: none !important;
        color: #333333 !important;
        padding-top: 40px !important; /* Adjust padding if needed */
    }
    .hero h2, .hero p {
        color: #333333 !important;
        text-shadow: none !important;
    }
}


    /* Search Box - Clean Card */
    .search-box {
        background: #ffffff !important;
        border-radius: 20px !important;
        padding: 24px !important;
        box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1) !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        margin-top: 32px !important;
        width: 100% !important;
        border: 1px solid rgba(0,0,0,0.03) !important;
    }

    .search-field-wrapper {
        flex: none !important;
        width: 100% !important;
        min-width: 0 !important;
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
        margin: 0 !important;
        padding-bottom: 8px !important;
    }

    .search-field-wrapper:last-of-type {
        border-bottom: none !important;
    }

    .search-box input, 
    .search-box select,
    .custom-dropdown-wrapper input {
        width: 100% !important;
        height: 52px !important;
        padding: 0 16px !important;
        font-size: 16px !important;
        border: 2px solid transparent !important;
        border-radius: 12px !important;
        background-color: #f8fafc !important;
        color: #334155 !important;
        outline: none !important;
        transition: all 0.2s !important;
    }
    
    .search-box input:focus {
        background-color: #fff !important;
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
    }

    .btn-search-home {
        width: 100% !important;
        height: 56px !important;
        background-color: #1E88E5 !important; /* Brand Blue */
        color: #ffffff !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        border: none !important;
        border-radius: 12px !important;
        cursor: pointer !important;
        transition: transform 0.2s !important;
        margin-top: 8px !important;
        box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3) !important; /* Brand Shadow */
    }

    .btn-search-home:active {
        transform: scale(0.98) !important;
    }

    /* -----------------------------------------------------------
       4. CATEGORIES SECTION
       ----------------------------------------------------------- */
    .categories {
        padding: 20px 0 40px !important;
    }

    .section-title {
        /* Removed aggressive left-align to match desktop/user preference */
        margin-bottom: 24px !important;
    }

    .section-title h3 {
        font-size: 20px !important;
        margin: 0 !important;
        color: #1e293b !important;
        font-weight: 700 !important;
    }

    .section-title p {
        display: none !important;
    }

    .grid-categories {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
        padding: 0 4px !important;
    }

    .category-card {
        padding: 20px !important;
        background: #ffffff !important;
        border-radius: 16px !important;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05) !important;
        border: 1px solid #f1f5f9 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 130px !important;
        transition: transform 0.2s !important;
    }

    .category-card:active {
        transform: scale(0.98) !important;
    }

    .category-icon {
        font-size: 32px !important;
        margin-bottom: 12px !important;
        color: #3b82f6 !important;
    }

    .category-card h4 {
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #475569 !important;
        margin: 0 !important;
        text-align: center !important;
    }

    /* -----------------------------------------------------------
       5. FEATURED PROFESSIONALS
       ----------------------------------------------------------- */
    .featured-pros {
        padding: 20px 0 60px !important;
        background: transparent !important;
    }

    .featured-pros .grid-responsive, 
    .featured-pros .grid-3-col {
        display: flex !important;
        flex-direction: column !important;
        gap: 24px !important;
    }

    .pro-card, .professional-card {
        display: flex !important;
        flex-direction: column !important;
        background: #ffffff !important;
        border-radius: 16px !important;
        overflow: hidden !important;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05) !important;
        border: 1px solid #f1f5f9 !important;
        margin-bottom: 0 !important;
    }

    .pro-card-image, .pro-card .image-wrapper {
        width: 100% !important;
        height: 200px !important;
        background-color: #e2e8f0 !important;
    }

    .pro-card-body, .pro-card-content {
        padding: 20px !important;
    }

    .pro-card h3, .pro-name {
        font-size: 18px !important;
        font-weight: 700 !important;
        color: #1e293b !important;
        margin-bottom: 4px !important;
    }

    .pro-category {
        font-size: 12px !important;
        color: #0369a1 !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        margin-bottom: 8px !important;
        background: #e0f2fe !important;
        padding: 4px 10px !important;
        border-radius: 6px !important;
        display: inline-block !important;
    }

    .pro-location {
        font-size: 14px !important;
        color: #64748b !important;
        margin-bottom: 16px !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .btn-view-profile, .pro-card .btn {
        width: 100% !important;
        padding: 14px !important;
        background: #ffffff !important;
        color: #1E88E5 !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 10px !important;
        font-weight: 600 !important;
        text-align: center !important;
    }

    /* -----------------------------------------------------------
       5b. SERVICES LIST - 2 COLUNAS
       ----------------------------------------------------------- */
    .home-services-list {
        padding: 20px 0 40px !important;
    }

    .services-list-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .service-item {
        padding: 16px 10px !important;
        border-radius: 14px !important;
        min-height: 100px !important;
    }

    .service-item i {
        font-size: 26px !important;
        margin-bottom: 8px !important;
    }

    .service-item span {
        font-size: 13px !important;
    }

    /* -----------------------------------------------------------
       5c. PROFISSIONAIS RECENTES - 2 COLUNAS
       ----------------------------------------------------------- */
    .grid-pros {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .pro-card {
        border-radius: 14px !important;
    }

    .pro-header {
        padding: 14px 10px !important;
    }

    .pro-avatar {
        width: 55px !important;
        height: 55px !important;
    }

    .pro-name {
        font-size: 14px !important;
    }

    .pro-body {
        padding: 10px !important;
    }

    .pro-location, .pro-desc {
        font-size: 12px !important;
    }

    .pro-footer {
        padding: 10px !important;
    }

    /* -----------------------------------------------------------
       5d. DEPOIMENTOS (TESTIMONIALS) - 2 COLUNAS
       ----------------------------------------------------------- */
    .home-testimonials {
        padding: 20px 0 40px !important;
    }

    .testimonials-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        margin-top: 20px !important;
    }

    .testimonial-card {
        padding: 16px !important;
        border-radius: 14px !important;
    }

    .test-header {
        margin-bottom: 12px !important;
    }

    .test-avatar {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
        margin-right: 8px !important;
    }

    .test-info h4 {
        font-size: 13px !important;
    }

    .test-info span {
        font-size: 11px !important;
    }

    .testimonial-card p {
        font-size: 12px !important;
        margin-bottom: 10px !important;
    }

    .test-stars {
        font-size: 14px !important;
    }

    /* -----------------------------------------------------------
       6. BUDGET REQUEST CARD (FIXED)
       ----------------------------------------------------------- */
    .home-budget-request {
        padding: 20px 0 !important;
    }

    .budget-card {
        flex-direction: column !important;
        text-align: center !important;
        padding: 0 !important;
        border-radius: 20px !important;
        /* Keep original blue gradient from desktop, but ensure spacing is mobile optimized */
    }

    .budget-content {
        padding: 30px 24px !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .budget-icon {
        width: 36px !important;  /* Reduced size from 42px */
        height: 36px !important;
        font-size: 16px !important;
        margin-bottom: 20px !important; /* Increased spacing */
        margin-top: -18px !important; /* Move up more significantly */
        transform: rotate(-5deg) !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    }

    .budget-content h3 {
        font-size: 24px !important;
        margin-bottom: 12px !important;
        line-height: 1.3 !important;
    }

    .budget-content p {
        font-size: 15px !important;
        margin-bottom: 24px !important;
        max-width: 100% !important;
        opacity: 0.9 !important;
    }

    .btn-budget {
        width: 100% !important;
        max-width: 260px !important;
        padding: 16px !important;
        display: flex !important; /* Ensure flex for centering */
        justify-content: center !important;
        align-items: center !important;
        margin: 0 auto !important;
        font-size: 15px !important;
    }

    .budget-image {
        display: none !important; /* Hide decorative image on mobile */
    }

    /* -----------------------------------------------------------
       7. PROFILE PAGE
       ----------------------------------------------------------- */
    .profile-container, .profile-layout {
        display: flex !important;
        flex-direction: column !important;
    }

    .profile-sidebar, .profile-main {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }

    .btn-contact-pro {
        position: fixed !important;
        bottom: 20px !important;
        left: 20px !important;
        right: 20px !important;
        width: calc(100% - 40px) !important;
        z-index: 999 !important;
        box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important;
        padding: 16px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
    }
    
    .profile-main {
        padding-bottom: 90px !important;
    }

    /* -----------------------------------------------------------
       8. FOOTER
       ----------------------------------------------------------- */
    footer {
        padding: 40px 20px 30px !important;
        text-align: center !important;
        background: #0f172a !important; /* Slate 900 */
    }

    .footer-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 32px !important;
    }

    .footer-bottom {
        margin-top: 32px !important;
        padding-top: 24px !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    footer::before {
        display: none !important;
    }

    /* -----------------------------------------------------------
       9. INSTITUTIONAL PAGE TITLE (Mobile Fix)
       ----------------------------------------------------------- */
    .page-institutional .proaqui-content h1 {
        position: relative !important;
        margin-bottom: 25px !important;
        text-align: left !important;
        display: block !important;
    }

    .page-institutional .proaqui-content h1::after {
        content: '' !important;
        position: absolute !important;
        bottom: -8px !important;
        left: 0 !important;
        transform: none !important;
        width: 60px !important;
        height: 4px !important;
        background: #90CAF9 !important;
        border-radius: 2px !important;
    }
}
