/********** Template CSS **********/

/* =======================================================
   1. GLOBAL VARIABLES & BASE STYLES
   ======================================================= */
:root {
    /* Main */
    --primary: #0f4c81;
    --secondary: #38bdf8;

    /* Typography */
    --heading: #0f172a;
    --text: #475569;

    /* Links */
    --link: var(--primary);
    --link-hover: var(--secondary);

    /* Buttons */
    --button: var(--primary);
    --button-hover: var(--secondary);

    /* Layout */
    --navbar: #ffffff;
    --footer: #0f172a;

    /* Existing variables */
    --light: #f8fafc;
    --dark: #0f172a;

    --overlay: rgba(15, 23, 42, 0.65);
    --overlay-soft: rgba(15, 76, 129, 0.72);

    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 0 45px rgba(0, 0, 0, 0.08);

    --border-light: rgba(255, 255, 255, 0.08);
}

body {
    color: var(--text) !important;
}

h1,
.h1,
h2,
.h2,
.fw-bold,
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--heading) !important;
}

h1,
.h1,
h2,
.h2,
.fw-bold {
    font-weight: 700 !important;
}

h3,
.h3,
h4,
.h4,
.fw-medium {
    font-weight: 600 !important;
}

h5,
.h5,
h6,
.h6,
.fw-semi-bold {
    font-weight: 500 !important;
}

a {
    color: var(--link);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover);
}

.back-to-top {
    position: fixed;
    display: none;
    right: 30px;
    bottom: 30px;
    z-index: 99;
}

/* ==========================================================================
   2. MINIMUM VIEWPORT STRETCH ENGINE (ELIMINATES BOTTOM WHITE GAP)
   ========================================================================== */
html {
    height: 100% !important;
    background-color: #111827 !important;
    scroll-behavior: auto !important;
    overflow-x: hidden;
}

body {
    min-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #ffffff;
    position: relative;
    width: 100%;
}

#page,
.site,
#wrapper {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 0 auto !important;
    width: 100%;
}

main,
#content,
.site-content {
    flex: 1 0 auto !important;
}

footer,
.site-footer,
.footer-container {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

#spinner {
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.5s ease-out,
        visibility 0s linear 0.5s;
    z-index: 99999;
}

#spinner.show {
    transition:
        opacity 0.5s ease-out,
        visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}

/* ==========================================================================
   3. BUTTONS GLOBAL
   ========================================================================== */
.btn {
    transition: 0.5s;
    font-weight: 500;
}

.btn-primary,
.btn-outline-primary:hover {
    color: var(--light) !important;
}

.btn-primary,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:visited,
.show > .btn-primary.dropdown-toggle {
    background: var(--button) !important;
    border-color: var(--button) !important;
    color: var(--light) !important;
}

.btn-primary:hover {
    background: var(--button-hover) !important;
    border-color: var(--button-hover) !important;
    color: var(--light) !important;
}

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-outline-primary:hover {
    background: var(--primary) !important;
    color: var(--light) !important;
}

.btn-square {
    width: 38px;
    height: 38px;
}
.btn-sm-square {
    width: 32px;
    height: 32px;
}
.btn-lg-square {
    width: 48px;
    height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}

/* ==========================================================================
   4. NAVIGATION & STICKY HEADER LAYERS
   ========================================================================== */
#site-navigation {
    position: relative;
    width: 100%;
    background: var(--navbar) !important;
    z-index: 1000 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
}

#site-navigation.sticky-nav-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05) !important;
    animation: slideDown 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

#site-navigation .navbar-nav .nav-link {
    color: var(--text) !important;
    font-weight: 600 !important;
    font-size: 0.95rem;
    padding: 0.5rem 1.1rem !important;
}

#site-navigation .navbar-nav .nav-item.active > .nav-link,
#site-navigation .navbar-nav .nav-link:hover {
    color: var(--primary) !important;
}

#site-navigation .dropdown-menu {
    background: var(--light) !important;
}

#site-navigation .dropdown-item {
    padding: 0.6rem 1.25rem !important;
    color: var(--text) !important;
    font-weight: 500 !important;
    font-size: 0.9rem;
    background: transparent !important;
    border-radius: 4px;
    transition: all 0.15s ease;
}

#site-navigation .dropdown-item:hover {
    color: var(--primary) !important;
    background-color: #f8fafc !important;
}

header .container-fluid.bg-dark {
    background-color: var(--dark) !important;
}
header .container-fluid.bg-dark span {
    color: var(--light) !important;
}

