/* Critical layout fixes: hero/banner below absolute header, compact top bar */

@media (max-width: 991px) {
    .hero-slider .hero-slider-item .slider-content {
        padding-top: calc(var(--site-header-height, 280px) + 16px) !important;
        padding-bottom: 0 !important;
    }

    .page-banner .page-content {
        padding-top: calc(var(--site-header-height, 280px) + 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;
    }

    .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;
    }

    .top-header .right-info .heder-btn a,
    .top-header .right-info .sign-in-btn a {
        width: auto;
        white-space: nowrap;
    }
}

@media (max-width: 575px) {
    .top-header .right-info li:not(.heder-btn):not(.sign-in-btn) {
        display: none;
    }
}

/* =============================================================================
   Scroll fixes — no horizontal drift, reliable overlay locks, menu inner scroll
   ============================================================================= */

html {
    overflow-x: clip;
    max-width: 100%;
}

body {
    overflow-x: clip;
    max-width: 100%;
}

html.page-scroll-locked,
body.page-scroll-locked,
html.search-open,
body.search-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

@media (max-width: 991px) {
    .atorn-responsive-nav .atorn-responsive-menu.mean-container .navbar-nav {
        height: auto !important;
        max-height: min(70vh, 420px) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .atorn-responsive-nav .mean-container .mean-nav > ul[style*="display: none"] {
        overflow: hidden !important;
        max-height: 0 !important;
    }
}

.hero-slider.owl-carousel,
.partner-slider.owl-carousel,
.testimonials-slider.owl-carousel {
    max-width: 100%;
    overflow: hidden;
}

.hero-slider.owl-carousel .owl-stage-outer,
.partner-slider.owl-carousel .owl-stage-outer,
.testimonials-slider.owl-carousel .owl-stage-outer {
    touch-action: pan-y pinch-zoom;
    overflow: hidden;
}

.footer-enterprise-wrap,
.partner-area,
.page-banner,
.main-content {
    max-width: 100%;
    overflow-x: clip;
}

.preloader.preloader-hidden,
.preloader[style*="display: none"] {
    visibility: hidden !important;
    pointer-events: none !important;
}

@media (max-width: 767px) {
    .go-top {
        right: max(12px, env(safe-area-inset-right, 0px));
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }

    .switch-box {
        right: max(62px, calc(12px + env(safe-area-inset-right, 0px)));
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }
}

/* Attorney profile pages — photo sizing and mobile layout */
.attorney-details .attor-details-item > img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: top center;
    aspect-ratio: 3 / 4;
    max-height: 500px;
}

.attorney-details .col-lg-5 > .attor-details-item {
    max-width: 100%;
}

@media (max-width: 991px) {
    .attorney-details .row.align-items-center > [class*="col-lg-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .attorney-details .attor-details-item > img {
        max-height: 400px;
        margin: 0 auto;
    }

    .attorney-details .attor-details-right {
        margin-top: 0;
    }

    .attorney-details .attor-prev ul {
        display: flex;
        justify-content: space-between;
        gap: 12px;
    }

    .attorney-details .attor-prev ul li {
        float: none !important;
        flex: 1;
    }

    .attorney-details .attor-prev ul li a {
        text-align: center;
    }
}
