/* Widget Wrapper Fix */
.elementor-widget-eleganza_header_mega {
    position: static; 
}

/* Header Wrapper */
.ez-header-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    background-color: transparent;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
}

.ez-header-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ez-header-wrapper.is-scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.ez-header-wrapper.is-scrolled .ez-header-container {
    padding: 10px 40px;
}

/* Logos */
.ez-logo-wrap {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.ez-logo-wrap a {
    display: block;
    position: relative;
    width: 100%;
}

.ez-logo-wrap img {
    height: auto;
    width: 100%;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    object-fit: contain;
}

.logo-dark {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.ez-header-wrapper:hover .logo-light,
.ez-header-wrapper.is-scrolled .logo-light {
    opacity: 0;
    pointer-events: none;
}

.ez-header-wrapper:hover .logo-dark,
.ez-header-wrapper.is-scrolled .logo-dark {
    opacity: 1;
}

/* Navigation Menu */
.ez-nav-wrap {
    display: flex;
    flex-grow: 1;
    justify-content: center;
}

.ez-main-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 35px;
}

.ez-nav-item {
    margin: 0;
    position: relative;
    padding: 15px 0; /* Important for hover area extending to dropdowns */
}

.ez-nav-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    transition: color 0.3s ease;
}

.ez-caret {
    font-size: 10px;
    margin-left: 6px;
    transition: transform 0.3s ease;
}

.ez-has-mega:hover .ez-caret {
    transform: rotate(180deg);
}

/* ================= MEGA MENU ================= */
.ez-mega-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 900px;
    background-color: #ffffff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    pointer-events: none;
    overflow: hidden;
}

.ez-has-mega:hover .ez-mega-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Mega Menu Inner Structure */
.ez-mega-inner {
    display: flex;
    gap: 40px;
    padding: 40px;
}

.ez-mega-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ez-mega-col-1, .ez-mega-col-2 {
    flex: 0 0 25%;
}

.ez-mega-col-3 {
    flex: 0 0 40%;
    margin-left: auto;
}

.ez-mega-heading {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #000;
    font-family: inherit;
}

.ez-mega-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ez-mega-cols-merged {
    display: flex;
    gap: 40px;
}

.ez-mega-link {
    margin: 0;
}

.ez-mega-link a {
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    color: #555555;
    transition: color 0.2s ease;
    display: block;
}

.ez-mega-link a:hover {
    color: #d2ab7f;
}

/* Mega Image Card */
.ez-mega-img-card {
    display: block;
    text-decoration: none;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
    group: relative;
}

.ez-mega-img-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
    border-radius: 8px;
}

.ez-mega-img-card:hover img {
    transform: scale(1.05);
}

.ez-mega-img-title {
    margin-top: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #000;
    text-align: center;
}

/* Button & Mobile Group */
.ez-action-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.ez-header-btn {
    display: inline-block;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 50px;
    background-color: #d2ab7f;
    color: #fff;
    transition: all 0.3s ease;
}

.ez-header-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Mobile Toggle Hamburger */
.ez-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
    z-index: 100;
}

.ez-mobile-toggle span {
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    transition: background-color 0.4s ease, transform 0.4s ease, opacity 0.4s ease;
    border-radius: 2px;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .ez-header-container {
        padding: 15px 25px;
    }
    .ez-header-wrapper.is-scrolled .ez-header-container {
        padding: 10px 25px;
    }

    .ez-nav-wrap {
        position: fixed;
        top: 0;
        right: -400px;
        width: 320px;
        height: 100vh;
        background-color: #ffffff;
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 80px 30px 40px;
        overflow-y: auto;
        justify-content: flex-start;
    }
    
    .ez-nav-wrap.active {
        right: 0;
    }
    
    .ez-main-menu {
        flex-direction: column;
        gap: 0;
        align-items: flex-start;
        width: 100%;
    }

    .ez-nav-item {
        width: 100%;
        padding: 0;
        border-bottom: 1px solid #eee;
    }
    
    .ez-nav-link {
        display: flex;
        justify-content: space-between;
        padding: 20px 0;
        color: #000000 !important; /* Force dark text in mobile dropdown */
        width: 100%;
    }

    .ez-has-mega:hover .ez-mega-menu-dropdown {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    /* Change mega menu drop behavior on mobile */
    .ez-mega-menu-dropdown {
        position: static;
        width: 100%;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        margin: 0;
        display: none;
        background-color: transparent;
    }

    /* Add active class toggle for mobile mega menu via JS (optional) or keep hidden if too complex, or show inline */
    .ez-nav-item.mobile-mega-open .ez-mega-menu-dropdown {
        display: block;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .ez-mega-inner {
        flex-direction: column;
        gap: 20px;
        padding: 10px 0 20px 10px;
    }
    
    .ez-mega-col-1, .ez-mega-col-2, .ez-mega-col-3 {
        flex: 1;
        margin-left: 0;
    }
    
    .ez-mega-heading {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .ez-header-btn {
        display: none; /* Hide button on mobile */
    }

    .ez-mobile-toggle {
        display: flex;
    }
    
    .ez-mobile-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .ez-mobile-toggle.active span:nth-child(2) { opacity: 0; }
    .ez-mobile-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
}