/* Desktop Navigation Extensions */
@media (min-width: 992px) {
    #site-navigation .navbar-nav li {
        position: relative !important;
    }

    #site-navigation .navbar-nav .dropdown-menu {
        opacity: 0;
        visibility: hidden;
        position: absolute !important;
        min-width: 240px;
        padding: 0.75rem !important;
        border: 1px solid rgba(15, 23, 42, 0.06) !important;
        border-radius: 8px !important;
        box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08) !important;
        transition:
            opacity 0.18s ease,
            transform 0.18s ease,
            visibility 0.18s ease !important;
        display: block !important;
    }

    #site-navigation .navbar-nav > li > .dropdown-menu {
        top: 100% !important;
        left: 0 !important;
        transform: translateY(8px);
    }

    #site-navigation .navbar-nav > li:hover > .dropdown-menu {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }

    #site-navigation .navbar-nav .dropdown-menu li > .dropdown-menu {
        top: -8px !important;
        left: 100% !important;
        right: auto !important;
        margin-left: 8px !important;
        margin-right: 0 !important;
        transform: translateX(8px) !important;
    }

    #site-navigation .navbar-nav .dropdown-menu li:hover > .dropdown-menu {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateX(0) !important;
    }

    #site-navigation .navbar-nav .dropdown-menu li.edge-flip > .dropdown-menu {
        left: auto !important;
        right: 100% !important;
        margin-left: 0 !important;
        margin-right: 8px !important;
        transform: translateX(-8px) !important;
    }
}

/* Responsive Mobile Framework overrides */
@media (max-width: 991.98px) {
    header .container-fluid.bg-dark {
        display: none !important;
    }

    #navbarCollapse {
        display: none;
        position: absolute;
        top: 100%;
        left: 16px;
        right: 16px;
        width: calc(100% - 32px);
        max-height: 75vh;
        background-color: #ffffff !important;
        border: 1px solid rgba(15, 23, 42, 0.06) !important;
        border-radius: 12px !important;
        box-shadow: 0 15px 35px -5px rgba(15, 23, 42, 0.12) !important;
        padding: 1.25rem !important;
        overflow-y: auto;
        margin-top: 10px;
        z-index: 999999 !important;
    }

    #navbarCollapse.show {
        display: block !important;
    }

    #navbarCollapse .nav-item,
    #navbarCollapse li {
        margin-bottom: 0.25rem;
        width: 100%;
        list-style: none !important;
    }

    #navbarCollapse .nav-link,
    #navbarCollapse .dropdown-item {
        font-size: 1.05rem !important;
        font-weight: 600 !important;
        color: #334155 !important;
        padding: 0.65rem 1rem !important;
        border-radius: 6px;
        display: block;
    }

    #navbarCollapse .dropdown-menu {
        display: none !important;
        position: relative !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        background-color: transparent !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
    }

    #navbarCollapse li.open-mobile-card > .dropdown-menu {
        display: block !important;
    }

    #navbarCollapse .navbar-nav > li > .dropdown-menu {
        margin: 0.25rem 0 0.5rem 0 !important;
        padding-left: 1rem !important;
        border-left: 2px solid rgba(15, 23, 42, 0.06) !important;
    }

    #navbarCollapse .dropdown-menu li > .dropdown-menu {
        margin: 0.5rem 0 0.5rem 0.5rem !important;
        background-color: #f8fafc !important;
        border: 1px solid rgba(15, 23, 42, 0.05) !important;
        border-radius: 6px !important;
        padding: 0.5rem !important;
    }

    #navbarCollapse .dropdown-menu .dropdown-menu li > .dropdown-menu {
        margin: 0.5rem 0 0 0.5rem !important;
        background-color: #ffffff !important;
        border: 1px solid rgba(15, 23, 42, 0.08) !important;
        border-radius: 6px !important;
        padding: 0.5rem !important;
    }
}

/* =======================================================
   5. HERO CAROUSEL LAYERS (PURE WINDOW PARALLAX ENGINE)
   ======================================================= */
#header-carousel,
.hero-carousel {
    height: calc(100vh - 76px) !important;
    overflow: hidden;
    position: relative;
    background-color: #0f172a;
    z-index: 1;
    clip-path: inset(0 0 0 0);
    -webkit-clip-path: inset(0 0 0 0);
}

.carousel-item,
.hero-slide {
    position: relative;
    height: calc(100vh - 76px) !important;
    overflow: hidden;
}

.hero-image-wrapper {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: var(--bg-image);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    z-index: 1;
    transform: none !important;
    will-change: auto;
}

.carousel-caption {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--overlay) !important;
    z-index: 2;
    transition: background 0.2s ease-out;
}

