/* ------------------------------------------------------------------
 * nav.css — แถบบนสุดและเมนูหลัก
 * ------------------------------------------------------------------ */

/* ================= แถบบนสุด ================= */
.mhs-topbar {
    background: linear-gradient(120deg, #bd0101 0%, #8f0000 100%);
    color: #fff;
    font-size: 14.5px;
}

.mhs-topbar-inner {
    max-width: 1170px;
    margin: 0 auto;
    padding: 9px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.mhs-topbar-brand {
    font-weight: 600;
    letter-spacing: .2px;
}

.mhs-topbar-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.mhs-topbar-links a {
    color: #fff !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: .95;
    transition: opacity .15s ease;
}

.mhs-topbar-links a:hover {
    opacity: 1;
    text-decoration: underline !important;
}

/* ================= แถบเมนูหลัก ================= */
.mhs-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
    transition: box-shadow .22s ease;
}

/* เลื่อนหน้าลงมาแล้วให้มีเงาชัดขึ้น จะได้แยกออกจากเนื้อหา */
.mhs-header.is-stuck {
    box-shadow: 0 6px 22px rgba(0, 0, 0, .12);
}

.mhs-header-inner {
    max-width: 1170px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 84px;
    transition: min-height .22s ease;
}

.mhs-header.is-stuck .mhs-header-inner {
    min-height: 66px;
}

/* ---------- โลโก้ ---------- */
.mhs-logo {
    flex: none;
    display: flex;
    align-items: center;
}

.mhs-logo img {
    height: 52px;
    width: auto;
    display: block;
    transition: height .22s ease;
}

.mhs-header.is-stuck .mhs-logo img {
    height: 42px;
}

/* ---------- เมนูจอคอม ---------- */
.mhs-menu {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.mhs-menu > ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2px;
}

.mhs-menu > ul > li {
    position: relative;
}

.mhs-menu > ul > li > a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 13px;
    font-size: 15.5px;
    color: #444 !important;
    text-decoration: none !important;
    border-radius: 8px;
    white-space: nowrap;
    transition: color .16s ease, background .16s ease;
}

.mhs-menu > ul > li > a i {
    font-size: 10px;
    opacity: .6;
    transition: transform .2s ease;
}

.mhs-menu > ul > li > a:hover,
.mhs-menu > ul > li > a.is-active {
    color: #a10000 !important;
    background: #fdf5f5;
}

/* ขีดใต้เมนูที่กำลังเปิดอยู่ */
.mhs-menu > ul > li > a.is-active::after {
    content: '';
    position: absolute;
    left: 13px;
    right: 13px;
    bottom: 2px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #d94b00, #a10000);
}

.mhs-menu > ul > li.is-admin > a {
    color: #fff !important;
    background: linear-gradient(135deg, #d94b00, #a10000);
    margin-left: 6px;
}

.mhs-menu > ul > li.is-admin > a.is-active::after {
    display: none;
}

/* ---------- เมนูย่อย ---------- */
.mhs-submenu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 268px;
    list-style: none;
    margin: 0;
    padding: 8px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, .16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.mhs-menu > ul > li.has-child:hover .mhs-submenu,
.mhs-menu > ul > li.has-child:focus-within .mhs-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mhs-menu > ul > li.has-child:hover > a i {
    transform: rotate(180deg);
}

.mhs-submenu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 15px;
    color: #444 !important;
    text-decoration: none !important;
    transition: background .15s ease, color .15s ease;
}

.mhs-submenu a i {
    width: 18px;
    text-align: center;
    color: #a10000;
    opacity: .85;
    font-size: 14px;
}

.mhs-submenu a:hover,
.mhs-submenu a.is-active {
    background: #fdf5f5;
    color: #a10000 !important;
}

.mhs-submenu-all {
    border-top: 1px solid #f0f0f0;
    margin-top: 6px;
    padding-top: 6px;
}

.mhs-submenu-all a {
    font-weight: 600;
    color: #a10000 !important;
}

/* ---------- ปุ่มขวาสุด ---------- */
.mhs-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.mhs-header-call {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    color: #fff !important;
    text-decoration: none !important;
    background: linear-gradient(135deg, #ff9000, #ef6c00);
    box-shadow: 0 4px 14px rgba(239, 108, 0, .35);
    transition: transform .18s ease, box-shadow .18s ease;
}

.mhs-header-call:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 108, 0, .45);
}

