/* MOBILE HEADER SPACING FIX - CRITICAL FOR CONTENT VISIBILITY */

/* Desktop - Full header height (top section + navigation) */
body {
    padding-top: 150px !important; /* 80px top section + 70px navigation */
}

/* Main content classes */
.main-with-padding {
    padding-top: 0 !important; /* Body already has padding */
}

.main-no-padding {
    padding-top: 0 !important; /* For pages like home with hero sections */
    margin-top: -150px !important; /* Negative margin to pull content up */
}

/* MOBILE RESPONSIVE FIXES */
@media (max-width: 991px) {
    /* Mobile - Only top section visible (navigation hidden) */
    body {
        padding-top: 85px !important; /* Slightly more space for mobile header */
    }
    
    .main-with-padding {
        padding-top: 0 !important;
    }
    
    .main-no-padding {
        padding-top: 0 !important;
        margin-top: -85px !important; /* Negative margin for hero sections */
    }
    
    /* Ensure hero sections start right after header */
    .hero-section,
    .hero-carousel,
    .hero-swiper,
    .carousel,
    .swiper {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Fix any sections that might be cut off */
    section:first-child:not(.hero-section):not(.hero-carousel),
    .container:first-child,
    .row:first-child {
        margin-top: 0 !important;
        padding-top: 25px !important;
    }
    
    /* Ensure all page content starts with proper spacing */
    main > section:first-child {
        padding-top: 3rem !important;
    }
    
    /* Special handling for pages with hero sections */
    main.main-no-padding > section:first-child {
        padding-top: 0 !important;
    }
}

@media (max-width: 768px) {
    /* Smaller mobile devices */
    body {
        padding-top: 80px !important;
    }
    
    .main-no-padding {
        margin-top: -80px !important;
    }
    
    /* Ensure content is visible */
    main > section:first-child {
        padding-top: 2.5rem !important;
    }
}

@media (max-width: 480px) {
    /* Very small mobile devices */
    body {
        padding-top: 75px !important;
    }
    
    .main-no-padding {
        margin-top: -75px !important;
    }
    
    /* Ensure content is visible on very small screens */
    main > section:first-child {
        padding-top: 2rem !important;
    }
}

/* FORCE CONTENT VISIBILITY ON ALL PAGES */
@media (max-width: 991px) {
    /* Ensure all page content is visible */
    .py-5 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .section-padding {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }
    
    /* Fix specific page layouts */
    .about-page,
    .services-page,
    .portfolio-page,
    .contact-page,
    .blog-page {
        padding-top: 2rem !important;
    }
    
    /* Ensure cards and content have proper spacing */
    .card,
    .service-card,
    .portfolio-card,
    .blog-card {
        margin-bottom: 1.5rem !important;
    }
    
    /* Fix any overlapping content */
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Ensure text is readable */
    .display-1,
    .display-2,
    .display-3,
    .display-4 {
        margin-top: 1rem !important;
        margin-bottom: 1rem !important;
    }
}

/* EMERGENCY CONTENT VISIBILITY FIX */
@media (max-width: 991px) {
    /* If content is still cut off, add emergency spacing */
    main {
        min-height: calc(100vh - 80px) !important;
        padding-top: 1rem !important;
    }
    
    /* Ensure first element in main is visible */
    main > *:first-child {
        margin-top: 0 !important;
        padding-top: 1rem !important;
    }
    
    /* Fix hero sections specifically */
    main.main-no-padding > *:first-child {
        padding-top: 0 !important;
    }
}

/* FLOATING ELEMENTS ADJUSTMENT */
@media (max-width: 991px) {
    .floating-actions {
        bottom: 20px !important;
        right: 15px !important;
    }
    
    .floating-btn {
        width: 50px !important;
        height: 50px !important;
        font-size: 18px !important;
    }
}

/* MODAL ADJUSTMENTS FOR MOBILE */
@media (max-width: 991px) {
    .modal-dialog {
        margin: 1rem !important;
    }
    
    .modal-lg {
        max-width: calc(100% - 2rem) !important;
    }
}