/*
Theme Name: Divi Child
Theme URI: http://www.elegantthemes.com/gallery/divi/
Template: Divi
Author: Elegant Themes
Description: Divi Child Theme
*/

/* ===============================
   MOBILE ONLY
================================ */
@media (max-width: 980px) {

    /* ===============================
     HEADER
  ================================ */

    /* header ปกติ */
    .et-db #et-boc .et-l.et-l--header {
        position: relative;
        top: 0;
        z-index: 99;
        box-shadow: var(--shadow-sm);
    }

    /* header ตอน sticky */
    .et-db #et-boc .et-l.et-l--header.et-fixed-header,
    .et-db #et-boc .et-l.et-l--header.et-sticky {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000005;
        /* สูงกว่า menu */
        box-shadow: var(--shadow-md);
    }

    /* กัน Divi สร้าง stacking context แปลก ๆ */
    header.et-l--header,
    header.et-l--header * {
        transform: none !important;
    }

    /* ===============================
     MENU BAR (logo + hamburger)
  ================================ */

    .et_pb_menu .et_pb_menu_inner_container {
        position: relative;
        z-index: 1000002;
    }

    .et_pb_menu__logo-wrap {
        position: relative;
        z-index: 1000003;
    }

    .et_pb_menu .mobile_menu_bar {
        position: relative;
        z-index: 1000004;
    }

    /* ===============================
     FULLSCREEN MOBILE MENU
  ================================ */

    .et_pb_menu .et_mobile_menu {
        position: fixed !important;
        top: 80px;
        /* ความสูง header */
        left: 0;
        right: 0;
        bottom: 0;

        width: 100vw !important;
        height: calc(100vh - 80px) !important;
        max-width: 100vw !important;

        margin: 0 !important;
        padding: 0;
        background: #fff;

        z-index: 1000001 !important;

        /* animation state (closed) */
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-16px);

        transition:
            opacity 0.35s ease,
            transform 0.35s ease,
            visibility 0s linear 0.35s;
    }

    /* ===== menu opened ===== */
    .et_pb_menu .mobile_nav.opened .et_mobile_menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);

        transition:
            opacity 0.4s cubic-bezier(.4, 0, .2, 1),
            transform 0.4s cubic-bezier(.4, 0, .2, 1);
    }

    body:has(.mobile_nav.opened) .top-header-promo {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        display: none;
    }

    /* ล็อค scroll เมื่อเมนูเปิด */
    body:has(.mobile_nav.opened) {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100vh;
    }
}

/* ===============================
   FOOTER
================================ */
.et-l .et-l--footer {
    position: relative;
    z-index: 0 !important;
}