/* --- 1. พื้นหลังแถบเมนูยาวเต็มจอ --- */
.midbar-menu-outer {
    background: linear-gradient(180deg, #ff9a9e 0%, #fc7c82 100%);
    /*width: 100%;
    background: linear-gradient(90deg, #f8c4c7 0%, #f19dbb 100%);
    box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;*/
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-radius: 8px 8px 8px 8px;
    position: relative;
    z-index: 1000; /* ให้เมนูอยู่เหนือเนื้อหาด้านล่าง */
    max-width: 1140px; /* ขนาด Container มาตรฐานของ KBank */
    margin: 0 auto;
    margin-top: 10px;
    padding: 0 15px;
    height: 54px; /* ความสูงแถบเมนูกสิกรโดยประมาณ */
    display: flex;
    justify-content: center;
    overflow: visible !important;
}
@media only screen and (min-width: 768px) and (max-width: 991px) {
    .midbar-menu-outer {
        display: none;
    }
}

/* --- 2. ส่วนคุมความกว้างและจัดกึ่งกลาง --- */
.midbar-menu-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center; /* จัดเมนูกองตรงกลาง */
    overflow: visible !important;
}

.menu-wrapper {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 60px; /* ความสูงของแถบเมนู */
}

/* --- 3. รายการเมนูหลัก --- */
.menu-item {
    position: relative; /* สำคัญมาก: เป็นฐานให้ Sub-menu */
    height: 100%;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 100%;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.menu-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.menu-link i {
    margin-left: 8px;
    font-size: 12px;
}

/* --- 4. เส้นคั่น Vertical Divider --- */
.menu-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.4);
    margin: 0 10px;
}

/* --- 5. เมนูย่อย (Sub Menu) --- */
.sub-menu2 {
    position: absolute;
    top: 100%; /* กางจากขอบล่างพอดี */
    left: 50%;
    transform: translateX(-50%) translateY(10px); /* จัดกลางและขยับลงนิดนึงเพื่อความสวยงาม */
    
    background: #ffffff;
    min-width: 200px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 10px 0;
    margin: 0;
    list-style: none;
    
    /* สภาวะเริ่มต้น: ซ่อนไว้ */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}

/* --- 6. สั่งให้ทำงาน (แสดงเมื่อ Hover) --- */
.menu-item:hover .sub-menu2 {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* --- 7. ลิงก์ข้างในเมนูย่อย --- */
.sub-menu2 li a {
    display: block;
    padding: 12px 20px;
    color: #444 !important;
    text-decoration: none;
    font-size: 14px;
    text-align: left;
    transition: all 0.2s;
}

.sub-menu2 li a:hover {
    background-color: #f8c4c7; /* สีชมพูอ่อนที่คุณเลือก */
    color: #f19dbb !important; /* ตัวอักษรสีชมพูเข้ม */
}
/* @media (max-width: 768px) คือการระบุว่าถ้าหน้าจอกว้างน้อยกว่า 768px (มือถือ/แท็บเล็ต) */
@media (max-width: 768px) {
    .midbar-menu-outer {
        display: none !important;

    }
}
@media (max-width: 768px) {
    .sub-menu2 {
       /* display: none !important;*/
    }
}
.header_top{
    position: relative;
    max-width: 1140px;
    margin: 0 auto;
    margin-top: 10px;
}


/* Headder*/
  .main_menu nav > ul > li > a  { color: #f70c0c;}
  .header_four { background: #f5f5f5;  }
  .search_container{margin-right: 10px;}
  .search_box input { height: 25px;padding: 0 70px 0 5px;}
  .footer_top {    background: #2C3E50;color: #ffffff;}
  .footer_bottom {background: #D81B60; color: #ffffff;}
        
        /* 1. ซ่อนเมนูนี้ในสภาวะปกติ (ทั้ง Desktop และ Mobile) */
  .header_middle.sticky-header {
    display: none;
  }
  @media (min-width: 992px) {
      .header_middle.sticky-header.sticky { /* เปลี่ยน .sticky เป็นคลาสที่ระบบของคุณใช้ */
          display: block !important;
          position: fixed;
          top: 0;
          width: 100%;
          z-index: 999;
          background: #ffffff; /* ปรับสีพื้นหลังตามต้องการ */
          box-shadow: 0 4px 10px rgba(0,0,0,0.1);
      }
  }

  /* 3. ยืนยันการซ่อนในหน้าจอมือถือเสมอ แม้จะ Sticky ก็ตาม */
  @media (max-width: 991px) {
      .header_middle.sticky-header,
      .header_middle.sticky-header.sticky {
          display: none !important;
      }
  }

