/*
Theme Name: Homeid Child Theme
Theme URI: https://homeid.g5plus.net/
Author: G5 Theme
Author URI: https://themeforest.net/user/g5theme
Description: Child theme for Homeid Theme
Version: 1.0.4
Template: homeid
Text Domain: homeid-child
*/

/* ======================================
   Page Loading Animation
   ====================================== */

.rp-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.rp-page-loader.rp-loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.rp-loader-inner {
    text-align: center;
}

.rp-loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(196, 164, 105, 0.2);
    border-top-color: #c4a469;
    border-radius: 50%;
    animation: rp-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.rp-loader-text {
    color: #c4a469;
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
}

@keyframes rp-spin {
    to { transform: rotate(360deg); }
}

body.rp-loading {
    overflow: hidden;
}

/* Hero banner shimmer effect */
.rp-hero-shimmer {
    position: relative;
    overflow: hidden;
}

.rp-hero-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    animation: rp-shimmer 1.5s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes rp-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ======================================
   Arabic RTL overrides
   dir="rtl" stays on <html> for proper
   Elementor layout. These rules handle
   specific component RTL fixes.
   ====================================== */

/* G5 ERE search form */
html[lang="ar"] .home-txt .g5ere__sf-advanced-button a.btn::before {
    content: "\062A\0635\0641\064A\0629" !important;
}

/* RTL layout fixes for shortcode sections */
html[lang="ar"] .feat-box-sec ul,
html[lang="ar"] .amenition-sec ul,
html[lang="ar"] .unit-sec-box ul {
    direction: rtl;
}

html[lang="ar"] .property-price {
    direction: rtl;
    unicode-bidi: bidi-override;
}

/* RTL fix for search form */
html[lang="ar"] .g5ere-property-search-form {
    direction: rtl;
}

html[lang="ar"] .g5ere-property-search-form input,
html[lang="ar"] .g5ere-property-search-form select {
    text-align: right;
}

/* RTL fix for property cards */
html[lang="ar"] .g5ere__loop-property-content {
    direction: rtl;
    text-align: right;
}

/* RTL fix for city location cards */
html[lang="ar"] .g5ere__property-location-content {
    direction: rtl;
    text-align: right;
}

/* ======================================
   Slick Carousel RTL Fix
   Override Slick's [dir="rtl"] CSS rules
   that conflict with G5's rtl:false default.
   dir="rtl" stays on <html> for Elementor
   layout, but carousels forced to LTR.
   ====================================== */

/* Override Slick's built-in RTL rules */
[dir="rtl"] .slick-slide {
    float: left !important;
    visibility: visible !important;
}

[dir="rtl"] .slick-track,
[dir="rtl"] .slick-list {
    direction: ltr !important;
}

/* Carousel wrappers: force LTR */
html[lang="ar"] .slick-initialized,
html[lang="ar"] .slick-slider,
html[lang="ar"] .g5ere__listing-inner,
html[lang="ar"] .g5ere__properties-wrap,
html[lang="ar"] .g5ere__location-wrap {
    direction: ltr !important;
}

/* Keep card content RTL inside LTR carousel */
html[lang="ar"] .g5ere__property-item,
html[lang="ar"] .g5ere__property-location-item {
    direction: rtl;
    text-align: right;
}

/* Ensure Slick list clips correctly */
html[lang="ar"] .slick-list {
    overflow: hidden;
}

/* ======================================
   Popup Form – Select Dropdown Fix
   Make the <select> placeholder match
   input placeholder styling (light gray)
   ====================================== */

.elementor-popup-modal .elementor-field-type-select .elementor-field-textual {
    color: #9a9a9a;
    font-weight: 400;
    font-size: inherit;
    font-family: inherit;
}

/* When an actual option is selected (not the placeholder), show dark text */
.elementor-popup-modal .elementor-field-type-select .elementor-field-textual.elementor-field--has-value {
    color: #333;
}

