/* 手機版導覽列版型配置 */
@media (max-width: 991.98px) {
  .custom-navbar { padding: 1rem 0; }
  .custom-navbar .container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: relative;
    width: 100%;
  }
  .navbar-brand {
    position: static !important;
    transform: none !important;
    margin: 0 auto !important;
    padding: 0;
    display: flex !important;
    justify-content: center;
    align-items: center;
  }
  #mobileMenuBtn {
    width: 35px;
    text-align: left;
    background: none;
    box-shadow: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
  }
  #mobileMenuBtn:focus,
  #mobileMenuBtn:active {
    outline: none !important;
    box-shadow: none !important;
  }
  .mobile-spacer {
    width: 35px;
    height: 1px;
    display: block !important;
  }
  .navbar-collapse {
    display: none !important;
  }
}
@media (min-width: 992px) {
  .mobile-spacer {
    display: none !important;
  }
}

/* 精品漢堡 → X 動畫系統 */
.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  width: 22px;
  height: 16px;
  position: relative;
  cursor: pointer;
}

.hamburger-icon span {
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--dark-charcoal);
  border-radius: 2px;
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity  0.3s cubic-bezier(0.4, 0, 0.2, 1),
    top        0.4s cubic-bezier(0.4, 0, 0.2, 1),
    width      0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
}

.hamburger-icon .line-top    { top: 0px; }
.hamburger-icon .line-middle { top: 7px; }
.hamburger-icon .line-bottom { top: 14px; width: 75%; }

.hamburger-icon.is-open .line-top {
  top: 7px;
  transform: rotate(45deg);
}
.hamburger-icon.is-open .line-middle {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger-icon.is-open .line-bottom {
  top: 7px;
  width: 100%;
  transform: rotate(-45deg);
}

/* 手機版全螢幕選單互動外框 */
@media (max-width: 991.98px) {
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: none;
    transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 1rem 2rem;
    overflow-y: auto;
  }
  
  .mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  
  .mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 40px;
  }
  
  .mobile-menu-close {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), color 0.3s ease;
    transform: rotate(-45deg);
    position: relative;
  }

  .mobile-menu-close::before,
  .mobile-menu-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 1.5px;
    background-color: var(--dark-charcoal);
    border-radius: 2px;
    transition: background-color 0.3s ease;
  }
  .mobile-menu-close::before { transform: rotate(45deg); }
  .mobile-menu-close::after  { transform: rotate(-45deg); }

  .mobile-menu-overlay.active .mobile-menu-close {
    transform: rotate(0deg);
  }

  .mobile-menu-close:hover::before,
  .mobile-menu-close:hover::after {
    background-color: var(--primary-gold);
  }

  .mobile-menu-content {
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    padding: 0 1.5rem;
  }
  
  .mobile-menu-item {
    padding: 0.65rem 0;
  }
  
  .mobile-menu-link {
    color: var(--dark-charcoal);
    font-size: 1rem;
    font-family: 'Noto Sans TC', sans-serif;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 300;
    letter-spacing: 0.08em;
    transition: color 0.3s ease;
  }

  .mobile-menu-link:hover {
    color: var(--primary-gold);
  }
  
  .mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    padding-left: 0.5rem;
  }
  
  .mobile-submenu.show {
    max-height: 600px;
    margin-top: 0.4rem;
  }
  
  .mobile-submenu a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
  }

  .mobile-submenu a:hover {
    color: var(--primary-gold);
  }
  
  .mobile-menu-link .fa-chevron-down {
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    font-size: 0.85rem;
    color: #A0A0A0;
  }
  
  .mobile-menu-link.open {
    color: var(--primary-gold);
  }
  
  .mobile-menu-link.open .fa-chevron-down {
    transform: rotate(180deg);
    color: var(--primary-gold);
  }
}

@media (min-width: 992px) {
  .mobile-menu-overlay {
    display: none !important;
  }
}