.navbar {
  position: absolute; /* 讓導覽列絕對定位 */
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background-color: transparent;
  padding: 0 20px;
  margin-top: 20px;
  height: 70px;
  z-index: 3;
}
/* LOGO */
.navbar-logo {
  width: 90px;
  height: 50px;
  background: url(../../Images/Logo/Logo.png) transparent 50% / cover no-repeat;
  transition: width 0.3s ease, height 0.3s ease;
  overflow: hidden;
}

/* 叫出側選單後畫面無法滾動、點擊周圍 */
.no-scroll {
  overflow: hidden;
  touch-action: none;
}
.no-click {
  position: fixed;
  inset: 0;
  background: transparent;
  pointer-events: none;
  z-index: 2;
  transition: background 0.3s;
}

/* 漢堡按鈕 */
.hamburger {
  width: 38px;
  height: 38px;
}
.hamburger path {
  transition: all 0.3s ease-in-out;
  transform-origin: center;
}
/* 選單切換 */
.menu-toggle {
  cursor: pointer;
  position: relative;
  z-index: 5;
}
.menu-checkbox {
  display: none;
}
/* 當 checkbox 被選取時，顯示選單 */
.menu-checkbox:checked ~ .nav-menu {
  right: 0;
}
/* 漢堡線條變成 X */
.menu-checkbox:checked + .menu-toggle .top {
  transform: rotate(45deg) translate(5px, 5px);
  transform-origin: center;
}
.menu-checkbox:checked + .menu-toggle .middle {
  opacity: 0;
}
.menu-checkbox:checked + .menu-toggle .bottom {
  transform: rotate(-45deg) translate(4.3px, -4.3px);
  transform-origin: center;
}

/* 側邊選單 (初始隱藏)*/
.nav-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 75%;
  height: 100vh;
  background: rgba(29, 29, 31, 0.9);
  backdrop-filter: blur(10px);
  transition: right 0.3s ease-in-out;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 80px 20px 20px;
  color: #fbfbfb;
}

/* 主選單 */
.menu-list {
  list-style: none;
  width: 100%;
  padding-left: 30px;
  font-size: 25px;
  text-align: left;
}
.menu-item {
  padding: 10px 0;
  margin-bottom: 25px;
  font-size: 16px;
}

/* 沒有子選單專用(首頁) */
.submenu-title-lonely {
  text-decoration: none;
  font-size: 25px;
  color: #fbfbfb;
}
/* 子選單 */
.submenu-menu {
  display: none;
  list-style: none;
  padding-left: 25px;
  margin-top: 0;
  text-align: left;
}
/* 子選單線條 */
.submenu-line {
  display: none;
  height: 1px;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.2);
  margin-top: 5px;
  margin-bottom: 15px;
  transform: scaleX(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
/* 子選單標題（label 外觀） */
.submenu-title {
  display: block;
  cursor: pointer;
  font-size: 25px;
  text-align: left;
}
/* 子選單細項 */
.submenu-item {
  padding: 10px 0;
  font-size: 16px;
}
.submenu-item a {
  text-decoration: none;
  color: #fbfbfb;
}

/* 隱藏 checkbox 本體 */
.submenu-checkbox {
  display: none;
}

/* 點擊 checkbox（在 label 裡）後展開對應子選單 */
.has-submenu:has(.submenu-checkbox:checked) .submenu-menu {
  display: block;
}
.has-submenu:has(.submenu-checkbox:checked) .submenu-line {
  display: block;
  transform: scaleX(1);
}

/* 導覽列改樣式 */
.navbar-change {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #1e1e1e;
  padding: 0 20px;
  margin: 0;
  height: 70px;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.navbar-change .navbar-logo {
  width: 80px;
  height: 44px;
}

@media (max-width: 429px) {
  .submenu-title-lonely,
  .submenu-title {
    font-size: 20px;
  }
}
@media (min-width: 768px) {
  .navbar {
    height: 120px;
  }
  .navbar-logo {
    width: 135px;
    height: 75px;
  }
  .hamburger {
    width: 57px;
    height: 57px;
  }
  .navbar-change .navbar-logo {
    width: 120px;
    height: 66px;
  }
}
