/* Removed - using container-fluid full-width settings instead */

/* Ensure navbar clears top banner height when banner is present - Desktop only */
@media (min-width: 992px) {
    body.has-top-banner #ftco-navbar {
        margin-top: 44px;
    }
    /* Remove the gap when navbar becomes fixed on scroll */
    body.has-top-banner #ftco-navbar.ftco-navbar-light.scrolled,
    body.has-top-banner #ftco-navbar.ftco-navbar-light.awake {
        margin-top: 0 !important;
    }
}

/* Mobile: no margin since banner is relative (not fixed) */
@media (max-width: 991.98px) {
    body.has-top-banner #ftco-navbar {
        margin-top: 0 !important;
    }
}
/* Custom styles for boxed layout header */

/* Logo styles */
.navbar-logo {
    height: 55px; /* Maximized height */
    width: auto;
    object-fit: contain;
    vertical-align: middle;
    margin: -8px 0; /* Adjusted negative margin to fit larger size */
}

.navbar-brand {
    padding: 5px 0;
    display: flex;
    align-items: center;
    height: 60px; /* Maintaining original header height */
    margin-right: 25px; /* Added space after logo */
    gap: 15px; /* Space between logo and text */
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.brand-title {
    font-family: 'Times New Roman', Times, serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 2px;
    width: 100%;
}

.brand-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    line-height: 1;
    letter-spacing: 1px;
    text-transform: uppercase;
    width: 100%;
    text-align: center;
}

/* FAQ Section Styles */
#faq-section .card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#faq-section .card-header {
    background: none;
    border-bottom: none;
    padding: 1rem;
}

#faq-section .btn-link {
    color: #000;
    font-weight: 600;
    text-decoration: none;
    padding: 0;
    width: 100%;
    text-align: left;
    position: relative;
    padding-right: 20px;
}

#faq-section .btn-link:hover,
#faq-section .btn-link:focus {
    color: #007bff;
    text-decoration: none;
}

#faq-section .card-body {
    padding: 0 1rem 1rem 1rem;
    color: #666;
    line-height: 1.6;
}

#faq-section .btn-link.collapsed::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
}

#faq-section .btn-link:not(.collapsed)::after {
    content: '-';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
}

.navbar-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Mobile-specific adjustments */
@media (max-width: 991.98px) {
    .site-top-banner {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        /* Remove fixed positioning to prevent Safari scroll interference */
        transform: none !important;
    }
}

/* Main background color and texture */
html, body {
    overflow-x: hidden;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: #F0F4F8;
    background-image: 
        linear-gradient(30deg, #E6EDF3 12%, transparent 12.5%, transparent 87%, #E6EDF3 87.5%, #E6EDF3),
        linear-gradient(150deg, #E6EDF3 12%, transparent 12.5%, transparent 87%, #E6EDF3 87.5%, #E6EDF3),
        linear-gradient(30deg, #E6EDF3 12%, transparent 12.5%, transparent 87%, #E6EDF3 87.5%, #E6EDF3),
        linear-gradient(150deg, #E6EDF3 12%, transparent 12.5%, transparent 87%, #E6EDF3 87.5%, #E6EDF3),
        linear-gradient(60deg, #E6EDF377 25%, transparent 25.5%, transparent 75%, #E6EDF377 75%, #E6EDF377),
        linear-gradient(60deg, #E6EDF377 25%, transparent 25.5%, transparent 75%, #E6EDF377 75%, #E6EDF377);
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;
    color: #ffffff;
}

/* Services section styles */
#services-section.ftco-section {
    background-color: #0B2340 !important;
    position: relative;
}

#services-section.ftco-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 100%);
    z-index: 1;
}

#services-section .container {
    position: relative;
    z-index: 2;
}

#services-section .services.d-block {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 550px;
    display: flex;
    flex-direction: column;
}

#services-section .media-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#services-section .services.d-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

#services-section .icon {
    background: linear-gradient(135deg, #C4A76C, #D4B77C) !important;
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

#services-section .services.d-block:hover .icon {
    transform: rotate(0deg);
}

#services-section .heading {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
}

#services-section .media-body {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#services-section .media-body p {
    flex: 1;
    margin: 1rem 0;
    line-height: 1.6;
    color: #666;
    max-width: 90%;
}