/* Also target via option styling for browsers that support it */
.elementor-popup-modal .elementor-field-type-select select option:first-child {
    color: #9a9a9a;
}

.elementor-popup-modal .elementor-field-type-select select option {
    color: #333;
    font-weight: 400;
}

/* ======================================
   Header Nav – Single-Line Layout Fix
   Ensures all header items (logo, menu,
   phone, lang switcher, CTA) fit on one
   line at 100% zoom on all screen sizes.
   ====================================== */

/* Force single-line, no wrapping anywhere in header */
.elementor-location-header .e-con {
    flex-wrap: nowrap !important;
}

/* Reduce outer header container padding */
.elementor-location-header > .e-con {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* Inner container: tight gaps, single line */
.elementor-location-header .e-con > .e-con {
    gap: 8px !important;
    align-items: center;
    flex-wrap: nowrap !important;
}

/* Menu: match live site sizing */
.elementor-location-header .wpr-nav-menu {
    flex-wrap: nowrap !important;
}

.elementor-location-header .wpr-nav-menu > li > a {
    padding-left: 12px !important;
    padding-right: 12px !important;
    font-size: 16px !important;
    white-space: nowrap;
}

/* Phone number: no wrapping */
.elementor-location-header .elementor-icon-list-items {
    white-space: nowrap;
}

.elementor-location-header .elementor-icon-list-text {
    font-size: 15px !important;
    white-space: nowrap;
}

/* Enquire Now button: compact, no wrap, with breathing room */
.elementor-location-header .elementor-button {
    white-space: nowrap;
    padding: 12px 22px !important;
    font-size: 14px !important;
}

.elementor-location-header .elementor-widget-button {
    margin-left: 8px !important;
}

/* Language switcher: compact select box with spacing */
.rp-lang-switcher {
    min-width: auto !important;
    flex-shrink: 0;
    margin-left: 6px !important;
    margin-right: 6px !important;
}

.rp-lang-switcher .rp-lang-selected {
    padding: 5px 8px !important;
    gap: 4px !important;
}

.rp-lang-switcher .rp-lang-globe svg {
    width: 14px;
    height: 14px;
}

.rp-lang-switcher .rp-lang-current-text {
    font-size: 13px !important;
}

/* ---- Responsive tightening ---- */
@media (max-width: 1500px) {
    .elementor-location-header .wpr-nav-menu > li > a {
        padding-left: 9px !important;
        padding-right: 9px !important;
        font-size: 15px !important;
    }

    .elementor-location-header .elementor-icon-list-text {
        font-size: 14px !important;
    }

    .elementor-location-header .elementor-button {
        padding: 10px 18px !important;
    }

    .elementor-location-header .e-con > .e-con {
        gap: 6px !important;
    }
}

@media (max-width: 1400px) {
    .elementor-location-header .wpr-nav-menu > li > a {
        padding-left: 7px !important;
        padding-right: 7px !important;
        font-size: 14px !important;
    }

    .elementor-location-header .elementor-icon-list-text {
        font-size: 13px !important;
    }

    .elementor-location-header .elementor-button {
        padding: 8px 14px !important;
        font-size: 13px !important;
    }

    .elementor-location-header > .e-con {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .elementor-location-header .e-con > .e-con {
        gap: 4px !important;
    }

    /* Hide globe icon at tight widths to save space */
    .rp-lang-switcher .rp-lang-globe {
        display: none;
    }
}

/* ============================================
   Property Archive: Fix search/toolbar overlap
   ============================================ */

/* The Elementor header template on property archive extends into the content area.
   #main-content has margin-top:-46px from ERE plugin, pulling toolbar under the header.
   Fix: remove negative margin on property archive pages so toolbar doesn't overlap. */

/* Remove the negative margin that causes overlap on property archive */
body.post-type-archive-property #main-content,
body.tax-property-type #main-content,
body.tax-property-status #main-content,
body.tax-property-city #main-content {
    margin-top: 0 !important;
}

/* Ensure the sorting toolbar and its dropdown sit above the header search section */
body.post-type-archive-property #wrapper_content,
body.tax-property-type #wrapper_content,
body.tax-property-status #wrapper_content,
body.tax-property-city #wrapper_content {
    position: relative;
    z-index: 2;
}

