/* The original header images and layout remain the desktop presentation. */
.office-bkk-contact-label,
.office-bkk-contact-icon {
    display: none;
}

@media only screen and (max-width: 1023px) {
    #header_wrapper_kai {
        padding: 16px 0 !important;
    }

    #header_wrapper_kai > header.container {
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: calc(100% - 32px) !important;
        max-width: 720px;
        padding: 0 !important;
        margin: 0 auto !important;
        float: none !important;
    }

    #header_wrapper_kai > header.container::before,
    #header_wrapper_kai > header.container::after,
    .nav_wrap > nav.container::before,
    .nav_wrap > nav.container::after {
        content: none !important;
        display: none !important;
    }

    #header_wrapper_kai .header_left_section,
    body.office-bkk-has-bottom-contact #header_wrapper_kai .header_right_section {
        box-sizing: border-box;
        width: 100% !important;
        min-width: 0;
        float: none !important;
        padding: 0 !important;
        margin: 0 !important;
        text-align: center !important;
    }

    #header_wrapper_kai .header_left_section > a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        max-width: 100%;
    }

    #header_wrapper_kai .header_left_section .logo {
        display: block;
        width: auto;
        max-width: 100%;
        max-height: 50px;
        height: auto;
        float: none !important;
        margin: 0 auto !important;
    }

    /* Keep the mobile header to the logo and navigation only. */
    #header_wrapper_kai .header_right_section {
        display: none !important;
    }

    .nav_wrap .lung_th_en a:focus-visible {
        outline: 3px solid #ffb546;
        outline-offset: 3px;
    }

    .nav_wrap {
        box-sizing: border-box;
        width: 100% !important;
        max-width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .nav_wrap > nav.container {
        box-sizing: border-box;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        width: calc(100% - 32px) !important;
        max-width: 720px;
        margin: 0 auto !important;
        padding: 8px 0 !important;
    }

    .nav_wrap nav .lung_th_en {
        position: static;
        width: auto;
        min-width: 0;
        padding: 0 !important;
        margin: 0 !important;
        float: none;
        white-space: nowrap;
    }

    .nav_wrap .lung_th_en ul {
        margin: 0 !important;
    }

    .nav_wrap .lung_th_en a {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        min-height: 44px;
        padding: 0 3px;
        color: #fff !important;
        font-size: 18px;
        line-height: 1.2;
    }

    .nav_wrap #myslidemenu {
        box-sizing: border-box;
        width: 100% !important;
        min-width: 0;
        min-height: 0;
        margin: 0 !important;
        padding: 0 !important;
    }

    .nav_wrap #myslidemenu select {
        box-sizing: border-box;
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: 44px;
        min-height: 44px;
        margin: 0;
        padding: 6px 10px;
        background: #fff;
        color: #24394b;
        border: 1px solid #d6e0e6;
        border-radius: 4px;
        font-family: inherit !important;
        font-size: 20px;
        line-height: 1.2;
    }
}

/* These nodes are created from the existing contact links; no new destinations. */
.office-bkk-bottom-contact,
.office-bkk-contact-spacer {
    display: none;
}

@media only screen and (max-width: 1023px) {
    .office-bkk-bottom-contact {
        box-sizing: border-box;
        display: block;
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        height: auto;
        margin: 0;
        float: none;
        z-index: 1000;
        padding: 6px 12px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        border-top: 1px solid #d6e0e6;
        box-shadow: 0 -2px 8px rgba(25, 45, 65, 0.12);
    }

    .office-bkk-bottom-contact-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px;
        max-width: 720px;
        margin: 0 auto;
    }

    .office-bkk-bottom-contact-inner[data-contact-count="1"] {
        grid-template-columns: minmax(0, 1fr);
    }

    .office-bkk-bottom-contact a {
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-height: 48px;
        min-width: 0;
        margin: 0 !important;
        padding: 8px 10px;
        border-radius: 4px;
        color: #fff !important;
        font-family: inherit !important;
        font-size: 20px;
        line-height: 1.2;
        text-decoration: none;
        float: none !important;
    }

    .office-bkk-bottom-contact .office-bkk-contact-phone {
        background: #275783;
    }

    .office-bkk-bottom-contact .office-bkk-contact-line {
        background: #087f37;
    }

    .office-bkk-bottom-contact .office-bkk-contact-label {
        display: inline;
    }

    .office-bkk-bottom-contact .office-bkk-contact-icon {
        display: block;
        width: 20px;
        height: 20px;
        flex: 0 0 20px;
    }

    .office-bkk-bottom-contact a:focus-visible {
        outline: 3px solid #e58d13;
        outline-offset: 2px;
    }

    .office-bkk-contact-spacer {
        display: block;
        clear: both;
        height: 57px;
        height: calc(57px + env(safe-area-inset-bottom, 0px));
    }

    body.office-bkk-contact-editing .office-bkk-bottom-contact {
        visibility: hidden;
        pointer-events: none;
    }

    body.office-bkk-has-bottom-contact .scroll_top {
        bottom: calc(var(--office-bkk-bottom-contact-height, 57px) + 12px) !important;
    }
}

@media only screen and (max-width: 1023px) {
    .office-bkk-bottom-contact-inner[data-contact-count="3"] {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
        gap: 6px;
    }
    .office-bkk-bottom-contact-inner[data-contact-count="3"] a {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 4px;
        white-space: nowrap;
        min-height: 44px;
        padding: 6px 4px;
        font-size: 18px;
    }
    .office-bkk-bottom-contact .office-bkk-contact-facebook {
        background: #0866ff;
    }
}

@media only screen and (max-width: 1023px) {
    .office-bkk-bottom-contact-inner[data-contact-count="3"] .office-bkk-contact-icon {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }
}
