.menu {
    position: relative;
    z-index: 10;
}

.menu ul {
    width: 100%;
    padding: 0px;
    margin: auto;
    list-style: none;
}

.menu ul li {
    position: relative;
    margin: 0px 10px;
    z-index: 1;
}

.menu ul li.line {
    width: 1px;
    height: 15px;
    background-color: rgba(0, 0, 0, 0.1);
}

.menu ul li.fix-width {
    width: 50px;
}

.menu ul li a {
    display: block;
    position: relative;
    color: var(--color-black);
    padding: 5px 15px;
    font-weight: 500;
    text-transform: uppercase;
    text-decoration: none;
}
.menu ul li a::after{
    display: none;
}
.menu ul li a:hover, .menu ul li a.active{
    color: var(--color-main);
}
.menu ul li:hover > a::after, .menu ul li a.active::after{
    display: block;
}

/* .menu ul li a.has-child {
    padding-right: 16px;
    margin-right: 8px;
} */

/* .menu ul li a.has-child:after {
    content: "";
    position: absolute;
    bottom: calc(50% - 4px / 2);
    right: 5px;
    width: 5px;
    height: 5px;
    border: 1px solid #fafafa;
    border-top: 0px;
    border-left: 0px;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
} */

.menu ul li ul {
    position: absolute;
    min-width: 250px;
    top: 110%;
    background-color: #fafafa;
    border-radius: 0.25rem;
    -webkit-box-shadow: 1px 1px 15px rgba(0, 0, 0, 0.15);
    box-shadow: 1px 1px 15px rgba(0, 0, 0, 0.15);
    -webkit-transform: perspective(600px) rotateX(-90deg);
    transform: perspective(600px) rotateX(-90deg);
    -webkit-transform-origin: 0 0 0;
    transform-origin: 0 0 0;
    opacity: 0;
    visibility: hidden;
}

.menu ul li:hover > ul {
    -webkit-transform: perspective(600px) rotateX(0);
    transform: perspective(600px) rotateX(0);
    transform-origin: 0 0 0;
    -webkit-transform-origin: 0 0 0;
    opacity: 1;
    visibility: visible;
}

.menu ul li ul li {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.menu ul li ul li a {
    font-size: 15px;
    color: #313131;
    border-bottom: 1px solid #ececec;
    padding: 10px 0px 9px 0px;
    text-transform: capitalize;
}

.menu ul li ul li a.has-child {
    margin-right: 0px;
}

/* .menu ul li ul li a.has-child:after {
    border-color: #313131;
    -webkit-transform: rotate(-45deg);
    transform: rotate(-45deg);
} */

.menu ul li ul li a.active {
    color: #ec2d3f;
}

/* .menu ul li ul li a.active.has-child:after {
    border-color: #ec2d3f;
} */

.menu ul li ul li:last-child > a {
    border-bottom: 0px;
}
  
.menu ul li ul li:hover > a {
    color: #ec2d3f;
}
  
/* .menu ul li ul li:hover > a.has-child:after {
    border-color: #ec2d3f;
} */
  
.menu ul li ul li ul {
    top: 0;
    left: 100%;
    margin-top: 0px;
}


/* Mmenu */
.menu-res {
    z-index: 100;
    position: relative;
    display: block;
}

@media only screen and (max-width: 991px) {
    .menu-res {
        display: block;
    }
}

.menu-bar-res {
    height: 40px;
}
.menu-bar-res span{
    color: #333;
    transition: all 0.5s ease 0.5s;
}

#menu {
    display: none;
}

#hamburger {
    display: block;
    width: 30px;
    height: 23px;
    position: relative;
}

#hamburger:before,
#hamburger:after,
#hamburger span {
    background: var(--color-main);
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    position: absolute;
    left: 0px;
    transition: all 0.5s ease 0.5s;
}

#hamburger:before {
    top: 0px;
}

#hamburger span {
    top: 7px;
}

#hamburger:after {
    width: 50%;
    top: 15px;
}
#hamburger span {
}

.mm-wrapper_opening #hamburger:before,
.mm-wrapper_opening #hamburger:after {
    top: 10px;
}

.mm-wrapper_opening #hamburger span {
    left: -50px;
    opacity: 0;
}

.mm-wrapper_opening #hamburger:before {
    transform: rotate(45deg);
}

.mm-wrapper_opening #hamburger:after {
    width: 100%;
    transform: rotate(-45deg);
}
.modal-open .menu-bar-res {
    display: none !important;
}
.modal-open #hamburger:before,
.modal-open #hamburger:after {
    top: 10px;
}

.modal-open #hamburger span {
    left: -50px;
    opacity: 0;
}

.modal-open #hamburger:before {
    transform: rotate(45deg);
}

.modal-open #hamburger:after {
    width: 100%;
    transform: rotate(-45deg);
}

.mm-menu_opened {
    display: block !important;
    z-index: 99999 !important;
}
.mm-navbar, .mm-panels, .mm-panel{
    background: var(--color-main) !important;
}

