/* Mobile Redesign - Mobile Only Overrides */
/* Applies to screens smaller than 992px */

@media (max-width: 991px) {

    /* --- GLOBAL UTILITIES --- */
    .d-mobile-block {
        display: block !important;
    }

    .d-mobile-flex {
        display: flex !important;
    }

    .d-mobile-none {
        display: none !important;
    }

    /* --- TOOLS PAGE DESIGN --- */

    /* Mobile Header Adjustments for Tools */
    .tools-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px;
        background: #fff;
    }

    /* Filter Pills (Tools) */
    .mobile-filters {
        display: flex;
        overflow-x: auto;
        padding: 10px 15px;
        gap: 10px;
        background: #fff;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE 10+ */
    }

    .mobile-filters::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .filter-pill {
        white-space: nowrap;
        padding: 8px 20px;
        border-radius: 25px;
        background: #f0f2f5;
        color: #555;
        font-size: 14px;
        font-weight: 500;
        border: 1px solid #eee;
        text-decoration: none;
        transition: 0.2s;
    }

    .filter-pill.active {
        background: #0d6efd;
        color: #fff;
        border-color: #0d6efd;
    }

    /* Tools List View Redesign (3 Columns) */
    .dashboard-container .tools-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 0 5px 15px 5px;
        /* Reduced bottom padding */
    }

    /* Container Padding for Sticky Nav */
    .dashboard-container {
        padding-bottom: 90px !important;
    }

    /* Minimal Card Style */
    .dashboard-container .tool-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px 5px;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        /* Softer shadow */
        border: 1px solid #f5f5f5;
        min-height: auto;
        aspect-ratio: 1/1;
        justify-content: center;
    }

    .dashboard-container .tool-card .icon-box {
        margin-bottom: 8px;
        margin-right: 0;
        width: 40px;
        height: 40px;
        font-size: 20px;
        background: transparent;
        color: #333;
        border-radius: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Reset Icon Box override */
    .dashboard-container .tool-card .icon-box i {
        font-size: 24px;
    }

    .dashboard-container .tool-title {
        font-size: 11px;
        font-weight: 500;
        margin-bottom: 0;
        color: #666;
        /* Lighter text as per image */
        line-height: 1.2;
    }

    /* Hide Description & Arrow & Category Titles */
    /* Hide Description & Arrow & Category Titles */
    .dashboard-container .tool-desc,
    .dashboard-container .tool-arrow,
    .category-title {
        display: none !important;
    }

    /* Hide Chevron */
    .dashboard-container .tool-card::after {
        content: none;
    }

    /* Bottom Navigation Bar (Tools) */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #fff;
        display: flex;
        /* Flexbox for buttons */
        justify-content: space-around;
        padding: 12px 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
        z-index: 1000;
        border-top: 1px solid #f0f0f0;
    }

    .nav-item-mobile {
        text-align: center;
        color: #888;
        text-decoration: none;
        flex: 1;
        font-size: 10px;
    }

    .nav-item-mobile i {
        display: block;
        font-size: 20px;
        margin-bottom: 4px;
    }

    .nav-item-mobile.active {
        color: #0d6efd;
    }


    /* --- SERVICE PAGE DESIGN --- */

    /* Hero Section */
    .hero {
        padding: 100px 0 30px;
        background: #fff;
        /* Force white bg on mobile */
    }

    .hero-content {
        text-align: center !important;
        padding: 0 15px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    /* Reset Container Padding for Search on Mobile */
    .service-search-container {
        padding: 0 !important;
    }

    /* Prioritized Search Bar for Mobile (Service Page & Tools) */
    .hero .search-container,
    .dashboard-container .search-container,
    .service-search-container .search-input-wrapper {
        margin: 20px auto 15px;
        width: 100%;
        max-width: 100%;
        height: 46px;
        background: #fff;
        border-radius: 50px;
        padding: 3px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
        border: 1px solid rgba(0, 0, 0, 0.02);
        display: flex;
        align-items: center;
    }

    .hero .search-container i,
    .dashboard-container .search-container i,
    .service-search-container .search-input-wrapper .search-icon {
        margin-left: 15px !important;
        font-size: 16px;
        color: #94a3b8;
        padding-left: 0 !important;
        /* Override existing padding */
    }

    .hero .search-container input,
    .dashboard-container .search-container input,
    .service-search-container .search-input-wrapper input {
        font-size: 14px;
        padding: 0 10px;
        height: 100%;
        border: none;
        outline: none;
        width: 100%;
        background: transparent;
    }

    /* Hide filter icon in service search on mobile if not needed, or style it */
    .service-search-container .search-input-wrapper .filter-icon {
        padding-right: 15px;
        color: #0d6efd;
    }

    .hero .search-container button,
    .dashboard-container .search-container button {
        height: 100%;
        border-radius: 50px;
        padding: 0 20px;
        /* Reduced from 25px */
        font-weight: 600;
        font-size: 13px;
        margin: 0 !important;
        box-shadow: 0 2px 5px rgba(59, 130, 246, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero h1 {
        font-size: 24px !important;
        line-height: 1.3;
        color: #222;
        margin-bottom: 15px;
        text-align: center;
    }

    .hero p {
        font-size: 14px;
        color: #666;
        margin-bottom: 20px;
    }

    /* Hide hero form on mobile */
    .hero-right,
    #form {
        display: none !important;
    }

    /* Big Main CTA in Hero */
    .mobile-hero-cta {
        display: block;
        width: 100%;
        background: #0d6efd;
        color: white;
        text-align: center;
        padding: 14px;
        border-radius: 8px;
        font-weight: 600;
        margin-top: 20px;
        text-decoration: none;
        box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    }

    .mobile-hero-cta:hover {
        color: white;
    }

    /* Benefits Grid (2 columns on mobile) */
    .services-grid,
    /* Assuming this is the class used */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
        padding: 0 15px;
    }

    /* Customize Benefit Cards */
    .service-card,
    div[style*="background:white; padding:25px;"] {
        padding: 15px !important;
        border-radius: 12px !important;
        text-align: center;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
    }

    .service-card h3,
    div[style*="background:white; padding:25px;"] h3 {
        font-size: 14px !important;
        margin-bottom: 5px !important;
        line-height: 1.3;
    }

    .service-card p,
    div[style*="background:white; padding:25px;"] p {
        font-size: 11px !important;
        line-height: 1.4;
    }

    /* Sticky "Call/Whatsapp" Bottom Bar */
    .mobile-sticky-footer {
        position: fixed;
        bottom: 65px !important;
        /* Push up above bottom nav */
        left: 0;
        width: 100%;
        background: #fff;
        padding: 12px 16px;
        box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
        z-index: 9999;
        display: flex;
        gap: 12px;
    }

    .sticky-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 44px;
        border-radius: 8px;
        font-weight: 600;
        text-decoration: none;
        font-size: 14px;
        transition: 0.2s;
    }

    .btn-call {
        background: #fff;
        border: 1px solid #0d6efd;
        color: #0d6efd;
    }

    .btn-whatsapp {
        background: #25D366;
        /* Whatsapp Green */
        color: #fff;
        border: none;
    }

    .sticky-btn i {
        margin-right: 8px;
        font-size: 16px;
    }

    /* Hide Existing Mobile Footer/Bottom Bar if any */
    .mobile-bottom-bar {
        display: none !important;
    }

    /* What's Included List */
    ul[style*="list-style:none"] li {
        margin-bottom: 12px !important;
        font-size: 14px !important;
        display: flex;
        align-items: flex-start;
    }

    /* Accordion/FAQs */
    .faq .service-card {
        border-bottom: 1px solid #eee;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 15px 0 !important;
        margin-bottom: 0 !important;
    }

    .faq .service-card h5 {
        font-size: 15px !important;
    }

    /* Related Services Horizontal Scroll */
    .mobile-related-section {
        padding: 20px 15px;
        background: #f9f9f9;
        margin-top: 10px;
        border-top: 1px solid #eee;
    }

    .mobile-related-title {
        font-size: 16px;
        font-weight: 700;
        margin-bottom: 15px;
        color: #333;
    }

    .mobile-related-scroll {
        display: flex;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 5px;
        scrollbar-width: none;
    }

    .mobile-related-scroll::-webkit-scrollbar {
        display: none;
    }

    .related-card {
        min-width: 140px;
        width: 140px;
        background: #fff;
        border-radius: 10px;
        padding: 15px 10px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
        text-align: center;
        border: 1px solid #eee;
        text-decoration: none;
        color: inherit;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .related-card i {
        font-size: 22px;
        margin-bottom: 8px;
        color: #0d6efd;
        background: #f0f7ff;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

    .related-card h4 {
        font-size: 12px;
        margin: 0;
        font-weight: 600;
        line-height: 1.3;
        color: #444;
    }

    /* --- MOBILE HERO CARD DESIGN --- */
    .mobile-hero-container {
        padding: 0 15px;
        margin-top: 25px;
        /* Fixed overlap issue */
        position: relative;
        z-index: 2;
    }

    .mobile-hero-card {
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
        padding: 20px;
        text-align: left;
        margin-bottom: 25px;
        border: 1px solid #f0f0f0;
    }

    .mobile-tag {
        display: inline-block;
        background: #e3f2fd;
        color: #0d6efd;
        font-size: 11px;
        font-weight: 700;
        padding: 6px 12px;
        border-radius: 20px;
        margin-bottom: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .mobile-tag i {
        margin-right: 5px;
    }

    .mobile-hero-card h1 {
        font-size: 24px !important;
        font-weight: 800;
        color: #1a1a1a;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    .mobile-hero-card p {
        font-size: 13px;
        color: #666;
        line-height: 1.6;
        margin-bottom: 20px;
    }

    .mobile-trust-box {
        display: flex;
        align-items: center;
        margin-bottom: 20px;
    }

    .avatar-group {
        display: flex;
        margin-right: 12px;
    }

    .avatar-circle {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: 2px solid #fff;
        background: #ddd;
        margin-left: -10px;
        background-size: cover;
    }

    .avatar-circle:first-child {
        margin-left: 0;
    }

    .trust-text {
        font-size: 12px;
        font-weight: 500;
        color: #444;
    }

    .trust-text span {
        font-weight: 700;
        color: #000;
    }

    /* --- WHAT'S INCLUDED BOX --- */
    .mobile-package-box {
        background: #f0f7ff;
        border-radius: 16px;
        padding: 24px 20px;
        margin: 25px 0;
        border: 1px solid #e3f2fd;
    }

    .mobile-package-title {
        font-size: 17px;
        font-weight: 700;
        color: #333;
        margin-bottom: 15px;
    }

    .package-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .package-list li {
        display: flex;
        align-items: flex-start;
        margin-bottom: 12px;
        font-size: 14px;
        color: #444;
        line-height: 1.4;
    }

    .package-list li i {
        color: #2da44e;
        font-size: 16px;
        margin-top: 2px;
        margin-right: 10px;
        flex-shrink: 0;
    }

    /* --- TIMELINE (HOW IT WORKS) --- */
    .mobile-process-section {
        padding: 20px 15px;
    }

    .mobile-timeline {
        padding: 0 10px;
        position: relative;
    }

    .timeline-item {
        position: relative;
        padding-left: 35px;
        padding-bottom: 30px;
        border-left: 2px solid #e0e0e0;
    }

    .timeline-item:last-child {
        border-left: none;
    }

    .timeline-dot {
        position: absolute;
        left: -9px;
        top: 0;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: #fff;
        border: 4px solid #0d6efd;
    }

    .timeline-item:nth-child(2) .timeline-dot {
        border-color: #a0c3ff;
    }

    .timeline-item:nth-child(3) .timeline-dot {
        border-color: #e0e0e0;
    }

    .timeline-content h4 {
        font-size: 16px;
        font-weight: 700;
        margin: 0 0 5px 0;
        color: #333;
    }

    .timeline-content p {
        font-size: 13px;
        color: #666;
        margin: 0;
        line-height: 1.5;
    }

    .mobile-section-title {
        font-size: 18px;
        font-weight: 800;
        color: #222;
        margin-bottom: 20px;
        padding: 0;
    }

}

/* --- SMALL MOBILE (320px - 360px) FIXES --- */
@media (max-width: 370px) {

    /* Switch to 2 columns for better space */
    .dashboard-container .tools-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;

    }

    /* Prioritized Search Bar for Mobile */


    /* Adjust Search Bar for small width */
    .hero .search-container,
    .dashboard-container .search-container {
        height: 44px;
        padding: 2px;

    }

    .hero .search-container input,
    .dashboard-container .search-container input {
        font-size: 12px;
        padding: 0 5px;
    }

    .hero .search-container button,
    .dashboard-container .search-container button {
        padding: 0 6px;
        /* Reduced from 15px */
        font-size: 11px;
        /* Reduced from 12px */
    }

    .hero .search-container i,
    .dashboard-container .search-container i {
        margin-left: 8px !important;
        font-size: 14px;
    }

    .hero h1 {
        font-size: 18px !important;
    }

    /* Navbar CTA Fix for Small Screens */
    .btn.open-popup-btn {
        padding: 5px 8px !important;
        font-size: 0.75rem !important;
        margin-right: 0 !important;
    }
}

/* --- CUSTOM VISIBILITY UTILITIES (Strict 768px Boundary) --- */
@media (max-width: 768px) {
    .d-desktop-custom {
        display: none !important;
    }

    .d-mobile-custom {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .d-desktop-custom {
        display: block !important;
    }

    .d-mobile-custom {
        display: none !important;
    }

    /* FIX: Force form visibility on Tablet (769px+) to match Desktop */
    .hero-right,
    #form {
        display: block !important;
    }
}

/* --- MOBILE SERVICE PAGE LAYOUT (Max 768px) --- */
@media (max-width: 768px) {

    /* Reveal Mobile Only Elements */
    .d-mobile-service-block {
        display: block !important;
    }

    /* Hide Original H1/Content if not wrapped correctly, 
       but we will rely on d-md-none classes in HTML for that. */

    /* Hero Image - Full Width */
    .mobile-hero-img {
        width: 100vw;
        margin-left: -50vw;
        margin-right: -50vw;
        position: relative;
        left: 50%;
        display: block;
        height: auto;
        object-fit: cover;
        margin-bottom: 20px;
        margin-top: -20px;
        /* Counteract container padding if any */
    }

    /* If container has padding, the above negative margin trick works to go full bleed. 
       Alternatively, if we are inside a .container, we might need a different approach.
       Let's assume standard bootstrap container padding of 15px.
       Better approach: ensure the parent container on mobile has 0 padding or we break out.
    */

    /* Reset Container for Mobile Hero */
    .mobile-hero-wrapper {
        margin: 0 -15px;
        /* Breakpoint specific override if inside .container */
    }

    .mobile-hero-img-inner {
        width: 100%;
        display: block;
    }

    /* Content Styling */
    .mobile-service-content {
        padding: 0 5px;
        /* Slight padding alignment */
    }

    .mobile-service-title {
        font-size: 24px;
        font-weight: 800;
        color: #1a1a1a;
        margin-bottom: 15px;
        line-height: 1.3;
        text-align: left;
    }

    .mobile-service-desc {
        font-size: 15px;
        color: #666;
        line-height: 1.6;
        margin-bottom: 25px;
        text-align: left;
    }

    /* Bullet Points */
    .mobile-service-bullets {
        list-style: none;
        padding: 0;
        margin: 0 0 30px 0;
    }

    .mobile-service-bullets li {
        display: flex;
        align-items: flex-start;
        margin-bottom: 14px;
        font-size: 15px;
        color: #333;
    }

    .mobile-service-bullets li i {
        color: #25D366;
        /* Green check or Primary Blue */
        color: #0d6efd;
        font-size: 18px;
        margin-right: 12px;
        margin-top: 2px;
        min-width: 20px;
    }
}

@media (min-width: 769px) {
    .d-mobile-service-block {
        display: none !important;
    }
}