#services-section .heading {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 1.5rem 0 0.5rem 0;
}

#services-section .icon {
    margin: 0 auto;
    width: 70px;
    height: 70px;
    border-radius: 50%;
}

#services-section .services.d-block {
    position: relative;
    overflow: hidden;
    border: none;
    box-shadow: none;
}

#services-section .services.d-block:hover {
    box-shadow: none;
}

#services-section .services.d-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(255,255,255,1) 0%,
        rgba(255,255,255,1) 35%,
        rgba(255,255,255,0.95) 45%,
        rgba(255,255,255,0.8) 55%,
        rgba(255,255,255,0) 65%,
        rgba(0,0,0,0.05) 100%
    );
    z-index: 1;
    pointer-events: none;
}

#services-section .service-img {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 45%;
    z-index: 0;
    margin: 0;
    padding: 0;
    font-size: 0;
    line-height: 0;
    border: none;
    border-radius: 0;
}

#services-section .service-img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(255,255,255,1) 0%,
        rgba(255,255,255,0.9) 20%,
        rgba(255,255,255,0.1) 100%
    );
    z-index: 2;
}

#services-section .service-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
}

#services-section .media-body {
    position: relative;
    z-index: 2;
    background: transparent;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#services-section .icon {
    position: relative;
    z-index: 2;
}

#services-section .media-body h3 {
    margin-bottom: 1rem;
    height: 50px;
    display: flex;
    align-items: center;
}

#services-section .media-body p {
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 4.5em;
    line-height: 1.5;
}

/* About section styles */
#about-section {
    padding-top: 6rem !important;
    background-color: #0B2340 !important;
}

#about-section p {
    color: rgba(255,255,255,0.9) !important;
}

#about-section .subheading {
    color: #C4A76C !important;
}

#about-section h2 {
    color: #ffffff !important;
}

/* Hero section styles */
.hero .subheading,
.hero h1,
.hero .text {
    color: #ffffff !important;
}
.hero .slider-item {
    position: relative;
    min-height: 100vh; /* Fallback */
    min-height: -webkit-fill-available; /* iOS Safari */
    min-height: 100dvh; /* Dynamic viewport */
}