/* Search */
.search-menu {
    width: 40px;
    height: 40px;
    border-radius: 4rem;
    background: transparent;
    align-items: center;
    justify-content: end;
    outline: none;
    overflow: hidden;
    transition: 400ms ease-in-out;
    position: absolute;
    right: 0px;
}

.search-menu.active {
    width: 350px;
}
.search-menu.active input{
    display: block;
}
.search-menu.active .btn{
    background-color: #333;
}
.search-menu.active .btn svg{

}
.search-menu input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    outline: none;
    border: none;
    font-size: 1rem;
    display: none;
}
.search-menu .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 0px solid white;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1;
}
.search-menu .btn svg {
    color: #fff;
}

.mm-menu_offcanvas {
    width: 50%;
}
.mm-navbar__title {
    text-transform: uppercase;
    font-size: 20px;
}

#popup-menu .btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
}

#popup-menu .modal-content{
    background: transparent;
}

#popup-menu .modal-body{
    padding: 0px;
    overflow: hidden;
}

/* Main menu container */
#popup-menu .mainmenu {
    position: relative;
    padding: 40px 0px;
    margin-bottom: 0px;
    width: 250px;
    transition: transform 0.3s ease-in-out;
    background-color: var(--color-main);
    z-index: 1;
}

/* Main menu khi submenu mở */
#popup-menu .mainmenu.menu-hidden {
    /* transform: translateX(-200%); */
}

/* Menu items styling */
#popup-menu ul li {
    position: relative;
    list-style: none;
    text-align: left;
    border-top: 1px solid #fff;
}
#popup-menu ul li:first-child{
    border-top: none;
}

#popup-menu ul li:hover{
    background-color: #c88412;
}

#popup-menu ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 1em;
    padding: 8px 20px;
    display: block;
    font-weight: 500;
    transition: 0.5s;
}

/* Hover effect cho main menu */
#popup-menu ul:hover li .submenu-arrow,
#popup-menu ul:hover li a {
    color: #fff;
}

#popup-menu ul li:hover a {
    color: #fff;
    background: transparent;
}

/* Background effect cho menu items */
#popup-menu ul li a:before {
    content: "";
    position: absolute;
    top: 50%;
    left: 20%;
    transform: translate(-50%, -50%);
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 4em;
    color: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 500px;
    transition: letter-spacing 0.5s, left 0.5s;
    text-indent: 500px;
}

#popup-menu ul li a:hover:before {
    content: attr(data-text);
    opacity: 1;
    left: 30%;
    letter-spacing: 10px;
    width: 1200px;
    height: 1800px;
    white-space: nowrap;
}

/* Background colors cho menu items */
#popup-menu ul li:nth-child(6n + 1) a:before {
    background: #bdbab8;
}
#popup-menu ul li:nth-child(6n + 2) a:before {
    background: #bdbab8;
}
#popup-menu ul li:nth-child(6n + 3) a:before {
    background: #bdbab8;
}
#popup-menu ul li:nth-child(6n + 4) a:before {
    background: #bdbab8;
}
#popup-menu ul li:nth-child(6n + 5) a:before {
    background: #bdbab8;
}
#popup-menu ul li:nth-child(6n + 6) a:before {
    background: #bdbab8;
}

/* Style cho li có submenu */
#popup-menu ul li.has-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

/* Style cho arrow mới */
#popup-menu ul li .submenu-arrow {
    color: #fff;
    font-size: 1.5em;
    margin-right: 10px;
    cursor: pointer;
    transition: 0.3s;
    line-height: 13px;
}

/* Submenu container */
#popup-menu .submenu {
    display: none;
    width: 100%;
}

/* Show submenu */
#popup-menu .submenu.open {
    display: block;
    width: 100%;
    opacity: 1;
    transform: translateY(0);
}

/* Submenu content wrapper */
#popup-menu .submenu-content {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Back button styling */
#popup-menu .submenu .back-btn {
    position: absolute;
    top: 20px;
    left: -15px;
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 3;
}

#popup-menu .submenu .back-btn:before {
    content: "←";
    font-size: 1.2em;
}

#popup-menu .submenu .back-btn:hover {
    opacity: 0.8;
}

/* Submenu items styling */
#popup-menu .submenu ul {
    width: 100%;
    padding: 0px;
}

#popup-menu .submenu li {
}

/* Hover effect cho arrow */
#popup-menu ul li:hover .submenu-arrow {
    color: #fff;
}

/* Đảm bảo submenu items có hiệu ứng giống main menu */
#popup-menu .submenu ul:hover li a {
    color: #fff;
}

#popup-menu .submenu ul li:hover a {
    color: #fff;
    background-color: #d98c0a;
}
.back-btn {
    opacity: .5;
}
/* Đảm bảo close button luôn ở trên cùng */
.btn-close {
    opacity: 1;
    z-index: 1001;
}

#popup-menu .lang a{
    display: inline-block;
    padding: 5px 10px;
}
#popup-menu .lang {
    text-align: center;
    
}