/* ---------- ปุ่มแฮมเบอร์เกอร์ ---------- */
.mhs-burger {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: #f4f4f4;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
}

.mhs-burger span {
    display: block;
    width: 21px;
    height: 2.5px;
    border-radius: 3px;
    background: #a10000;
    transition: transform .25s ease, opacity .2s ease;
}

.mhs-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.mhs-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mhs-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ================= เมนูมือถือ (แผงเลื่อน) ================= */
.mhs-drawer-scrim {
    position: fixed;
    inset: 0;
    z-index: 1998;
    background: rgba(20, 10, 10, .45);
    opacity: 0;
    transition: opacity .25s ease;
}

.mhs-drawer-scrim[hidden] { display: none; }
.mhs-drawer-scrim.is-open { opacity: 1; }

.mhs-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 86%;
    max-width: 340px;
    z-index: 1999;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 30px rgba(0, 0, 0, .2);
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}

.mhs-drawer[hidden] { display: none; }
.mhs-drawer.is-open { transform: translateX(0); }

.mhs-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.mhs-drawer-head img {
    height: 40px;
    width: auto;
}

.mhs-drawer-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: #f4f4f4;
    color: #a10000;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.mhs-drawer-menu {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
    -webkit-overflow-scrolling: touch;
}

.mhs-drawer-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mhs-drawer-menu > ul > li > a,
.mhs-drawer-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 14px;
    border: 0;
    background: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16.5px;
    color: #333 !important;
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
}

.mhs-drawer-menu > ul > li > a.is-active,
.mhs-drawer-toggle.is-active {
    background: #fdf5f5;
    color: #a10000 !important;
    font-weight: 600;
}

.mhs-drawer-toggle i {
    font-size: 12px;
    opacity: .6;
    transition: transform .22s ease;
}

.mhs-drawer-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.mhs-drawer-sub {
    padding-left: 8px !important;
    margin-bottom: 6px !important;
}

.mhs-drawer-sub[hidden] { display: none; }

.mhs-drawer-sub a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 15px;
    color: #666 !important;
    text-decoration: none !important;
}

.mhs-drawer-sub a i {
    width: 18px;
    text-align: center;
    color: #a10000;
    opacity: .8;
}

.mhs-drawer-sub a.is-active {
    background: #fdf5f5;
    color: #a10000 !important;
}

.mhs-drawer-foot {
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #eee;
    display: grid;
    gap: 8px;
}

.mhs-drawer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px;
    border-radius: 30px;
    font-size: 15.5px;
    font-weight: 600;
    color: #fff !important;
    text-decoration: none !important;
}

.mhs-drawer-btn.is-call { background: linear-gradient(135deg, #ff9000, #ef6c00); }
.mhs-drawer-btn.is-line { background: linear-gradient(135deg, #22c55e, #06a64a); }

/* ล็อกไม่ให้หน้าเลื่อนตอนเปิดเมนู */
body.mhs-drawer-open {
    overflow: hidden;
}

/* ================= จุดสลับจอ ================= */
@media (min-width: 992px) {
    .mhs-burger { display: none; }
    .mhs-header-call { display: inline-flex; }
}

@media (max-width: 991px) {
    .mhs-menu { display: none; }

    .mhs-header-inner {
        min-height: 68px;
        justify-content: space-between;
    }

    .mhs-header.is-stuck .mhs-header-inner { min-height: 60px; }
    .mhs-logo img { height: 42px; }
    .mhs-header.is-stuck .mhs-logo img { height: 38px; }
}

@media (max-width: 575px) {
    .mhs-topbar { font-size: 13px; }
    .mhs-topbar-inner { justify-content: center; text-align: center; gap: 6px; padding: 8px 12px; }
    .mhs-topbar-brand { width: 100%; }
    .mhs-topbar-links { justify-content: center; gap: 12px; }
    .mhs-logo img { height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
    .mhs-header,
    .mhs-header-inner,
    .mhs-logo img,
    .mhs-submenu,
    .mhs-drawer,
    .mhs-drawer-scrim,
    .mhs-burger span,
    .mhs-drawer-toggle i {
        transition: none !important;
    }
}