/* Mobile hero full height adjustment */
@media (max-width: 767.98px) {
    body {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .hero,
    .hero .slider-item {
        min-height: 100vh !important; /* Fallback */
        min-height: -webkit-fill-available !important; /* iOS Safari */
        min-height: 100dvh !important; /* Dynamic viewport */
        height: 100vh !important; /* Fallback */
        height: -webkit-fill-available !important; /* iOS Safari */
        height: 100dvh !important; /* Dynamic viewport */
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .hero .home-slider,
    .hero .owl-carousel {
        min-height: 100vh !important; /* Fallback */
        min-height: -webkit-fill-available !important; /* iOS Safari */
        min-height: 100dvh !important; /* Dynamic viewport */
        height: 100vh !important; /* Fallback */
        height: -webkit-fill-available !important; /* iOS Safari */
        height: 100dvh !important; /* Dynamic viewport */
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        flex: 1 !important;
    }
    
    .hero .owl-stage-outer,
    .hero .owl-stage,
    .hero .owl-item {
        min-height: 100vh !important; /* Fallback */
        min-height: -webkit-fill-available !important; /* iOS Safari */
        min-height: 100dvh !important; /* Dynamic viewport */
        height: 100vh !important; /* Fallback */
        height: -webkit-fill-available !important; /* iOS Safari */
        height: 100dvh !important; /* Dynamic viewport */
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .hero .container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important; /* Fallback */
        min-height: -webkit-fill-available !important; /* iOS Safari */
        min-height: 100dvh !important; /* Dynamic viewport */
        height: 100vh !important; /* Fallback */
        height: -webkit-fill-available !important; /* iOS Safari */
        height: 100dvh !important; /* Dynamic viewport */
    }
    
    .hero .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        min-height: 100vh !important; /* Fallback */
        min-height: -webkit-fill-available !important; /* iOS Safari */
        min-height: 100dvh !important; /* Dynamic viewport */
        height: 100vh !important; /* Fallback */
        height: -webkit-fill-available !important; /* iOS Safari */
        height: 100dvh !important; /* Dynamic viewport */
    }
    
    .hero .one-forth {
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .hero .one-third.img {
        height: 100% !important;
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
    }
    
    #home-section {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important; /* Fallback */
        min-height: -webkit-fill-available !important; /* iOS Safari */
        min-height: 100dvh !important; /* Dynamic viewport */
        height: 100vh !important; /* Fallback */
        height: -webkit-fill-available !important; /* iOS Safari */
        height: 100dvh !important; /* Dynamic viewport */
    }
    
	/* Ensure next section starts immediately after hero */
	#services-section {
		margin-top: 0 !important;
		/* Disable scroll snap on sections */
		scroll-snap-align: none !important;
	}
	
	/* Disable scroll snap for all sections on mobile */
	section, .ftco-section {
		scroll-snap-align: none !important;
		scroll-snap-stop: normal !important;
	}
}

.hero .one-third.img {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    left: 0;
    top: 0;
    background-size: cover !important;
    background-position: center !important;
}

.hero .one-third.img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, 
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    z-index: 1;
}


.hero .slider-text {
    position: relative;
    z-index: 2;
}

/* Adjust text colors for better contrast on dark background */
h1, h2, h3, h4, h5, h6, p, .nav-link span {
    color: #ffffff !important;
}

/* Keep specific sections with white background */
.media.services, 
.contact-form,
#faq-section .card {
    background: #ffffff !important;
    color: #333333;
}

/* Adjust section backgrounds */
.ftco-section:not(.bg-primary) {
    background-color: transparent !important;
}

.site-top-banner {
    background-color: #041627 !important;
    color: #ffffff !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    width: 100%;
    max-width: 100%;
}

/* Override Bootstrap container inside top banner */
.site-top-banner .container {
    width: 100%;
    max-width: 100%;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0;
}

/* Remove Bootstrap row negative margins */
.site-top-banner .row {
    margin-left: 0;
    margin-right: 0;
}

/* Remove column padding for edge-to-edge alignment */
.site-top-banner .col-6 {
    padding-left: 0;
    padding-right: 0;
}

/* Alert bar button styles */
.site-top-banner .btn {
    background-color: #C4A76C !important;
    border-color: #C4A76C !important;
    color: #000000 !important;
    transition: all 0.3s ease !important;
}

.site-top-banner .btn:hover {
    background-color: #B89B60 !important;
    border-color: #B89B60 !important;
    transform: translateY(-1px) !important;
}

#ftco-navbar {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: #0B2340 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Full-width navbar content with minimal padding */
#ftco-navbar .container-fluid {
    width: 100%;
    max-width: 100%;
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin: 0;
}

/* Ensure header stays dark blue in all states */
.ftco_navbar.bg-dark {
    background: #0B2340 !important;
}

/* Prevent navbar from sticking */
.ftco-navbar-light.scrolled,
.ftco-navbar-light.awake,
.ftco-navbar-light.sleep {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    background: #0B2340 !important;
}

.navbar-dark.ftco-navbar-light {
    background: #0B2340 !important;
}

/* Adjust nav text colors */
.navbar-brand .brand-title {
    color: #ffffff !important;
}

