.header {
  width: 100%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: fixed;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

.header__container {
  margin: 0 auto;
  padding: 0 20px;
  border-bottom: 4px solid var(--secondary-color);
}

/* ========================================
   Logo Section
   ======================================== */
.header__logo-section {
  padding-top: 12px;
  text-align: center;
  position: relative;
}

.header__logo {
  display: inline-block;
}

.header__logo img {
  width: 100px;
  height: auto;
  transition: height 0.3s ease, width 0.3s ease;
}

/* ========================================
   Navigation Menu
   ======================================== */
.header__nav-list {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.header__nav-item {
  position: relative;
}

.header__nav-link {
  display: block;
  padding: 12px 25px;
  font-size: 14px;
  color: var(--text-dark);
  position: relative;
  transition: var(--transition);
}

/* Active 狀態 */
.header__nav-link.active {
  color: var(--secondary-color);
  font-weight: 700;
}

/* Navigation Separator */
.header__nav-separator {
  color: #333;
  font-weight: 300;
  user-select: none;
}

/* ========================================
   Mobile Menu Toggle Button
   ======================================== */
.header__mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
  width: 24px;
  height: 24px;
  padding: 0;
}

/* Toggle icons using mask-image */
.header__toggle-menu,
.header__toggle-close {
  display: block;
  width: 100%;
  height: 100%;
  background-color: var(--text-dark);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.header__toggle-menu {
  -webkit-mask-image: url('../images/icons/menu.svg');
  mask-image: url('../images/icons/menu.svg');
}

.header__toggle-close {
  display: none;
  -webkit-mask-image: url('../images/icons/close.svg');
  mask-image: url('../images/icons/close.svg');
}

/* Active state - show close, hide menu */
.header__mobile-toggle.active .header__toggle-menu {
  display: none;
}

.header__mobile-toggle.active .header__toggle-close {
  display: block;
}

/* ========================================
   Scrolled State - Desktop Only
   ======================================== */
@media (min-width: 1025px) {
  .header--scrolled .header__container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 0;
    gap: 20px;
  }

  .header--scrolled .header__logo-section {
    padding-top: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
  }

  .header--scrolled .header__logo img {
    height: 54px;
    width: auto;
  }

  .header--scrolled .header__nav {
    flex: none;
  }
}

/* ========================================
   Responsive Design - Tablet (1024px)
   ======================================== */
@media (max-width: 1024px) {
  .header__logo-section {
    padding-bottom: 12px;
    display: flex;
    align-items: center;
  }

  .header__logo img {
    width: 80px;
  }

  /* 顯示漢堡選單按鈕 */
  .header__mobile-toggle {
    display: block;
  }

  /* 隱藏桌機版導航，改用滿版 mobile-menu */
  .header__nav {
    display: none;
  }
}

/* ========================================
   Responsive Design - Mobile (768px)
   ======================================== */
@media (max-width: 768px) {
  .header__logo img {
    width: 55px;
  }
}

/* ========================================
   Responsive Design - Small Mobile (480px)
   ======================================== */
@media (max-width: 480px) {
  .header__container {
    padding: 0 20px;
  }
}

/* ========================================
   Mobile Full-Screen Menu
   ======================================== */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 9999;
  flex-direction: column;
  background-color: #f8f8f8;
}

.mobile-menu.active {
  display: flex;
}

.menu-header {
  background-color: #c20000;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 40px;
  cursor: pointer;
}

.back-arrow {
  width: 10px;
  height: 20px;
  flex-shrink: 0;
}

.back-text {
  color: #ffffff;
  font-size: 14px;
  font-weight: normal;
  line-height: 1.5;
}

.menu-content {
  background-color: #fefefe;
  flex: 1;
  padding: 50px 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.menu-links {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-bottom: 20px;
}

.menu-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  text-decoration: none;
}

.menu-toggle-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.menu-item.expanded .menu-toggle-icon {
  transform: rotate(180deg);
}

.menu-title {
  color: #333333;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.menu-divider {
  width: 100%;
  height: 1px;
  background-color: #cccccc;
}

.submenu {
  display: none;
  flex-direction: column;
  gap: 20px;
  padding-left: 0;
  padding-top: 10px;
  animation: slideDown 0.3s ease-out;
}

.menu-item.expanded .submenu {
  display: flex;
}

.submenu-link {
  color: #333333;
  font-size: 14px;
  font-weight: normal;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.2s ease;
}

.submenu-link:hover {
  color: #c20000;
}

.social-media {
  display: flex;
  gap: 12px;
  padding-top: 20px;
  margin-top: auto;
}

.social-icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.social-icon:hover {
  transform: scale(1.1);
}

.social-icon svg {
  width: 100%;
  height: 100%;
}

.menu-link:active .menu-title {
  color: #c20000;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .menu-header {
    padding: 0 20px;
  }
}