.menu {
    background-color: #ffffff;
    opacity: 100%;
    width: 100%;
    height: 70px;
    position: fixed;
    top: 0px;
    z-index: 10;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.menu_content{
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: row;
    margin: auto;
}

.logo1{
    width: 320px;
    margin-left: 0px;   
}

.menu_texts {
    display: flex;
    align-items: center;  
    justify-content: flex-end;
    margin-left: auto;
    margin-right: 0;
    width: 800px;
    gap: 30px;  /* better spacing than margin-right on children */
}

.menu_a_first{
    margin-left: 30px ;
}

.menu_a {
    padding: 10px;
    border-radius: 5px;
    color: #CAB78D;
    text-decoration: none;
    font-size: 20px;
    background-color: transparent;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: center;
    display: block; /* to fill flex item */
}

.menu_a:hover {
    background-color: #CAB78D;
    color: white;
}

.menu_item_with_submenu {
    position: relative; /* for submenu absolute positioning */
}


.menu_item_with_submenu {
    position: relative;
    display: inline-block;
}

/* Submenu default (hidden) */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease;
    flex-direction: column;
    background-color: #fff;
    z-index: 100;
    width: 300px;
    box-shadow: 0px 4px 6px rgba(0,0,0,0.1);
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

/* Submenu visible state */
.submenu.show {
    opacity: 1;
    visibility: visible;
    max-height: 500px;
    transform: translateY(0);
}

.submenu_a {
    padding: 10px 15px;
    text-decoration: none;
    color: #CAB78D;
    display: block;
}

.submenu_a:hover{
    color: white;
    background-color: #CAB78D;
}

.menu_toggle {
    display: none;
    background: none;
    color: #CAB78D;
    font-size: 40px;
    border: none;
    cursor: pointer;
    margin-left: auto;
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.menu_toggle.rotated {
    transform: rotate(90deg);
}

.entrar_dropdown {
    display: none;
}

.entrar_inline {
    display: flex;
}

.menu_texts .entrar_dropdown {
    display: none;
}

@media (min-width: 300px) and (max-width: 400px) {
    .menu_item_with_submenu{
        width: 100%;
    }

    .submenu_a{
        border-radius: 10px;
    }

    .submenu.show {
        position: relative;
        box-shadow: none;
        left: 30px;
        width: 100%;
        box-shadow: none;
        border-bottom-left-radius: 0px;
        border-bottom-right-radius: 0px;
        border-bottom: none;
    }

    .logo1{
        width: 220px;
         margin-left: 20px;  
    }

    .menu_texts {
        display: flex; /* must be flex to apply column layout */
        flex-direction: column;
        align-items: flex-start;
        background-color: #ffffff;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        overflow: hidden;
        max-height: 0;
        padding: 0;
        transition: max-height 0.4s ease, padding 0.3s ease;
        z-index: 10;
        margin-top: 0;
        border-bottom: 2px solid rgba(0, 0, 0, 0.1);
        gap: 10px;
    }
    
    .menu_texts.show {
        max-height: 500px;
        padding: 10px 0;
        z-index: 999;
        margin-top: 0;
        border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    }
    
    /* Stack links vertically and stretch them */
    .menu_texts .menu_a {
        display: block;
        width: 100%;
        padding: 12px 20px;
        color: #CAB78D;
        text-decoration: none;
        font-size: 16px;
        transition: background-color 0.2s;
    }
    
    .menu_texts .menu_a:hover {
        background-color: #CAB78D;
        color: white;
    }

    .menu_toggle {
        display: block;
    }

    .menu {
        flex-wrap: wrap;
        height: auto;
    }

    .entrar_inline {
        display: none;
    }

    .menu_texts .entrar_dropdown {
        display: flex;
        width: 90%;
        margin: 10px auto;
        height: 40px;
        border: none;
        border-radius: 8px;
        background-color: #85B400;
        color: white;
        font-size: 18px;
        font-weight: 300;
        cursor: pointer;
        text-decoration: none;
        justify-content: center;
        align-items: center;
        transition: background-color 0.3s ease;
    }

    .menu_a {
        width: 95%;
        justify-content: flex-start;
        margin: auto;
        text-align: left;
    }

    .entrar_button {
        display: none; /* hide all versions unless specifically shown elsewhere */
    }
}

@media (min-width: 400px) and (max-width: 1200px) {

    .menu_item_with_submenu{
        width: 100%;
    }

    .submenu_a{
        border-radius: 10px;
    }

    .submenu.show {
        position: relative;
        box-shadow: none;
        left: 30px;
        width: 100%;
        box-shadow: none;
        border-bottom-left-radius: 0px;
        border-bottom-right-radius: 0px;
        border-bottom: none;
    }

    .menu {
        flex-wrap: wrap;
        height: auto;
    }

    .menu_toggle {
        display: block;
    }

    .menu_texts {
        flex-direction: column;
        align-items: flex-start;
        background-color: #ffffff; /* semi-transparent background */
        backdrop-filter: blur(10px);  /* <-- this adds the blur */
        -webkit-backdrop-filter: blur(10px); /* for Safari support */
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        overflow: hidden;
        max-height: 0;
        padding: 0;
        transition: max-height 0.4s ease, padding 0.3s ease;
        z-index: 10;
        margin-top: 0;
        gap: 10px;
        border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    }
    

    .menu_texts.show {
        max-height: 500px;
        padding: 10px 0;
        position: absolute;
        z-index:11;
        border-bottom-left-radius: 10px;
        border-bottom-right-radius: 10px;   
        margin-top: 0;
        border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    }

    /* Hide dropdown-style button here */
    .menu_texts .entrar_dropdown {
        display: none;
    }

    /* Main entrar button stays visible */
    .entrar_button {
        display: flex;
        width: 120px;
        height: 40px;
        border: none;
        border-radius: 8px;
        background-color: #85B400;
        color: white;
        font-size: 18px;
        font-weight: 300;
        margin-top: 15px;
        margin-right: 20px;
        position: absolute;
        right: 40px;
        cursor: pointer;
        text-decoration: none;
        justify-content: center;
        align-items: center;
        transition: background-color 0.3s ease;
    }

    .menu_texts .menu_a {
        display: block;
        width: 100%;
        padding: 12px 20px;
        color: #CAB78D;
        text-decoration: none;
        font-size: 16px;
        transition: background-color 0.2s;
    }

    .menu_texts .menu_a:hover {
        background-color: #CAB78D;
        color: white;
    }

    .entrar_inline {
        display: none;
    }

    .menu_a {
        width: 95%;
        justify-content: flex-start;
        margin: auto;
        text-align: left;
    }
}

@media (min-width: 1200px) and (max-width: 1400px) {
    .menu_texts{
        margin-left: 0;
    }

}