body {
  margin: 0;
  padding-top: 80px;
  font-family: Arial, sans-serif;
}

/* 最外層 navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  width: 100%;
  height: 80px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  transition: top 0.6s ease, background-color 0.3s ease; /* 加了 background-color 的過渡動畫 */
  transform: translateY(0);
}

/* logo樣式 */
.logo-text {
  font-size: 24px;
  font-weight: bold;
  color: black;
  text-decoration: none;
  background: linear-gradient(90deg, #4CAF50, #00BCD4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text; /* Firefox 支援 */
  color: transparent;
  flex-shrink: 0;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;  /* 移除底線 */
}

.logo-wrapper:hover {
  opacity: 0.8; /* 淡淡的 hover 效果 */
}

.logo-side-img {
  height: 40px;
  border-radius: 4px;
}

/* 漢堡按鈕 */
.hamburger-btn {
  display: none; /* 桌面隱藏 */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger-btn .bar {
  width: 100%;
  height: 3px;
  background-color: #333;
  border-radius: 4px;
  transition: all 0.3s ease;
  transform-origin: 1px;
}

.hamburger-btn.active .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .bar:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}


/* nav連結 */
.nav-links {
  display: flex;
  flex-wrap: wrap;              /* 小螢幕時自動換行 */
  justify-content: center;      /* 水平置中對齊 */
  align-items: center;          /* 垂直置中對齊 */
  gap: 1rem;                    /* 自動間距 */
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-links li {
  margin: 0 15px;
  position: relative;
}

.nav-links li a {
  color: black;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;
  padding: 10px 15px;
  transition: background-color 0.3s, color 0.3s;
}

.nav-links li a:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #4CAF50;
  border-radius: 8px;
}

/* 滾動時變透明 */
.navbar.transparent {
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.cart-btn {
  margin-left: 20px;
  position: relative;
}

.cart-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

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

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: red;
  color: white;
  border-radius: 50%;
  font-size: 14px;
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
}
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: absolute;
  position: absolute; /* 🔑 相對於 .dropdown li 定位 */
  top: 100%; /* 緊貼按鈕下方 */
  left: 0;
  width: 100%;
  max-width: 80px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background-color: rgba(255, 255, 255, 0.0);
  min-width: 90px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  z-index: 2000;
}

.dropdown-content li a {
  display: block;
  padding: 0.5rem 1rem;
  background: linear-gradient(90deg, #01814A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text; /* Firefox 支援 */
  color: transparent;
  text-decoration: none;
  white-space: nowrap;
}

.dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
}

/* nav內部的容器 */
.nav-container {
  width: 100%;
  max-width: 2000px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: relative;
}

.nav-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 80px; /* navbar 高度 */
    right: 0;
    height: calc(100vh - 80px);
    width: 250px;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 1.5rem;
    z-index: 999;
    align-items: flex-start;
  }

  .nav-links.active {
    transform: translateX(0);
  }

  /* 漢堡按鈕顯示 */
  .hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
  padding: 0;
}

.hamburger-btn .bar {
  width: 100%;
  height: 3px;
  background-color: #333;
  border-radius: 4px;
  transition: all 0.3s ease;
  transform-origin: 1px; /* 旋轉原點 */
}

/* 打開時的X狀態 */
.hamburger-btn.active .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .bar:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}
}

@media (min-width: 769px) {
  .hamburger-btn {
    display: none; /* ✅ 桌面版不顯示漢堡 */
  }
}