.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;
  }
}

/* Food Safety Modal Overlay */
.food-safety-modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.food-safety-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.food-safety-modal {
  width: min(520px, 100%);
  background: #ffffff;
    border-radius: 22px;
    padding: 32px 30px;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.22);
    text-align: center;
    transform: translateY(20px);
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
  }

  .food-safety-modal-overlay.active .food-safety-modal {
    transform: translateY(0);
    opacity: 1;
  }

  .food-safety-modal__icon {
    font-size: 44px;
    margin-bottom: 16px;
    color: #d32f2f;
  }

  .food-safety-modal__title {
    margin: 0 0 16px;
    color: #1d1d1d;
    font-size: 22px;
    font-weight: 700;
  }

  .food-safety-modal__message {
    margin: 0 auto 28px;
    max-width: 460px;
    color: #4d4d4d;
    font-size: 15px;
    line-height: 1.75;
    text-align: center;
    white-space: pre-wrap;
    word-break: break-word;
  margin-bottom: 10px;
}

.food-safety-modal__actions {
  display: grid;
  gap: 12px;
    margin-top: 12px;
  }

  .food-safety-modal__link,
  .food-safety-modal__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    border-radius: 999px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
  background: #d32f2f;
  color: #ffffff;
}

.food-safety-modal__link:hover {
  background: #b42828;
}

.food-safety-modal__button {
  background: #f5f5f5;
  color: #333333;
  cursor: pointer;
}

.food-safety-modal__button:hover {
  background: #e8e8e8;
    transform: translateY(-1px);
  }

  .food-safety-modal__link:hover {
    transform: translateY(-1px);
  opacity: 0;
}

@keyframes titleBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

@media (max-width: 768px) {
  .food-safety-modal {
    padding: 24px 20px;
  }

  .food-safety-modal__title {
    font-size: 20px;
  }

  .food-safety-modal__message {
    text-align: center;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
  }
}

@media (max-width: 480px) {
  .food-safety-modal {
    padding: 20px 16px;
  }

  .food-safety-modal__message {
    font-size: 14px;
  }
}
