/**
 * Hamburger Menu Styles
 * Right-sliding hamburger menu for Shieldgroup theme
 * 
 * @package Gustoso Child Theme
 * @since 1.0
 */

/* Hide the original desktop menu */
.menu_main_nav_area {
    display: none !important;
}

/* Hide Polylang language switcher from menu */
.gustoso-menu-list li a[href="#pll_switcher"],
.gustoso-menu-list li:has(a[href="#pll_switcher"]),
.menu-item a[href="#pll_switcher"],
li:has(> a[href="#pll_switcher"]) {
    display: none !important;
}

/* Hide the original mobile menu button - comprehensive rules */
.sc_layouts_menu_mobile_button,
.sc_layouts_menu_mobile_button_burger,
.sc_layouts_item_menu_mobile_button,
.sc_layouts_iconed_text.sc_layouts_menu_mobile_button,
.sc_layouts_iconed_text.sc_layouts_menu_mobile_button_burger,
.sc_layouts_item .sc_layouts_menu_mobile_button,
.sc_layouts_item .sc_layouts_menu_mobile_button_burger,
.sc_layouts_item .sc_layouts_iconed_text.sc_layouts_menu_mobile_button,
.sc_layouts_item .sc_layouts_iconed_text.sc_layouts_menu_mobile_button_burger,
.top_panel_navi .sc_layouts_menu_mobile_button,
.top_panel_navi .sc_layouts_menu_mobile_button_burger,
.top_panel_mobile_navi .sc_layouts_menu_mobile_button,
.top_panel_mobile_navi .sc_layouts_menu_mobile_button_burger,
.sc_layouts_column .sc_layouts_menu_mobile_button,
.sc_layouts_column .sc_layouts_menu_mobile_button_burger,
.sc_layouts_column .sc_layouts_iconed_text.sc_layouts_menu_mobile_button,
.sc_layouts_column .sc_layouts_iconed_text.sc_layouts_menu_mobile_button_burger,
.sc_layouts_row .sc_layouts_menu_mobile_button,
.sc_layouts_row .sc_layouts_menu_mobile_button_burger,
.sc_layouts_menu_mobile_button a,
.sc_layouts_menu_mobile_button_burger a,
.sc_layouts_menu_mobile_button .sc_layouts_item_link,
.sc_layouts_menu_mobile_button_burger .sc_layouts_item_link {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure header has relative positioning for absolute positioning to work */
.top_panel_navi,
.sc_layouts_row,
.content_wrap,
.sc_layouts_column {
    position: relative;
}

/* Ensure the hamburger container is positioned correctly within the header */
.sc_layouts_column_align_right {
    position: relative;
}

/* Make sure hamburger is visible above other elements */
.gustoso-hamburger-container {
    position: fixed !important;
    top: 65px !important;
    right: 60px !important;
    transform: translateY(-50%) !important;
    z-index: 10001 !important;
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease !important;
    opacity: 1;
    visibility: visible;
}

/* Hide hamburger button when scrolling up */
.gustoso-hamburger-container.scroll-up {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-50%) translateY(-20px) !important;
}

/* Keep button visible when menu is open, even when scrolling up */
.gustoso-menu-overlay.active ~ .gustoso-hamburger-container.scroll-up,
body.gustoso-menu-open .gustoso-hamburger-container.scroll-up {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(-50%) !important;
}

/* Make sure the hamburger is visible on all screen sizes */
@media (max-width: 768px) {
    .gustoso-hamburger-container {
        top: 55px !important;
        right: 15px;
        gap: 15px !important;
    }
    
    .gustoso-menu-text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .gustoso-hamburger-container {
        right: 25px !important;
        gap: 12px !important;
        top: 55px !important;
    }
    
    .gustoso-menu-text {
        font-size: 12px;
    }
}

/* Hamburger Button */
.gustoso-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10001;
    position: relative;
    transition: all 0.3s ease;
}

.gustoso-hamburger:hover {
    opacity: 0.7;
}

/* Ensure hamburger button is always visible and properly styled */
.gustoso-hamburger {
    outline: none;
    border: none;
    background: transparent;
}

.gustoso-hamburger:focus {
    outline: none;
}

.gustoso-hamburger-line {
    position: absolute;
    width: 100%;
    height: 1px;
    background: #fff;
    transition: all 0.3s ease;
    transform-origin: center center;
    border-radius: 0;
}

