/* Phone and tablet layout fixes. Loaded after style.css so these rules win over the theme's media queries. */

@media (max-width: 767px) {
    /* Header video: fit the header box instead of an 800px video that overflows it */
    .headerTest {
        overflow: visible;
    }
    .headerTest video,
    .headerTest .videoIndex {
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        object-fit: cover;
        -webkit-transform: none;
        transform: none;
    }

    /* Menu button: a normal 44px tap target on the left of the logo */
    .navigation .navbar .navbar-toggle,
    .headerTest .navigation .navbar .navbar-toggle {
        right: auto;
        left: 10px;
        top: 12px;
        width: 44px;
        height: 44px;
        padding: 10px;
        background: rgba(0, 0, 0, 0.25);
        border: 0;
        border-radius: 4px;
    }
    .navigation .navbar .navbar-toggle .icon-bar {
        width: 24px;
        margin: 0 auto;
        background-color: #fff;
    }
    .navigation .navbar .navbar-toggle .icon-bar + .icon-bar {
        margin-top: 5px;
    }

    /* Open menu: full-width panel over the page instead of a 200px box clipped by the header */
    .navigation .navbar {
        position: relative;
    }
    .navigation .navbar .navbar-collapse.in,
    .navigation .navbar .navbar-collapse.collapsing,
    .headerTest .navigation .navbar .collapse.in {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin: 0;
        padding: 0;
        height: auto !important;
        max-height: calc(100vh - 90px);
        overflow-y: auto;
        background: #004225;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
        z-index: 3000;
    }
    .navigation .navbar .navbar-nav {
        margin: 0;
        padding: 0;
    }
    .navigation .navbar .navbar-nav > li {
        float: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }
    .navigation .navbar .navbar-nav > li > a,
    .headerTest .navigation .navbar .navbar-nav > li > a {
        display: block;
        padding: 14px 20px !important;
        font-size: 16px !important;
        line-height: 1.4;
        color: #fff !important;
        text-align: right;
    }

    /* Sub-menus can't open on hover on touch screens, so list them under their parent */
    .navigation .navbar .collapse.in .navbar-nav li .child-navigation,
    .navigation .navbar .collapsing .navbar-nav li .child-navigation {
        display: block !important;
        position: static;
        height: auto !important;
        width: 100%;
        margin: 0;
        padding: 0 0 6px;
        background: rgba(0, 0, 0, 0.18) !important;
        box-shadow: none;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .navigation .navbar .navbar-nav > li .child-navigation li {
        float: none;
        padding: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .navigation .navbar .navbar-nav > li .child-navigation li a,
    .headerTest .navigation .navbar .navbar-nav > li .child-navigation li a {
        display: block;
        padding: 10px 36px 10px 20px !important;
        font-size: 15px !important;
        background: transparent !important;
        color: #f1e7d0 !important;
        border-bottom: 0;
        text-align: right;
    }

    /* Facilities carousel: two tiles per row instead of six full-width tiles */
    #featured-properties .carousel .thumbnails {
        margin: 0;
        padding: 0;
    }
    #featured-properties .carousel .thumbnails::after {
        content: "";
        display: table;
        clear: both;
    }
    #featured-properties .carousel .thumbnails > li {
        float: right;
        width: 50%;
        padding: 0 6px;
    }

    /* "الاستثمار الأمثل" banner: fixed backgrounds don't work on phones, and 200px padding wastes the screen */
    .tatsu-fqox7dm5pfdvce54,
    .tatsu-fqox7dm5pfdvce54 .tatsu-section-background,
    .tatsu-fqox7dm5pfdvce54 .tatsu-bg-blur {
        background-attachment: scroll !important;
        background-size: cover !important;
        background-position: center center !important;
    }
    .tatsu-fqox7dm5pfdvce54 .tatsu-section-pad {
        padding: 60px 15px;
    }
    .tatsu-fqox7dm5pfdvce54 h1 {
        font-size: 22px;
        line-height: 1.6;
    }
    .tatsu-fqox7dm5pfdvce54 br {
        display: none;
    }
    .tatsu-fqox7dm5pfdvce54 .banner {
        width: 100%;
        margin: 20px 0;
        padding: 15px;
        font-size: 18px;
    }
    .tatsu-fqox7dm5pfdvce54 .banner p {
        margin: 0;
        line-height: 1.7;
    }

    /* Villa page buttons: readable text and a comfortable tap height */
    .universal-button {
        padding: 12px 15px !important;
        font-size: 15px !important;
        margin-bottom: 8px;
    }
    .tableclass {
        width: 100%;
    }
    .tableclass td {
        padding: 6px 4px;
        vertical-align: top;
    }

    /* Footer: keep the floating contact button from covering the copyright line and "للأعلى" */
    #page-footer .inner #footer-copyright {
        padding-bottom: 80px;
    }
    #footer-copyright .copyRight,
    #footer-copyright .upLink,
    .indexPage .copyRight,
    .indexPage .upLink,
    #footer-copyright .actions {
        text-align: center;
        margin-top: 10px;
    }
    .scroll-up {
        right: 15px;
        bottom: 15px;
    }
}