.carousel-caption .container {
    will-change: filter, opacity, transform;
    transform: translate3d(0, var(--text-y, 0px), 0) !important;
    backface-visibility: hidden;
}

.carousel-caption h1,
.carousel-caption a {
    opacity: 0;
    filter: blur(10px);
}

.hero-slide.active .carousel-caption h1 {
    animation: heroText 1s ease forwards;
}

.hero-slide.active .carousel-caption a {
    animation: heroText 1.2s ease forwards;
    animation-delay: 0.2s;
}

@keyframes heroText {
    0% {
        opacity: 0;
        transform: translateY(40px);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.carousel-control-prev,
.carousel-control-next {
    width: 10%;
    z-index: 5;
}

/* Mobile Safari Dynamic-Viewport normalization updates */
@media (max-width: 991.98px) {
    #header-carousel,
    .hero-carousel,
    .carousel-item,
    .hero-slide {
        /* dvh accounts for mobile browser address bars dynamically */
        height: 60dvh !important; 
    }
    
    .hero-image-wrapper {
        /* Force position fixed back on, but optimize height calculation */
        position: fixed !important; 
        height: 100dvh !important;
        top: 0;
        left: 0;
        width: 100%;
        /* Prevents the mobile browser from dropping rendering frames */
        will-change: transform;
        transform: translateZ(0);
    }
}

/* =======================================================
   6. SECTIONS & CONTENT MODULES
   ======================================================= */
/*** Top Feature ***/
@media (min-width: 991.98px) {
    .top-feature {
        position: relative;
        margin-top: -80px;
        z-index: 10;
    }
}

/*** Facts & Quote ***/
.facts,
.quote {
    background: var(--overlay-soft) !important;
}

/*** Service Grid Items ***/
.service-item {
    position: relative;
    text-align: center;
}

.service-item .service-img {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: -1;
}

.service-item .service-img img {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    object-fit: cover;
    transform: scale(1.2);
    transition: 0.3s;
    z-index: -1;
}

.service-item:hover .service-img img {
    transform: scale(1);
}

.service-item .service-text {
    background: var(--light) !important;
    box-shadow: var(--shadow-card) !important;
    transition: 0.3s;
}

.service-item:hover .service-text {
    background: var(--overlay-soft) !important;
}

.service-item .service-text h4,
.service-item .service-text p {
    transition: 0.3s;
}

.service-item:hover .service-text h4 {
    color: var(--light);
}

.service-item:hover .service-text p {
    color: var(--light);
}

.service-item .service-text .btn-square {
    width: 100px;
    height: 100px;
    background: transparent;
    transition: 0.5s;
}

.service-item:hover .service-text .btn-square {
    background: var(--light);
}

.service-item .service-text .btn {
    width: 31px;
    height: 31px;
    display: inline-flex;
    align-items: center;
    color: var(--dark);
    background: var(--light);
    white-space: nowrap;
    overflow: hidden;
    transition: 0.3s;
}

.service-item:hover .service-text .btn {
    width: 112px;
}

/*** Project Portfolio ***/
#portfolio-flters {
    display: inline-block;
    background: var(--light);
    padding: 10px 15px;
}

#portfolio-flters li {
    display: inline-block;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    transition: 0.5s;
    border-bottom: 2px solid transparent;
}

#portfolio-flters li:hover,
#portfolio-flters li.active {
    color: var(--dark);
    border-color: var(--dark);
}

.portfolio-inner {
    position: relative;
    overflow: hidden;
}

.portfolio-inner::before,
.portfolio-inner::after {
    position: absolute;
    content: "";
    width: 0;
    height: 100%;
    top: 0;
    left: 0;
    background: var(--overlay-soft) !important;
    transition: 0.5s;
}

.portfolio-inner::after {
    left: auto;
    right: 0;
}

.portfolio-inner:hover::before,
.portfolio-inner:hover::after {
    width: 50%;
}

.portfolio-inner .portfolio-text {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.5s;
    z-index: 3;
    opacity: 0;
}

.portfolio-inner:hover .portfolio-text {
    transition-delay: 0.3s;
    opacity: 1;
}

.portfolio-inner .portfolio-text .btn {
    background: var(--light);
    color: var(--primary);
}

.portfolio-inner .portfolio-text .btn:hover {
    background: var(--primary);
    color: var(--light);
}

/*** Team ***/
.team-item {
    position: relative;
    overflow: hidden;
}

.team-item .team-text {
    position: absolute;
    width: calc(100% - 45px);
    left: -100%;
    bottom: 45px;
    padding: 1.5rem;
    background: var(--light) !important;
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: 0.5s;
}

