/* ============================================
   Desktop Nav: force single line for menu + lang button
   ============================================ */
.wpr-nav-menu.wpr-mega-menu {
    flex-wrap: nowrap !important;
    white-space: nowrap;
}

/* ============================================
   Language Switcher - Desktop Navigation (inline in nav)
   ============================================ */
.rpb-lang-menu-item {
    list-style: none;
    display: inline-flex !important;
    align-items: center !important;
    margin-left: 0 !important;
    flex-shrink: 0;
    vertical-align: middle;
}

.rpb-lang-menu-item > .rpb-lang-menu-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    color: #c8a45a !important;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid #c8a45a;
    border-radius: 4px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}

.rpb-lang-menu-item > .rpb-lang-menu-link:hover {
    background: #c8a45a;
    color: #fff !important;
    text-decoration: none !important;
}

.rpb-lang-menu-item .rpb-lang-icon {
    font-size: 13px;
    line-height: 1;
}

/* ============================================
   Mobile Header Translation Button
   (Injected into header flex container via JS)
   Hidden on desktop, shown on tablet/mobile
   ============================================ */
#rpb-mobile-header-btn {
    display: none !important; /* Hidden on desktop by default */
}

/* ============================================
   Hide lang button from mobile popup menu
   ============================================ */
.elementor-popup-modal .rpb-lang-menu-item,
.dialog-lightbox-widget .rpb-lang-menu-item {
    display: none !important;
}

/* ============================================
   Mobile Menu - WPR Nav (hide lang item)
   ============================================ */
.wpr-mobile-nav-menu .rpb-lang-menu-item,
.wpr-mobile-mega-menu .rpb-lang-menu-item {
    display: none !important;
}

/* ============================================
   FIX: Mobile Popup Menu - matching reference site
   ============================================ */
#elementor-popup-modal-13746 {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    background: rgba(0, 0, 0, 0.8) !important;
}

#elementor-popup-modal-13746 .dialog-widget-content {
    position: absolute !important;
    top: 0 !important;
    left: 30px !important;
    right: 30px !important;
    bottom: auto !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 44px 0 74px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    overflow-y: visible !important;
    background: #1a1a1a !important;
    border-radius: 5px !important;
    box-shadow: 2px 8px 23px 3px rgba(0, 0, 0, 0.2) !important;
    animation: rpb-slide-down 0.35s ease-out !important;
    padding: 0 !important;
}

/* Mobile: smaller margins, narrower panel */
@media (max-width: 767px) {
    #elementor-popup-modal-13746 .dialog-widget-content {
        left: 15px !important;
        right: 15px !important;
        max-width: 450px !important;
        margin: 20px auto !important;
    }
}

/* Slide-down open animation */
@keyframes rpb-slide-down {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide-up close animation */
#elementor-popup-modal-13746 .dialog-widget-content.rpb-slide-up {
    animation: rpb-slide-up 0.3s ease-in forwards !important;
}

@keyframes rpb-slide-up {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Close button - matching reference exactly */
#elementor-popup-modal-13746 .dialog-close-button {
    position: absolute !important;
    top: 15px !important;
    right: 10px !important;
    z-index: 10 !important;
    color: #ffffff !important;
    font-size: 22px !important;
    font-weight: 400 !important;
    cursor: pointer;
    transition: opacity 0.2s ease;
    line-height: 1 !important;
}

#elementor-popup-modal-13746 .dialog-close-button:hover {
    opacity: 0.7;
}

/* Menu content inside popup */
#elementor-popup-modal-13746 .dialog-message {
    padding: 0 !important;
}

/* Inner container background */
#elementor-popup-modal-13746 .dialog-message > .e-con,
#elementor-popup-modal-13746 .dialog-message > .elementor-section {
    background: #1a1a1a !important;
    padding: 0 15px !important;
}

/* Logo area inside popup */
#elementor-popup-modal-13746 .dialog-message .elementor-widget-image {
    margin-bottom: 10px !important;
}

/* Nav menu items in popup - matching reference exactly */
#elementor-popup-modal-13746 .wpr-mobile-nav-menu a,
#elementor-popup-modal-13746 .wpr-mobile-mega-menu a,
#elementor-popup-modal-13746 .elementor-nav-menu a,
#elementor-popup-modal-13746 .elementor-widget-nav-menu a {
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    padding: 10px 6px !important;
    display: block !important;
    border-bottom: none !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

#elementor-popup-modal-13746 .wpr-mobile-nav-menu a:hover,
#elementor-popup-modal-13746 .wpr-mobile-mega-menu a:hover,
#elementor-popup-modal-13746 .elementor-nav-menu a:hover,
#elementor-popup-modal-13746 .elementor-widget-nav-menu a:hover {
    color: #d0c088 !important;
}

/* Current/active menu item - gold matching reference */
#elementor-popup-modal-13746 .current-menu-item > a,
#elementor-popup-modal-13746 .wpr-active-menu-item > a {
    color: #d0c088 !important;
}

/* Menu list spacing */
#elementor-popup-modal-13746 .wpr-mobile-nav-menu li,
#elementor-popup-modal-13746 .wpr-mobile-mega-menu li {
    margin-bottom: 2px !important;
}

/* ============================================
   Smooth transition for content swap
   ============================================ */
.rpb-translating {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

/* ============================================
   Tablet (768px - 1024px)
   ============================================ */
@media (max-width: 1024px) {
    /* Show mobile header button inside the header flex container */
    #rpb-mobile-header-btn {
        display: inline-flex !important;
        align-items: center;
        align-self: center;
        gap: 10px;
        flex-shrink: 0;
        padding: 10px 24px;
        background: #c8a45a;
        color: #fff !important;
        font-size: 24px;
        font-weight: 600;
        border-radius: 14px;
        text-decoration: none !important;
        white-space: nowrap;
        transition: all 0.3s ease;
        margin-right: 8px;
    }

    #rpb-mobile-header-btn:hover {
        background: #b08d3e;
        color: #fff !important;
    }

    #rpb-mobile-header-btn .rpb-lang-icon {
        font-size: 26px;
        line-height: 1;
    }

    .rpb-lang-menu-item > .rpb-lang-menu-link {
        padding: 3px 8px;
        font-size: 12px;
    }
    .rpb-lang-menu-item .rpb-lang-icon {
        font-size: 12px;
    }
}

/* ============================================
   Mobile (below 768px)
   ============================================ */
@media (max-width: 768px) {
    /* Hide the lang button from the desktop hidden nav */
    .wpr-nav-menu.wpr-mega-menu > .rpb-lang-menu-item {
        display: none !important;
    }

    /* Mobile header button - small, vertically centered, near hamburger */
    #rpb-mobile-header-btn {
        display: inline-flex !important;
        align-items: center;
        align-self: center;
        gap: 3px;
        flex-shrink: 0;
        padding: 3px 9px;
        background: #c8a45a;
        color: #fff !important;
        font-size: 10px;
        font-weight: 600;
        border-radius: 12px;
        text-decoration: none !important;
        white-space: nowrap;
        transition: all 0.3s ease;
        margin-right: 8px;
    }

    #rpb-mobile-header-btn:hover {
        background: #b08d3e;
        color: #fff !important;
    }

    #rpb-mobile-header-btn .rpb-lang-icon {
        font-size: 10px;
        line-height: 1;
    }

    .rpb-lang-menu-item {
        margin-left: 0 !important;
        margin-top: 5px;
    }

    .rpb-lang-menu-item .rpb-lang-menu-link {
        padding: 10px 24px;
        font-size: 15px;
        background: #c8a45a;
        color: #fff !important;
        border: none;
    }
}
