
  /* --- Navbar Styles --- */
  .navbar {
      background-color: #4A708B;
      display: flex;
      justify-content: center;   
      align-items: center;
      padding: 0 20px;
      min-height: 100px;
      position: relative;
      z-index: 100; 
      box-shadow: 0 6px 6px rgba(111, 107, 107, 0.74);
  }

  /* กลุ่มเมนูหลัก */
  .nav-links {
      display: flex;
      list-style: none;
  }

  /* รายการเมนู */
  .nav-item {
      position: relative;
  }

  .nav-item > a {
      display: block;
      padding: 20px 15px;
      color: rgb(0, 0, 0);
      text-decoration: none;
      font-size: 16px;
      transition: 0.3s;
  }

  .nav-item:hover > a {
      background-color: #ffffff96;
      color: #e67e22;
  }

  /* --- Dropdown (เมนูย่อย) --- */
  .dropdownbar {
      position: absolute;
      top: 100%;
      left: 0;
      background-color: #ffffff;
      min-width: 200px;
      box-shadow: 0px 8px 16px rgba(240, 239, 239, 0.2);
      display: none;
      list-style: none;
      
      /* z-index ของ dropdown เอง (ต้องทำงานคู่กับ z-index ของ navbar) */
      z-index: 1001; 
      border-top: 3px solid #e67e22;
  }

  .dropdownbar li a {
      padding: 12px 16px;
      text-decoration: none;
      display: block;
      color: #333;
      border-bottom: 1px solid #eee;
  }

  .dropdownbar li a:hover {
      background-color: #000000;
      color: #e67e22;
      padding-left: 20px;
  }

  /* แสดง Dropdown เมื่อเอาเมาส์ชี้ */
  .nav-item:hover .dropdownbar {
      display: block;
  }

  /* --- ปุ่ม Hamburger --- */
  .hamburger {
      display: none;
      cursor: pointer;
      flex-direction: column;
      gap: 5px;
      position: absolute; 
      right: 20px;
  }

  .hamburger span {
      width: 25px;
      height: 3px;
      background-color: rgb(0, 0, 0);
      transition: 0.3s;
  }

  /* --- Responsive Styles --- */
  @media screen and (max-width: 768px) {
      .hamburger {
          display: flex;

          z-index: 1002; 
      }

      .nav-links {
          display: none;
          position: absolute;
          top: 60px;
          left: 0;
          width: 100%;
          background-color: #ffffff;
          flex-direction: column;
          text-align: left;
          
      }

      .nav-links.active {
          display: flex;
      }

      .nav-item {
          width: 100%;
          text-align: center; /* จัดตัวหนังสือกลางในมือถือ */
          border-bottom: 1px solid #ffffff;
      }
      
      .nav-item > a {
           padding: 15px;
      }

      .dropdownbar {
          position: static;
          width: 100%;
          box-shadow: none;
          border-top: none;
          background-color: #6fb2f0;
      }

      .dropdownbar li a {
          color: #000000;
          padding-left: 30px;
      }
      
      .nav-item:hover .dropdownbar {
          display: block;
      }
  }
  @media screen and (max-width: 1024px) {
      .hamburger {
          display: flex;

          z-index: 1002;
      }

      .nav-links {
          display: none;
          position: absolute;
          top: 60px;
          left: 0;
          width: 100%;
          background-color: #ffffff;
          flex-direction: column;
          text-align: left;

      }

      .nav-links.active {
          display: flex;
      }

      .nav-item {
          width: 100%;
          text-align: center;
          /* จัดตัวหนังสือกลางในมือถือ */
          border-bottom: 1px solid #ffffff;
      }

      .nav-item>a {
          padding: 15px;
      }

      .dropdownbar {
          position: static;
          width: 100%;
          box-shadow: none;
          border-top: none;
          background-color: #6fb2f0;
      }

      .dropdownbar li a {
          color: #000000;
          padding-left: 30px;
      }

      .nav-item:hover .dropdownbar {
          display: block;
      }
  }