.team-item:hover .team-text {
    left: 0;
    opacity: 1;
}

.team-item .team-social .btn {
    background: var(--light);
    color: var(--primary);
}

.team-item .team-social .btn:hover {
    background: var(--primary);
    color: var(--light);
}

.team-item .team-img .team-social {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.5s;
    z-index: 3;
    opacity: 0;
}

.team-item:hover .team-img .team-social {
    transition-delay: 0.3s;
    opacity: 1;
}

/*** Testimonial ***/
.testimonial-carousel .owl-item img {
    width: 100px;
    height: 100px;
}

.testimonial-carousel .owl-nav {
    margin-top: 30px;
    display: flex;
}

.testimonial-carousel .owl-nav .owl-prev,
.testimonial-carousel .owl-nav .owl-next {
    margin-right: 15px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary) !important;
    background: var(--light) !important;
    border-radius: 4px;
    font-size: 22px;
    transition: 0.5s;
}

.testimonial-carousel .owl-nav .owl-prev:hover,
.testimonial-carousel .owl-nav .owl-next:hover {
    background: var(--primary) !important;
    color: var(--light) !important;
}

/* =======================================================
   7. FOOTER SYSTEM
   ======================================================= */
.footer,
footer,
[class*="footer"] {
    background: var(--footer) !important;
    color: var(--light) !important;
}

.footer h1,
.footer h2,
.footer h3,
.footer h4,
.footer h5,
.footer h6,
footer h1,
footer h2,
footer h3,
footer h4,
footer h5,
footer h6 {
    color: var(--light) !important;
}

.footer .btn.btn-link {
    display: block;
    margin-bottom: 5px;
    padding: 0;
    text-align: left;
    color: var(--light);
    font-weight: normal;
    text-transform: capitalize;
    transition: 0.3s;
}

.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 10px;
}

.footer .btn.btn-link:hover {
    color: var(--primary) !important;
    letter-spacing: 1px;
    box-shadow: none;
}

.copyright {
    color: var(--light) !important;
    background: var(--footer) !important;
    border-top: 1px solid var(--border-light);
}

.copyright a {
    color: var(--light);
}

.copyright a:hover {
    color: var(--primary);
}

/* =======================================================
   8. UTILITIES & HELPER CLASSES
   ======================================================= */
.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background: var(--primary) !important;
}
/* ==========================================================================
   REVISED PAGE BANNER PARALLAX ENGINE (BOOTSTRAP OVERRIDE FIX)
   ========================================================================== */
.page-header {
    position: relative;
    overflow: hidden;
    background-color: #0f172a;
    z-index: 1;
    
    /* Strict Flex Matrix */
    display: flex !important;
    align-items: center !important;     /* Locks vertical center axis */
    justify-content: center !important; /* Locks horizontal center axis */
    
    min-height: 380px; /* Explicit structural thickness */
    margin-bottom: 3rem;
    padding: 0 !important; /* Clear all generic utility class padding entries */
    
    /* Hardware viewport clipping mask */
    clip-path: inset(0 0 0 0);
    -webkit-clip-path: inset(0 0 0 0);
}

.page-banner-bg {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: var(--bg-image);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    z-index: 1;
    transform: none !important;
    will-change: auto;
}

.page-banner-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay);
    z-index: 2;
}

.page-banner-content {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: 0 !important; /* Forces structural normalization */
}

/* --- BOOTSTRAP BREADCRUMB ANCHOR CORRECTIONS --- */
.page-header .breadcrumb {
    background: transparent !important; /* Kills Bootstrap's native background fill */
    padding: 0 !important;            /* Kills native padding variance offset */
    margin: 0 !important;             /* Kills the hidden margin pushing text down */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Explicit Color Mapping (Overwrites framework link coloring) */
.page-header .breadcrumb-item,
.page-header .breadcrumb-item a {
    color: var(--secondary) !important;
    text-decoration: none !important;
}

.page-header .breadcrumb-item a:hover {
    color: #ffffff !important;
}

/* Current page active text indicator */
.page-header .breadcrumb-item.active {
    color: #ffffff !important;
}

/* Divider slash symbol coloring match */
.page-header .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ==========================================================================
   MOBILE SAFE ENGINE OVERRIDES
   ========================================================================== */
@media (max-width: 991.98px) {
    .page-header {
        min-height: 280px; 
    }

    .page-banner-bg {
        position: fixed !important;
        height: 100dvh !important;
        top: 0;
        left: 0;
        width: 100%;
        will-change: transform;
        transform: translateZ(0);
    }
}


