/* Critical Layout Shift Prevention */
main#main-content {
    min-height: 100vh;
    contain: layout style paint;
    transform: translateZ(0);
}

.hero-section {
    contain: layout style paint;
    will-change: auto;
    min-height: 100vh;
}

.carousel-inner {
    contain: layout style paint;
    min-height: 100vh;
}

.carousel-item {
    contain: layout style paint;
    min-height: 100vh;
}

.container.position-relative.h-100 {
    min-height: 600px;
    contain: layout style paint;
    transform: translateZ(0);
}

.row.w-100.align-items-center {
    min-height: 500px;
    contain: layout style paint;
    transform: translateZ(0);
}

.col-lg-5,
.col-lg-7 {
    contain: layout style paint;
    min-height: 300px;
}

.hero-content {
    contain: layout style paint;
    min-height: 400px;
    transform: translateZ(0);
}

.hero-stats {
    contain: layout style paint;
    min-height: 120px;
}

.achievement-badge {
    min-height: 80px;
    contain: layout style paint;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-counter {
    font-variant-numeric: tabular-nums;
    min-width: 60px;
    min-height: 40px;
    text-align: center;
    contain: layout style paint;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn {
    contain: layout style paint;
    min-height: 38px;
    transform: translateZ(0);
}

.btn-lg {
    min-height: 48px;
}

.cta-primary {
    min-height: 56px;
    min-width: 200px;
    contain: layout style paint;
}

/* Floating Elements Stability */
.floating-elements {
    contain: layout style paint;
    pointer-events: none;
    z-index: 5;
}

.float-element {
    position: absolute !important;
    will-change: transform;
    contain: layout style paint;
    pointer-events: none;
    z-index: 5;
}

/* Hero Illustration Stability */
.hero-illustration {
    contain: layout style paint;
    min-height: 200px;
}

.cctv-demo,
.it-services {
    contain: layout style paint;
    min-height: 180px;
}

/* Prevent text reflow */
.display-3 {
    contain: layout style;
    min-height: 120px;
}

.lead {
    contain: layout style;
    min-height: 60px;
}

/* Social proof stability */
.social-proof {
    contain: layout style paint;
    min-height: 40px;
}

/* Button container stability */
.d-flex.flex-column.flex-sm-row.gap-3 {
    contain: layout style paint;
    min-height: 60px;
}

/* Urgency timer stability */
.urgency-timer {
    contain: layout style paint;
    min-height: 40px;
}

/* Carousel controls stability */
.carousel-control-prev,
.carousel-control-next {
    contain: layout style paint;
}

.control-icon {
    contain: layout style paint;
    width: 60px;
    height: 60px;
}

/* Carousel indicators stability */
.carousel-indicators {
    contain: layout style paint;
    min-height: 20px;
}

/* Footer logo optimization */
.footer-logo {
    width: 34px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Prevent font loading shifts */
body {
    font-display: swap;
}

/* Image loading stability */
img {
    height: auto;
    max-width: 100%;
    contain: layout style;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .row.w-100.align-items-center {
        min-height: 400px;
    }
    
    .hero-content {
        min-height: 300px;
    }
    
    .col-lg-5,
    .col-lg-7 {
        min-height: 200px;
    }
}