.navbar-brand .brand-subtitle {
    color: rgba(255,255,255,0.8) !important;
}

.navbar-nav .nav-item .nav-link span {
    color: #ffffff !important;
}

.navbar-nav .nav-item .nav-link:hover span {
    color: #C4A76C !important;
}

/* Warm gold accents */
.brand-subtitle,
.subheading,
.btn-primary,
.section-title span,
h2 span,
.nav-item.active .nav-link span {
    color: #C4A76C !important;
}

.btn-primary, 
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn,
.btn:hover,
.btn:focus,
.btn:active {
    color: #000000 !important;
}

.btn-primary {
    background-color: #C4A76C !important;
    border-color: #C4A76C !important;
}

.btn-primary:hover {
    background-color: #B89B60 !important;
    border-color: #B89B60 !important;
}

/* Adjust mobile menu colors */
@media (max-width: 991.98px) {
    .navbar-nav .nav-item .nav-link {
        color: #ffffff !important;
    }
    
    .navbar-nav .nav-item .nav-link span {
        color: #ffffff !important;
    }

    .hamburger-icon span {
        background-color: #ffffff !important;
    }
}

/* Mobile navigation text color */
@media (max-width: 991.98px) {
    .navbar-nav .nav-item {
        padding: 10px 0;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .navbar-nav .nav-item:last-child {
        border-bottom: none;
    }

    .navbar-nav .nav-item .nav-link {
        color: #000 !important;
        font-weight: 500;
        font-size: 16px;
        transition: opacity 0.3s ease;
    }
    
    .navbar-nav .nav-item .nav-link span {
        color: #000 !important;
        display: inline-block;
        padding: 5px 0;
    }

    .navbar-nav .nav-item.active .nav-link,
    .navbar-nav .nav-item:hover .nav-link {
        color: #000 !important;
        opacity: 0.7;
    }
}

@media (max-width: 991.98px) {
    .navbar-container {
        max-width: 100%;
        padding: 0;
        margin-bottom: 0 !important;
    }
    
    /* Full width header on mobile */
    .container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    #ftco-navbar {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 0 !important;
        padding: 0;
        position: relative !important;
    }
    
    /* Force navbar to stay relative on mobile - prevent fixed positioning */
    .ftco-navbar-light,
    #ftco-navbar,
    .ftco-navbar-light.scrolled,
    .ftco-navbar-light.awake,
    .ftco-navbar-light.sleep {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        background: #0B2340 !important;
    }
    
    #ftco-navbar .container-fluid {
        margin-bottom: 0 !important;
        padding-right: 50px !important;
    }

    .navbar-brand {
        padding-left: 15px;
    }

    .navbar-toggler {
        margin-right: 15px;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        padding: 10px 15px;
        border: none;
        outline: none !important;
    }

    .hamburger-icon {
        width: 24px;
        height: 18px;
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .hamburger-icon span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: #000;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    /* Animation for hamburger to X */
    .navbar-toggler[aria-expanded="true"] .hamburger-icon span:first-child {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .navbar-toggler[aria-expanded="true"] .hamburger-icon span:nth-child(2) {
        opacity: 0;
    }

    .navbar-toggler[aria-expanded="true"] .hamburger-icon span:last-child {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Adjust logo and text for mobile */
    .navbar-logo {
        height: 45px;
        margin: -4px 0;
    }

    .brand-title {
        font-size: 20px;
    }

    .brand-subtitle {
        font-size: 10px;
    }

    /* FAQ mobile styles */
    #faq-section .card-header {
        padding: 0.75rem;
    }

    #faq-section .btn-link {
        font-size: 15px;
    }

    #faq-section .card-body {
        font-size: 14px;
        padding: 0 0.75rem 0.75rem 0.75rem;
    }

    /* Alert bar mobile text size */
    .site-top-banner {
        font-size: 14px;
    }
}

