/*
 * Responsive compatibility layer
 *
 * Keep desktop presentation unchanged. These rules only remove fixed sizing,
 * overflow, and breakpoint conflicts that prevent existing components from
 * adapting to tablet and phone viewports.
 */

html,
body,
#wrapper {
    max-width: 100%;
    overflow-x: hidden;
}

img,
video,
canvas,
svg,
iframe {
    max-width: 100%;
}

img,
video {
    height: auto;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

/*
 * Office search uses jquery-nice-select. Keep long office names inside the
 * control and make large option sets scroll instead of covering the page.
 */
.office-search-select,
.office-search-select .controls,
.office-search-select .nice-select {
    max-width: 100%;
    width: 100% !important;
}

.office-search-select .nice-select .current {
    display: block;
    overflow: hidden;
    padding-right: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.office-search-select .nice-select .list {
    max-height: min(50vh, 320px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    width: 100%;
    z-index: 10000;
}

.office-search-select .nice-select .option {
    line-height: 1.35;
    min-height: 42px;
    overflow-wrap: anywhere;
    padding-bottom: 11px;
    padding-top: 11px;
    white-space: normal;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
a,
span {
    overflow-wrap: break-word;
}

@media only screen and (max-width: 1024px) {
    /*
     * menu.css already switches to the hamburger at this breakpoint.
     * Keep the logo centered without allowing it to cover the trigger.
     */
    #header .container-header {
        min-height: 56px;
        position: relative;
    }

    #header .left-side {
        float: none;
        width: 100%;
    }

    #header #logo {
        left: 50%;
        margin: 0 !important;
        max-width: calc(100% - 130px);
        right: auto;
        transform: translateX(-50%);
        width: auto;
    }

    #header #logo img.logo-web {
        height: auto;
        max-height: 58px;
        max-width: 188px;
        width: auto;
    }

    #header .mmenu-trigger {
        position: relative;
        z-index: 1001;
    }

    /*
     * Bootstrap's d-none utility hides the existing language selector below
     * the XL breakpoint. Keep the same control and place it opposite the menu.
     */
    #header .language-selector {
        display: block !important;
        float: none;
        margin: 0;
        position: absolute;
        right: 15px;
        top: 7px;
        z-index: 1002;
    }

    #header .language-selector .lang-wrap {
        float: none;
    }

    #header .language-selector .lang-tooltip {
        left: auto !important;
        right: 0;
    }
}

