/* 
    Table of content
    1. MOBILE MENU
        1.1 Header
            1.1.1 Logo wrapper
            1.1.2 Menu wrapper
        1.2 Main
            1.2.1 Header main menu
                1.2.1.1 Second level
                1.2.1.2 Third level
            1.2.2 Header top menu
            1.2.3 Search
    2. SEARCH
    3. POPUP
*/

/* 1. MOBILE MENU */
.mobile-menu {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    background-color: white;
    display: none;
    overflow-y: auto;
}

/* 1.1 Header */
.mobile-menu .header .container {
    padding: .9rem 0;
    display: flex;
}

/* 1.1.1 Logo wrapper */
.mobile-menu .logo-wrapper {
    flex: 0 0 16.3rem;
}

.mobile-menu .logo-wrapper a {
    display: flex;
}

.mobile-menu .logo-wrapper img {
    width: auto;
    height: 7.4rem;
}

/* 1.1.2 Menu wrapper */
.mobile-menu .menu-wrapper {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.mobile-menu .close {
    position: relative;
    right: 1rem;
    width: 1.8rem;
    display: flex;
    justify-content: center;
    cursor: pointer;
}

/* 1.2 Main */
.mobile-menu .main {
    padding: 0;
}

.mobile-menu .main .row-lg {
    max-width: calc( var( --grid-size-lg) + ( var(--grid-padding) * 2 ) );
}

.mobile-menu .main .container {
    padding: 0 0 3rem;
}

.mobile-menu ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.mobile-menu ul a {
    color: var(--color-black);
    text-decoration: none;
}

.mobile-menu ul a:hover {
    text-decoration: underline;
}

.mobile-menu ul.menu > li:not(.phone) {
    border-bottom: .1rem solid #eee;
}

.mobile-menu ul.menu > li.menu-item-has-children {
    background-image: url(../images/icon-angle-down-black.svg);
    background-position: calc( 100% - calc( var(--grid-padding) + 1.5rem ) ) 2.6rem;
    background-repeat: no-repeat;
}

.mobile-menu ul.menu > li.menu-item-has-children.active {
    background-image: url(../images/icon-angle-up-black.svg);
}

/* 1.2.1 Header main menu */
.mobile-menu .menu-header-main-container ul.menu > li > a {
    display: inline-block;
    padding: 1.5rem var(--grid-padding);    
    font-family: 'Sarabun', sans-serif;
    font-size: 2rem;
    line-height: 1.3;
    font-weight: 700;
}

/* 1.2.1.1 Second level */
.mobile-menu ul.menu > li > ul {
    background-color: var(--color-lightgrey);
    display: none;
}

.mobile-menu ul.menu > li > ul > li:not(:last-child) {
    border-bottom: .1rem solid #ddd;
}

.mobile-menu ul.menu > li > ul > li {    
    background-image: url(../images/icon-plus-black.svg);
    background-repeat: no-repeat;
    background-position: calc(100% - 2.3rem) 1.9rem;
}

.mobile-menu ul.menu > li > ul > li.active {
    background-image: url(../images/icon-minus-black.svg);
    background-position: calc(100% - 2.3rem) 2.4rem;
}

.mobile-menu ul.menu > li > ul > li > a {
    display: inline-block;
    padding: 1.5rem var(--grid-padding);
    font-family: 'Sarabun', sans-serif;
    font-size: 1.6rem;
    line-height: 1.3;
    font-weight: 700;
}

/* 1.2.1.2 Third level */
.mobile-menu ul.menu > li > ul > li > ul {
    padding-bottom: 2rem;
    display: none;
}

.mobile-menu ul.menu > li > ul > li > ul > li > a {
    display: block;
    padding: .5rem calc( var(--grid-padding) + 2rem );
    font-size: 1.6rem;
    line-height: 1.3;
}

/* 1.2.2 Header top menu */
.mobile-menu .menu-header-top-container li {
    padding: 1rem var(--grid-padding);
}

.mobile-menu .menu-header-top-container li.phone {
    margin-top: 1.5rem;
}

.mobile-menu .menu-header-top-container a {         
    font-size: 1.8rem;
    line-height: 1.3;
}

.mobile-menu .menu-header-top-container li.phone i {
    margin-right: .5rem;
}

/* 1.2.3 Search */
.mobile-menu .searchform {
    margin-top: 1.5rem;
    padding: 0 var(--grid-padding);
}

.mobile-menu .searchform input[type="text" i] {
    background-color: var(--color-lightgrey);
}

.mobile-menu .searchform input[type="submit" i] {
    right: calc( var(--grid-padding) + .4rem );
}

/* 2. SEARCH */
.search-modal {
    position: fixed;
    z-index: 10;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,.88);
    display: none;
}

.search-modal .row-sm {
    height: 100%;
}

.search-modal .container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

.search-modal form {
    width: 100%;
}

/* 3. POPUP */
.popup-modal {
    position: fixed;
    z-index: 10;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,.63);
    overflow-y: auto;
    cursor: pointer;
    display: none;
}

.popup-modal .container {
    position: relative;
    margin-top: 23.5rem;
    padding: 5rem 6rem;
    border-radius: .5rem;
    background-color: white;
}

.popup-modal .close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 1.7rem;
    line-height: 1;
    color: var(--color-black);
    cursor: pointer;
}

.popup-modal .btn {
    display: block;
}

@media (max-width: 767px) {
    /* 3. POPUP */
    .popup-modal .container {
        margin-top: 7.5rem;
        padding: 5rem 3rem;
    }

    .popup-modal .close {
        font-size: 1.6rem;
    }
}