.gustoso-hamburger-line:nth-child(1) {
    top: 1px;
}

.gustoso-hamburger-line:nth-child(2) {
    top: 20px;
}

/* Menu Text */
.gustoso-menu-text {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
    cursor: pointer;
    user-select: none;
}

/* Change hamburger and menu text to black on scroll */
.gustoso-hamburger-container.gustoso-header-scrolled .gustoso-hamburger-line {
    background: #000 !important;
}

.gustoso-hamburger-container.gustoso-header-scrolled .gustoso-menu-text {
    color: #000 !important;
}

/* Hamburger Animation */
.gustoso-hamburger.active .gustoso-hamburger-line:nth-child(1) {
    top: 10px;
    transform: rotate(45deg);
    background: black;
}

.gustoso-hamburger.active .gustoso-hamburger-line:nth-child(2) {
    top: 10px;
    transform: rotate(-45deg);
    background: black;
}

/* Menu Overlay */
.gustoso-menu-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 35%;
    height: 100vh;
    background: #ffffff;
    box-shadow: none;
    z-index: 10000;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.gustoso-menu-overlay.active {
    right: 0;
}

/* Background Overlay */
.gustoso-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.gustoso-menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Menu Header */
.gustoso-menu-header {
    padding: 30px 40px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
}

.gustoso-menu-logo {
    font-size: 14px;
    font-weight: 400;
    color: #000;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gustoso-menu-close {
    background: url('../images/close-icon.png') no-repeat center center;
    background-size: contain;
    border: none;
    width: 24px;
    height: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: opacity 0.3s ease;
    font-size: 0;
    color: transparent;
}

.gustoso-menu-close:hover {
    opacity: 0.7;
}

/* Menu Content */
.gustoso-menu-content {
    padding: 60px 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin-top: -100px;
    box-sizing: border-box;
}

/* Menu List */
.gustoso-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
    width: 100%;
}

.gustoso-menu-list li {
    margin: 0;
    border-bottom: none;
}

.gustoso-menu-list li:last-child {
    border-bottom: none;
}

.gustoso-menu-list a {
    display: block;
    padding: 18px 20px;
    color: #000;
    text-decoration: none;
    font-size: 24px;
    font-weight: 300;
    transition: opacity 0.3s ease;
    position: relative;
    font-family: 'Ysabeau Infant';
}

.gustoso-menu-list a:hover {
    background: transparent;
    opacity: 0.6;
    padding: 18px 20px;
}

.gustoso-menu-list a:before {
    display: none;
}

.gustoso-menu-list a:hover:before {
    display: none;
}

/* Submenu Styles */
.gustoso-menu-list .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: transparent;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.gustoso-menu-list .sub-menu.active {
    max-height: 500px;
}

.gustoso-menu-list .sub-menu a {
    padding: 15px 20px;
    font-size: 16px;
    color: #000;
    opacity: 0.8;
}

.gustoso-menu-list .sub-menu a:hover {
    background: transparent;
    opacity: 0.5;
    padding: 15px 20px;
}

/* Submenu Toggle */
.gustoso-menu-list .menu-item-has-children > a:after {
    display: none;
}

.gustoso-menu-list .menu-item-has-children > a.active:after {
    display: none;
}

/* Menu Footer */
.gustoso-menu-footer {
    padding: 30px 40px;
    border-top: none;
    background: transparent;
    margin-top: auto;
}

/* Body Lock when menu is open */
body.gustoso-menu-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gustoso-menu-overlay {
        max-width: 50%;
    }
}

@media (max-width: 768px) {
    .gustoso-menu-overlay {
        max-width: 100%;
        width: 100%;
    }
    
    .gustoso-menu-header {
        padding: 25px 30px;
        justify-content: flex-end;
    }
    
    .gustoso-menu-close {
        position: absolute;
        top: 25px;
        right: 30px;
    }
    
    .gustoso-menu-content {
        padding: 80px 0 40px 0;
        width: 100%;
        margin-top: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }
    
    .gustoso-menu-list {
        text-align: center;
        padding: 0;
        margin: 0;
        width: 100%;
    }
    
    .gustoso-menu-list li {
        text-align: center;
        display: block;
        width: 100%;
    }
    
    .gustoso-menu-list a {
        padding: 12px 0;
        font-size: 22px;
        text-align: center;
        display: block;
        width: 100%;
    }
    
    .gustoso-hamburger.active .gustoso-hamburger-line:nth-child(1),
    .gustoso-hamburger.active .gustoso-hamburger-line:nth-child(2) {
        top: 10px;
    }
}