/* Prevent navbar length change on scroll - cover all scroll states */
.ftco-navbar-light.scrolled,
.ftco-navbar-light.awake,
.ftco-navbar-light.sleep,
.ftco-navbar-light.scrolled.awake,
.ftco-navbar-light.scrolled.sleep {
    padding: 0 !important;
}

/* Ensure container-fluid maintains consistent padding during scroll */
.ftco-navbar-light.scrolled .container-fluid,
.ftco-navbar-light.awake .container-fluid,
.ftco-navbar-light.sleep .container-fluid {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* ==================== LAYOUT SHIFT PREVENTION ==================== */

/* Fix: Services Section - Prevent Layout Shifts */
#services-section .heading-section {
    min-height: 200px;
    opacity: 1 !important;
    visibility: visible !important;
}

#services-section .services.d-block {
    opacity: 1 !important;
    visibility: visible !important;
}

#services-section .col-md-6.col-lg-4 {
    min-height: 430px; /* Reserve space including margins */
}

#services-section .icon {
    margin-top: 0px !important; /* Remove negative margin shift */
}

#services-section .ftco-animate {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

#services-section [data-aos] {
    opacity: 1 !important;
    transform: none !important;
}

/* Fix: About Section - Prevent Layout Shifts */
#about-section .img-wrap {
    min-height: 600px;
    width: 100%;
    max-width: 500px;
}

#about-section .img-wrap img {
    width: 100%;
    height: 600px;
    object-fit: cover;
    display: block;
}

#about-section .ftco-animate {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

#about-section [data-aos] {
    opacity: 1 !important;
    transform: none !important;
}

#about-section {
    padding-top: 6rem !important;
    padding-bottom: 6rem !important;
}

#about-section .col-md-7 {
    min-height: 600px;
}

/* Fix 1: Override fixed hero slider height with responsive height */
.owl-carousel.home-slider,
.owl-carousel.home-slider .slider-item,
.owl-carousel.home-slider .slider-item .slider-text,
.owl-carousel.home-slider .slider-item .slider-text .one-third {
    height: 100vh !important; /* Fallback */
    height: -webkit-fill-available !important; /* iOS Safari */
    height: 100dvh !important; /* Dynamic viewport */
    min-height: 600px !important;
}

@media (max-width: 767.98px) {
    .owl-carousel.home-slider,
    .owl-carousel.home-slider .slider-item,
    .owl-carousel.home-slider .slider-item .slider-text {
        height: 100vh !important; /* Fallback */
        height: -webkit-fill-available !important; /* iOS Safari */
        height: 100dvh !important; /* Dynamic viewport */
        min-height: 100vh !important; /* Fallback */
        min-height: -webkit-fill-available !important; /* iOS Safari */
        min-height: 100dvh !important; /* Dynamic viewport */
    }
}

/* Fix 2: Reserve space for fixed top banner to prevent layout shift */
/* Desktop only - banner is relative on mobile */
@media (min-width: 992px) {
    body.has-top-banner {
        padding-top: 44px;
    }
}

/* Mobile: no padding needed since banner is relative */
@media (max-width: 991.98px) {
    body.has-top-banner {
        padding-top: 0 !important;
    }
}

/* Fix 3: Prevent navbar position changes from causing layout shifts */
.ftco-navbar-light {
    position: relative !important;
    margin-top: 0 !important;
    transition: none !important;
}

.ftco-navbar-light.scrolled {
    position: relative !important;
    top: 0 !important;
    margin-top: 0 !important;
    transition: none !important;
}

/* Fix 4: Prevent hero section shift before carousel initializes */
.hero .home-slider {
    min-height: 100vh; /* Fallback */
    min-height: -webkit-fill-available; /* iOS Safari */
    min-height: 100dvh; /* Dynamic viewport */
    height: 100vh; /* Fallback */
    height: -webkit-fill-available; /* iOS Safari */
    height: 100dvh; /* Dynamic viewport */
}