@media only screen and (max-width: 991px) {
    /*
     * The slider views position this layer with fixed bottom offsets. Centering
     * the existing content makes the same hero work at any tablet/phone height.
     */
    .main-slider .tp-static-layers {
        bottom: auto !important;
        height: auto !important;
        min-height: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 100% !important;
    }

    .dark-overlay .main-search-inner {
        bottom: auto !important;
        left: auto !important;
        padding: 0 15px;
        position: relative !important;
        top: auto !important;
        transform: none !important;
        width: 100%;
    }

    .hero-inner2,
    .search-2 .hero-inner {
        margin: 0 !important;
    }

    .hero-inner2 .welcome-text h1,
    .dark-overlay h1 {
        font-size: 30px !important;
        line-height: 1.2 !important;
    }

    /*
     * Search widgets use fixed heights and input widths in the legacy theme.
     * Preserve their controls and styling while allowing rows to wrap.
     */
    .the-search .rld-main-search {
        display: block !important;
        height: auto !important;
        min-height: 0;
        padding: 20px !important;
        width: 100%;
    }

    .the-search .rld-main-search > .row {
        margin-left: -8px;
        margin-right: -8px;
    }

    .the-search .rld-main-search > .row > [class*="col-"] {
        padding-left: 8px;
        padding-right: 8px;
    }

    .the-search .rld-main-search .rld-single-input,
    .the-search .rld-main-search .rld-single-select,
    .the-search .rld-main-search .rld-single-select .single-select,
    .the-search .rld-main-search .rld-single-input input {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    .the-search .rld-main-search .btn {
        max-width: none;
        width: 100% !important;
    }

    .the-search .banner-search-wrap,
    .the-search .tab-content,
    .the-search .tab-pane {
        width: 100%;
    }

    /*
     * Search result forms contain Bootstrap 3 col-xs-* classes, but the site
     * ships Bootstrap 4. Give the controls an explicit tablet grid.
     */
    .properties-right form.wizard-form > .row > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
        width: 50%;
    }

    .properties-right form.wizard-form .rld-single-input,
    .properties-right form.wizard-form .rld-single-select,
    .properties-right form.wizard-form .single-select,
    .properties-right form.wizard-form input,
    .properties-right form.wizard-form select,
    .properties-right form.wizard-form .dropdown,
    .properties-right form.wizard-form .btn {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    .properties-right form.wizard-form .dropdown-menu {
        max-width: 100%;
        min-width: 100%;
    }

    /*
     * Property details keep a 9/3 split down to 768px, which is too narrow for
     * the gallery and contact card. Stack those existing sections on tablets.
     */
    .single-property-4 > .container-fluid > .row > .col-md-9,
    .single-property-4 > .container-fluid > .row > .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .single.detail-wrapper {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .details-map {
        height: 360px !important;
    }

    .sidebar-widget .author-box img {
        height: auto !important;
        max-width: 125px;
    }

    .h2-title {
        max-width: 450px;
        width: 100% !important;
    }

    p.header-p {
        font-size: 36px !important;
        line-height: 1.25 !important;
    }

    .about-us video,
    section video {
        max-width: 100% !important;
    }

    .container-fluid {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media only screen and (max-width: 767px) {
    #header {
        padding-bottom: 20px !important;
        padding-top: 14px !important;
    }

    #header .container-header {
        min-height: 50px;
    }

    #header #logo img.logo-web {
        max-height: 50px;
        max-width: 165px;
    }

    .about-us h2::after {
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 286px;
        width: 100% !important;
    }

    .main-slider .tp-static-layers {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .hero-inner2 .welcome-text h1,
    .dark-overlay h1 {
        font-size: 26px !important;
    }

    .hero-inner2 .col-12 {
        margin-top: 1rem !important;
        padding-left: 0;
        padding-right: 0;
    }

    .the-search .rld-banner-tab {
        flex-wrap: wrap;
    }

    .the-search .rld-banner-tab .nav-item {
        flex: 1 1 50%;
        max-width: 50%;
    }

    .the-search .rld-banner-tab .nav-item a {
        height: 100%;
        text-align: center;
        white-space: normal;
    }

    .the-search .tab-content > .active {
        margin-top: 20px;
    }

    .properties-right form.wizard-form > .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }

    .properties-right form.wizard-form .dropdown-menu {
        position: static !important;
        transform: none !important;
    }

    .homes,
    .homes-content {
        max-height: none !important;
        min-height: 0 !important;
    }

    img.img-demo {
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        width: 100%;
    }

    .portfolio .homes-content .homes-list,
    .recently .homes-content .homes-list {
        display: flex;
        flex-wrap: wrap;
    }

    .portfolio .homes-content .homes-list li,
    .recently .homes-content .homes-list li {
        float: none;
        line-height: 1.5;
        margin-bottom: 8px;
        width: 50%;
    }

    .blog-section .news-item-sm {
        display: block;
    }

    .blog-section .news-item-sm .news-img-link {
        display: block;
        width: 100%;
    }

    .blog-section .news-item-sm .news-img-link .news-item-img {
        padding-bottom: 69%;
        position: relative;
    }

    .blog-section .news-item-sm .news-img-link .resp-img {
        height: 100% !important;
        left: 0;
        object-fit: cover;
        position: absolute;
        top: 0;
        width: 100% !important;
    }

    .blog-section .news-item-sm .news-item-text {
        width: 100%;
    }

    .blog-section .news-item-sm .news-item-descr {
        height: auto;
        max-height: none;
    }

    .details-map {
        height: 300px !important;
    }

    .slider-pro,
    .sp-mask,
    .sp-slides,
    .sp-slide {
        max-width: 100%;
    }

    .top-footer .col-md-4 {
        margin-bottom: 30px;
    }

    .top-footer .innerspam {
        padding-left: 0 !important;
    }

    .top-footer ul.nodeco {
        padding-left: 0;
    }

    .top-footer ul.nodeco li {
        margin-left: 0 !important;
    }

    .top-footer img {
        height: auto;
        max-width: 250px !important;
        width: 100%;
    }

    a.footer-link {
        display: inline-block;
        max-width: 100%;
        white-space: normal;
    }

    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media only screen and (max-width: 575px) {
    #header #logo {
        max-width: calc(100% - 105px);
    }

    #header #logo img.logo-web {
        max-width: 145px;
    }

    #header .language-selector {
        right: 8px;
    }

    #header .language-selector .show-lang {
        padding-right: 0;
        width: 76px;
    }

    #header .language-selector .show-lang span {
        margin-left: 0;
    }

    #header .language-selector .show-lang span strong {
        font-size: 14px;
        padding-left: 6px;
    }

    #header .language-selector .show-lang .fa-caret-down.arrlan {
        left: 65px;
    }

    .hero-inner2 .welcome-text h1,
    .dark-overlay h1 {
        font-size: 23px !important;
    }

    .dark-overlay .main-search-inner {
        padding-left: 10px;
        padding-right: 10px;
    }

    .the-search .rld-main-search {
        padding: 15px !important;
    }

    .the-search .rld-main-search > .row {
        margin-left: 0;
        margin-right: 0;
    }

    .the-search .rld-main-search > .row > [class*="col-"] {
        padding-left: 0;
        padding-right: 0;
    }

    .the-search .rld-main-search .btn {
        margin-top: 12px;
    }

    .the-search .rld-banner-tab .nav-item a {
        font-size: 14px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .office-search-select .nice-select .list {
        max-height: 42vh;
    }

    .properties-right {
        padding-top: 30px !important;
    }

    .properties-right .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }

    .properties-right form.wizard-form > .row > [class*="col-"] {
        margin-bottom: 10px;
    }

    .properties-right form.wizard-form .btn-search {
        min-height: 48px;
    }

    .portfolio .homes-content .homes-list li,
    .recently .homes-content .homes-list li {
        width: 100%;
    }

    .single-property-4 .container-fluid.p0 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .single-property-4 .container-fluid.p0 > .row {
        margin-left: 0;
        margin-right: 0;
    }

    .single-property-4 .container-fluid.p0 > .row > [class*="col-"] {
        padding-left: 0;
        padding-right: 0;
    }

    .single-property-4 .sidebar-widget,
    .single-property-4 .single.detail-wrapper {
        border-radius: 0;
    }

    .details-map {
        height: 260px !important;
    }

    .h2-title {
        font-size: 26px;
    }

    p.header-p {
        font-size: 28px !important;
    }
}

@media only screen and (max-width: 360px) {
    #header #logo img.logo-web {
        max-width: 130px;
    }
}
