/* ═══════════════════════════════════════════════════════════════════════════
   Performance Optimizations
   ═══════════════════════════════════════════════════════════════════════════ */

/* Font smoothing */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent layout shifts from unloaded images */
img {
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
}

/* GPU acceleration for animated elements */
/* will-change on the hero caused occasional 1px edge seams with Owl transforms */
.owl-carousel:not(.hero-slider) {
    will-change: transform;
}

.preloader {
    will-change: opacity;
}

/* Remove tap highlight on interactive elements (mobile perf) */
button, a, .nav-link {
    -webkit-tap-highlight-color: transparent;
}

/* Avoid layout containment on header — it clips the mobile meanmenu dropdown */
.header-area, .navbar-area {
    contain: style;
}

/* GPU-composited layers for card animations (prevents repaints) */
.service-card, .attorney-card, .testimonials-slider-item {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ── Reduce motion for accessibility / battery saving ───────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Font Display Optimization (fonts load without blocking render) */
@font-face {
    font-display: swap;
}

/* ── Layout: hero/page content below absolute header (loads after responsive.css) */
@media (max-width: 991px) {
    .hero-slider .hero-slider-item .slider-content {
        padding-top: calc(var(--site-header-height, 260px) + 16px) !important;
        padding-bottom: 0 !important;
    }

    .page-banner .page-content {
        padding-top: calc(var(--site-header-height, 260px) + 40px) !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .top-header .row > [class*="col"] {
        width: 50%;
        max-width: 50%;
        flex: 0 0 50%;
    }

    .top-header .left-info {
        flex-direction: row;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px 16px;
    }

    .top-header .left-info li {
        width: auto;
        margin-right: 0 !important;
    }

    .top-header .right-info {
        justify-content: flex-end;
        width: auto;
    }

    .top-header .right-info::after {
        display: none;
    }

    .top-header .right-info .heder-btn,
    .top-header .right-info .sign-in-btn {
        flex: 0 0 auto;
        order: 0;
    }

    .top-header .right-info .heder-btn a,
    .top-header .right-info .sign-in-btn a {
        width: auto;
        min-height: 40px;
        padding: 8px 12px !important;
        font-size: 13px;
        white-space: nowrap;
    }
}

@media (max-width: 575px) {
    .top-header .right-info li:not(.heder-btn):not(.sign-in-btn) {
        display: none;
    }
}