.hero .slider-item {
    min-height: 100vh; /* Fallback */
    min-height: -webkit-fill-available; /* iOS Safari */
    min-height: 100dvh; /* Dynamic viewport */
}

/* Fix 5: Prevent Scrollax from causing initial layout shifts */
/* Reset Scrollax transforms on mobile since Scrollax is disabled */
@media (max-width: 991.98px) {
    [data-scrollax] {
        transform: none !important;
    }
}

/* Disabled will-change on mobile for better performance */
@media (min-width: 992px) {
    [data-scrollax] {
        will-change: transform;
    }
}

[data-scrollax-parent] {
    overflow: hidden;
}

/* ==================== ADDITIONAL STYLE SHIFT PREVENTION ==================== */

/* Fix 1: Stabilize Animation Entry States */
.ftco-animate {
    opacity: 1;
    visibility: visible;
}

/* Only hide elements waiting for animation on desktop */
@media (min-width: 992px) {
    .ftco-animate:not(.ftco-animated) {
        opacity: 0;
        visibility: hidden;
    }
}

/* Reserve space for animated elements - Desktop only */
@media (min-width: 992px) {
    .ftco-animate.fadeInUp:not(.ftco-animated) {
        transform: translateY(0);
        opacity: 0;
    }
}

/* Fix 2: Smooth Loader Transition */
#ftco-loader {
    opacity: 1;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

#ftco-loader:not(.show) {
    opacity: 0;
    visibility: hidden;
}

/* Fix 3: FAQ Accordion Smooth Transitions */
#faq-section .collapse {
    transition: height 0.35s ease;
}

#faq-section .collapsing {
    transition: height 0.35s ease;
}

/* Fix 4: Navbar Collapse Smooth Transition */
.navbar-collapse {
    transition: height 0.35s ease;
}

.navbar-collapse.collapsing {
    transition: height 0.35s ease;
}

/* Fix 5: Add Will-Change Hints for Performance - Desktop Only */
@media (min-width: 992px) {
    .ftco-animate,
    [data-scrollax],
    .owl-carousel {
        will-change: transform, opacity;
    }
}

/* Remove will-change after animation completes */
.ftco-animated {
    will-change: auto;
}

/* Fix 6: Reserve Space for Dynamic Content */
/* Testimonial carousel minimum height */
.carousel-testimony {
    min-height: 350px;
}

/* Service cards consistent height already set at 400px in services section */

/* Prevent Bootstrap carousel shift - Desktop Only */
@media (min-width: 992px) {
    .owl-stage-outer {
        will-change: transform;
    }
}

