/**
Theme Name: Spain Residence Theme
Author: spain-residence.com
Author URI: https://spain-residence.com/about/
Description: Astra is the fastest, fully customizable & beautiful theme suitable for blogs, personal portfolios and business websites. It is very lightweight (less than 50KB on frontend) and offers unparalleled speed. Built with SEO in mind, Astra comes with schema.org code integrated so search engines will love your site. Astra offers plenty of sidebar options and widget areas giving you a full control for customizations. Furthermore, we have included special features and templates so feel free to choose any of your favorite page builder plugin to create pages flexibly. Some of the other features: # WooCommerce Ready # Responsive # Compatible with major plugins # Translation Ready # Extendible with premium addons # Regularly updated # Designed, Developed, Maintained & Supported by Brainstorm Force. Looking for a perfect base theme? Look no further. Astra is fast, fully customizable and beautiful theme!
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: spain-residence-theme
Template: astra
*/

/* ============================================================
 * CLS Fix #1: Reserve Astra header dimensions
 * Prevents content shift when Typekit font load / Astra JS
 * settles and collapses the main menu from 2 rows to 1 row.
 * Locks final measured heights from the first paint.
 * ============================================================ */
@media (min-width: 922px) {
    #masthead, #ast-desktop-header { min-height: 133px; }
    #masthead .site-header-primary-section-right { min-height: 84px; }
    #masthead .main-header-menu { min-height: 70px; }
}
@media (max-width: 921px) {
    #masthead, #ast-mobile-header { min-height: 126px; }
}

/* ============================================================
 * CLS Fix #2: Hide Elementor inline popup content by default
 * When Elementor Pro JS is delayed, the popup renders inline
 * in DOM flow (position:static), pushing content down. Elementor
 * JS later lifts it into a fixed overlay. Hide by default so
 * only the JS-controlled overlay is ever visible.
 * ============================================================ */
body > .elementor-location-popup {
    /* Hide ghost popup that renders inline in body before Elementor JS lifts it
     * into the dialog-widget overlay. Once moved into .dialog-widget, this
     * selector no longer matches, so opened popups are unaffected.
     * Do NOT add .elementor.elementor-location-popup here — that selector
     * matches the popup AFTER it has been moved into the overlay too, which
     * blocks Elementor 4.0.3+ from showing it (no .elementor-popup-modal-visible
     * class is added in current versions to override the rule). 2026-04-27. */
    display: none !important;
}

/* ============================================================
 * CLS Fix #3: Force main menu horizontal layout (desktop)
 * RUCSS may strip .main-header-menu / .ast-nav-menu flex rules
 * as "unused". Lock horizontal layout with !important so menu
 * never renders as vertical stack on first paint.
 * ============================================================ */
@media (min-width: 922px) {
    .ast-nav-menu.main-header-menu,
    .main-header-menu.ast-flex,
    ul.main-header-menu {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }
    .ast-nav-menu.main-header-menu > li,
    ul.main-header-menu > li.menu-item {
        display: inline-flex !important;
        flex-shrink: 0 !important;
        width: auto !important;
    }
    #masthead .main-navigation {
        display: inline-flex !important;
    }
}

/* ============================================================
 * CLS Fix #4: Header consultation button — prevent text wrap
 * Text "Бесплатная консультация" initially wraps to 2 lines
 * (button narrow), then fits to 1 line after CSS settles,
 * causing height flicker. Lock single-line with nowrap.
 * ============================================================ */
.ast-header-button-1 .ast-builder-button-wrap,
.ast-header-button-1 .ast-custom-button-link,
.ast-header-button-1 .ast-custom-button,
.ast-header-button-1 .menu-link {
    white-space: nowrap !important;
}
.ast-header-button-1 .ast-custom-button-link,
.ast-header-button-1 .ast-custom-button {
    min-height: 47px;
    display: inline-flex !important;
    align-items: center;
    box-sizing: border-box;
}
/* Hide fallback .menu-link duplicate — Astra renders two links, one hidden */
.ast-header-button-1 .ast-builder-button-wrap > a.menu-link {
    display: none !important;
}