.g5ere__toolbar .g5ere__listing-orderby {
    position: relative;
    z-index: 10;
}

/* ============================================
   RTL (Arabic) Header: Menu alignment fix
   ============================================ */

/* Structure: b9af878 > 0b01df0 [logo(e527992) + ec4b006(menu+phone+btn)]
   In LTR: logo LEFT, nav items RIGHT — works with flex-end/center.
   In RTL: logo stays RIGHT (correct), but nav items also go RIGHT leaving
   a gap in the middle. We need nav items to sit NEXT to the logo. */

/* Make the nav container (ec4b006) not grow — remove flex:1 so it
   doesn't push away from the logo. Instead, let items sit naturally. */
html[dir="rtl"] .elementor-element-0b01df0 {
    direction: rtl !important;
}

/* The nav container should align items from the end (right in RTL = near logo) */
html[dir="rtl"] .elementor-element-ec4b006 {
    direction: rtl !important;
    justify-content: flex-start !important;
}

/* The WPR mega menu nav: override the hardcoded wpr-main-menu-align-left */
html[dir="rtl"] .elementor-location-header .wpr-mega-menu-container,
html[dir="rtl"] .elementor-location-header .wpr-nav-menu-container {
    text-align: right;
    direction: rtl !important;
}

/* Menu items should flow right-to-left */
html[dir="rtl"] .elementor-location-header .wpr-nav-menu {
    direction: rtl !important;
    justify-content: flex-start !important;
}

/* Push the CTA button and phone to the far left in RTL header */
html[dir="rtl"] .elementor-element-7a80584,
html[dir="rtl"] .elementor-element-9551683 {
    margin-inline-start: auto;
}

/* RTL fix for general header (15602) - same alignment rules */
html[dir="rtl"] .elementor-element-7879d39 {
    direction: rtl !important;
}
html[dir="rtl"] .elementor-element-8cb684d {
    direction: rtl !important;
    justify-content: flex-start !important;
}

/* ============================================
   RTL (Arabic) Search form: icon/text overlap fix
   ============================================ */

/* Move search icon to left side in RTL (it's on the right by default which overlaps the label) */
html[dir="rtl"] .g5ere__sf-keyword .input-group-prepend {
    position: absolute;
    left: 0;
    right: auto !important;
    z-index: 3;
}
html[dir="rtl"] .g5ere__sf-keyword .g5ere__sf-icon-submit {
    right: auto !important;
    left: 0 !important;
}
/* Add left padding to the input so text doesn't go under the icon */
html[dir="rtl"] .g5ere__sf-keyword .form-control {
    padding-left: 50px !important;
    padding-right: 10px !important;
}
/* Align label text to right in RTL */
html[dir="rtl"] .g5ere__s-label {
    text-align: right;
    display: block;
}

/* ============================================
   AR Popup Modal – wider width & no scroll
   Popup 15592 (AR) now has DB width settings
   matching EN popup (900px). These CSS rules
   handle overflow/scroll removal on RTL pages.
   ============================================ */

/* Remove internal scroll on AR popup content */
html[dir="rtl"] .elementor-popup-modal .dialog-message {
    overflow: visible !important;
    max-height: none !important;
}

/* Ensure the popup widget content does not clip */
html[dir="rtl"] .elementor-popup-modal .dialog-widget-content {
    overflow: visible !important;
    max-height: none !important;
}

/* Prevent body-level scroll when AR popup is open */
html[dir="rtl"] .elementor-popup-modal .dialog-message .elementor {
    overflow: visible !important;
}