/* Stable base for parallax elements */
.hero .slider-text {
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Fix 7: Prevent Image Loading Shifts */
img {
    max-width: 100%;
    height: auto;
}

/* Ensure images don't cause layout shift */
img:not([width]):not([height]) {
    aspect-ratio: attr(width) / attr(height);
}

/* Fix 8: Font Loading Optimization */
/* Prevent FOUT (Flash of Unstyled Text) */
body {
    font-display: swap;
}

/* Fix 9: Prevent Hover/Focus Shifts */
/* Ensure hover effects don't shift layout */
.btn,
.nav-link,
a {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

/* Prevent transform shifts on hover */
.btn:hover,
.btn:focus {
    transform: translateY(-2px);
}

/* Fix 10: Stable Contact Form */
.contact-form {
    min-height: 500px;
}

.contact-form .form-control {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Fix 11: Prevent Testimonial Carousel Shift */
.testimony-wrap {
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.testimony-wrap .text {
    flex: 1;
}

/* Fix 12: About Section Image Stability */
.ftco-about .img-wrap {
    min-height: 600px;
}

/* Fix 13: Prevent Icon Shifts */
.icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Fix 14: Footer Stability */
.ftco-footer {
    min-height: 300px;
}

/* Fix 15: Smooth Scrolling Without Shifts - Desktop Only */
/* DISABLED: Conflicts with jQuery scroll animation in main.js */
/* Using jQuery .animate() for scroll instead for better control and offset handling */
@media (min-width: 992px) {
    html {
        /* scroll-behavior: smooth; */ /* Removed to prevent conflict with jQuery animation */
    }
}

/* Allow browser to maintain scroll position on mobile */
/* REMOVED: overflow-anchor: none - this was causing scroll jumps on mobile */

/* Mobile scroll stability fixes - Prevent auto-scrolling */
@media (max-width: 991.98px) {
    html {
        scroll-behavior: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        /* Disable scroll snap on mobile */
        scroll-snap-type: none !important;
        -webkit-scroll-snap-type: none !important;
        /* Prevent Safari address bar from affecting layout */
        position: relative;
        overflow-x: hidden;
    }
    
    body {
        scroll-behavior: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        /* Disable scroll snap on mobile */
        scroll-snap-type: none !important;
        -webkit-scroll-snap-type: none !important;
        /* Prevent Safari address bar scroll interference */
        position: relative;
        overflow-x: hidden;
        /* Prevent address bar resize from causing scroll */
        width: 100%;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        min-height: 100dvh;
    }
    
    /* Prevent scroll interference from position changes */
    .ftco_navbar.scrolled,
    .ftco_navbar.awake {
        transition: none !important;
    }
    
    /* Disable scroll snap for all sections on mobile */
    section {
        scroll-snap-align: none !important;
        scroll-snap-stop: normal !important;
        -webkit-scroll-snap-align: none !important;
        -webkit-scroll-snap-stop: normal !important;
    }
    
    /* Ensure no scroll snap container behavior */
    * {
        scroll-snap-type: none !important;
        -webkit-scroll-snap-type: none !important;
    }
    
    /* Specifically disable scroll snap on hero and main sections */
    .hero, #home-section, .ftco-section {
        scroll-snap-type: none !important;
        scroll-snap-align: none !important;
        -webkit-scroll-snap-type: none !important;
        -webkit-scroll-snap-align: none !important;
    }
    
    /* Disable scroll snap on carousel/slider elements */
    .owl-carousel, .slider-item, .home-slider {
        scroll-snap-type: none !important;
        scroll-snap-align: none !important;
        -webkit-scroll-snap-type: none !important;
        -webkit-scroll-snap-align: none !important;
    }
    
    /* Prevent Safari address bar from affecting fixed elements */
    /* Note: .site-top-banner is relative on mobile, not fixed */
    #ftco-navbar,
    .navbar-container {
        /* Stabilize elements during Safari chrome changes */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    /* Stabilize hero section during address bar changes */
    .hero,
    #home-section {
        /* Prevent Safari address bar from triggering reflow */
        will-change: auto;
        contain: layout paint;
        isolation: isolate;
    }
    
    /* Prevent layout shift when address bar appears/disappears */
    .ftco-section {
        /* Use containment to prevent reflow */
        contain: layout style paint;
    }
}

/* Fix 16: Mobile Menu Stability */
@media (max-width: 991.98px) {
    .navbar-collapse {
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent mobile menu from shifting content */
    .navbar-collapse.show,
    .navbar-collapse.collapsing {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #0B2340;
        z-index: 1000;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
}

/* Fix 17: Prevent Section Background Shifts */
.ftco-section {
    position: relative;
    overflow: hidden;
}

/* Fix 18: Stable Service Cards */
#services-section .services.d-block {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Fix 19: Prevent Text Reflow */
p, h1, h2, h3, h4, h5, h6, span {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fix 20: GPU Acceleration for Smooth Animations - Desktop Only */
@media (min-width: 992px) {
    .ftco-animate,
    .owl-carousel,
    .hero {
        transform: translateZ(0);
        backface-visibility: hidden;
    }
}