@media (max-width: 480px) {
    .gustoso-menu-overlay {
        max-width: 100%;
        width: 100%;
    }
    
    .gustoso-menu-header {
        padding: 20px;
    }
    
    .gustoso-menu-close {
        top: 20px;
        right: 20px;
    }
    
    .gustoso-menu-content {
        padding: 70px 0 30px 0;
        width: 100%;
        margin-top: 0;
    }
    
    .gustoso-menu-list a {
        padding: 12px 0;
        font-size: 20px;
        text-align: center;
        display: block;
        width: 100%;
    }
    
    .gustoso-menu-list .sub-menu a {
        padding: 10px 0;
        font-size: 15px;
        text-align: center;
        display: block;
        width: 100%;
    }
    
    .gustoso-menu-footer {
        padding: 20px;
    }
    
    .gustoso-hamburger.active .gustoso-hamburger-line:nth-child(1),
    .gustoso-hamburger.active .gustoso-hamburger-line:nth-child(2) {
        top: 10px;
    }
}

.sc_layouts_row_fixed_on_pre, .sc_layouts_row_fixed_on {
    position: relative !important;
}

/* ========================================
   LANGUAGE SWITCHER STYLES
   ======================================== */

/* Desktop version - top left */
.gustoso-language-switcher--desktop {
    position: absolute;
    top: 30px;
    left: 40px;
    text-align: left;
    z-index: 10;
    display: block;
}

/* Mobile version - bottom of menu */
.gustoso-language-switcher--mobile {
    display: none;
    margin-top: 40px;
    text-align: center;
}

.gustoso-lang-dropdown {
    position: relative;
    display: inline-block;
}

.gustoso-lang-current {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px 0;
    font-family: 'Ysabeau Infant', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-weight: 300;
    color: #000;
    transition: opacity 0.3s ease;
}

.gustoso-lang-current:hover {
    opacity: 0.6;
}

.gustoso-lang-current:focus {
    outline: none;
}

.gustoso-lang-code {
    font-family: 'Ysabeau Infant', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-weight: 300;
    color: #000;
}

.gustoso-lang-arrow {
    width: 10px;
    height: 6px;
    transition: transform 0.3s ease;
    color: #000;
}

.gustoso-lang-dropdown.active .gustoso-lang-arrow {
    transform: rotate(180deg);
}

.gustoso-lang-list {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    list-style: none;
    margin: 0;
    padding: 10px 0;
    background: #ffffff;
    min-width: 60px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 100;
}

.gustoso-lang-dropdown.active .gustoso-lang-list {
    opacity: 1;
    visibility: visible;
}

.gustoso-lang-list li {
    margin: 0;
}

.gustoso-lang-list a {
    display: block;
    padding: 8px 15px !important;
    font-family: 'Ysabeau Infant', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 16px !important;
    font-weight: 300 !important;
    color: #000 !important;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.gustoso-lang-list a:hover {
    opacity: 0.6;
    background: transparent !important;
}

/* TranslatePress specific styles */
.gustoso-language-switcher .trp-language-switcher,
.gustoso-language-switcher [data-no-translation] {
    font-family: 'Ysabeau Infant', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.gustoso-language-switcher .trp-ls-shortcode-current-language {
    font-family: 'Ysabeau Infant', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 16px !important;
    font-weight: 300 !important;
    color: #000 !important;
    background: transparent !important;
    border: none !important;
    padding: 10px 0 !important;
}

.gustoso-language-switcher .trp-ls-shortcode-language {
    font-family: 'Ysabeau Infant', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 16px !important;
    font-weight: 300 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Hide desktop, show mobile */
    .gustoso-language-switcher--desktop {
        display: none;
    }
    
    .gustoso-language-switcher--mobile {
        display: block;
        margin-top: 30px;
        text-align: center;
    }
    
    .gustoso-lang-current,
    .gustoso-lang-code,
    .gustoso-lang-list a {
        font-size: 15px !important;
    }
}

@media (max-width: 480px) {
    .gustoso-language-switcher--mobile {
        margin-top: 25px;
    }
    
    .gustoso-lang-current,
    .gustoso-lang-code,
    .gustoso-lang-list a {
        font-size: 14px !important;
    }
}