/* ═══════════════════════════════════════════════════════════════
   移动端菜单样式 - H5 响应式
   ═══════════════════════════════════════════════════════════════ */

/* 移动端菜单按钮 - 默认隐藏 */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10000;
  position: relative;
}

.mobile-menu-toggle span {
  width: 100%;
  height: 3px;
  background-color: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* 移动端菜单容器 */
.mobile-menu-overlay {
  display: none !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.5) !important;
  z-index: 9998 !important;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  display: block !important;
  opacity: 1 !important;
}

.mobile-menu-panel {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  /* 用 transform 而非 right:-100% 隐藏：transform 不计入 scrollWidth，
     避免在桌面/未打开时留下一条 ~280px 的幽灵横向溢出（旧写法把面板
     实际布局到视口右侧之外）。translateX(100%) = 整体推到视口右缘之外。 */
  transform: translateX(100%) !important;
  width: 80% !important;
  max-width: 320px !important;
  height: 100% !important;
  background: #192a44 !important;
  z-index: 9999 !important;
  overflow-y: auto !important;
  transition: transform 0.3s ease !important;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3) !important;
}

.mobile-menu-panel.active {
  transform: translateX(0) !important;
}

/* 移动端菜单头部 */
.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-header .logo {
  width: 48px;
  height: 45px;
}

.mobile-menu-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 移动端导航链接 */
.mobile-menu-nav {
  padding: 0;
}

.mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu-list li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-list a {
  display: block;
  padding: 18px 20px;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  position: relative;
}

.mobile-menu-list a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background-color: #bc994b;
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.mobile-menu-list a:hover,
.mobile-menu-list a:active {
  background-color: rgba(188, 153, 75, 0.15);
  padding-left: 30px;
  color: #bc994b;
}

.mobile-menu-list a:hover::before,
.mobile-menu-list a:active::before {
  transform: scaleY(1);
}

/* 移动端菜单底部 */
.mobile-menu-footer {
  padding: 20px;
  margin-top: 20px;
}

.mobile-menu-footer .btn-join-mobile {
  width: 100%;
  background-color: #f7f1e8;
  color: #192a44;
  border: none;
  border-radius: 8px;
  height: 48px;
  font-size: 14px;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 16px;
}

.mobile-menu-footer .cart-btn-mobile {
  width: 100%;
  background-color: #bc994b;
  border-radius: 8px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
  cursor: pointer;
}

.mobile-menu-footer .cart-badge {
  background-color: #fff;
  color: #bc994b;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

/* 移动端响应式 - 小于 768px 显示汉堡菜单 */
@media (max-width: 768px) {
  /* 固定顶部导航栏 */
  .main-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: rgba(25, 42, 68, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    z-index: 1000 !important;
    padding: 12px 0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  }

  /* 为固定导航栏腾出空间 */
  .hero-section {
    padding-top: 80px !important;
  }

  /* 隐藏 PC 端导航 */
  .nav-links {
    display: none !important;
  }

  .btn-join {
    display: none !important;
  }

  .cart-btn {
    display: none !important;
  }

  /* 显示汉堡菜单按钮 */
  .mobile-menu-toggle {
    display: flex;
    margin-left: auto;
  }

  /* Logo 调整 */
  .nav-container {
    padding: 0 20px;
  }

  .logo {
    width: 48px !important;
    height: 45px !important;
  }

  /* 激活状态的汉堡按钮动画 */
  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  /* 显示移动端菜单遮罩 */
  .mobile-menu-overlay {
    display: block;
  }

  /* Hero 内容移动端调整 */
  .hero-section {
    min-height: 100vh;
    height: auto;
  }

  .hero-content {
    padding: 60px 20px 40px;
  }

  .hero-tagline {
    font-size: 11px;
    letter-spacing: 2px;
    margin-top: 0;
  }

  .hero-title {
    font-size: 32px;
    line-height: 40px;
    margin-top: 16px;
  }

  .hero-subtitle {
    font-size: 14px;
    line-height: 22px;
    margin-top: 16px;
  }

  .hero-cta {
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
    width: 100%;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    max-width: 100%;
    height: 56px;
  }
}

/* 更小屏幕优化 */
@media (max-width: 480px) {
  .mobile-menu-panel {
    width: 90%;
    max-width: 280px;
  }

  .hero-title {
    font-size: 28px;
    line-height: 36px;
  }

  .hero-subtitle {
    font-size: 13px;
    line-height: 20px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   菜单动画效果
   ═══════════════════════════════════════════════════════════════ */

/* 菜单项渐入动画 */
.mobile-menu-panel.active .mobile-menu-list li {
  animation: slideInRight 0.4s ease forwards;
  opacity: 0;
}

.mobile-menu-panel.active .mobile-menu-list li:nth-child(1) {
  animation-delay: 0.1s;
}

.mobile-menu-panel.active .mobile-menu-list li:nth-child(2) {
  animation-delay: 0.15s;
}

.mobile-menu-panel.active .mobile-menu-list li:nth-child(3) {
  animation-delay: 0.2s;
}

.mobile-menu-panel.active .mobile-menu-list li:nth-child(4) {
  animation-delay: 0.25s;
}

.mobile-menu-panel.active .mobile-menu-list li:nth-child(5) {
  animation-delay: 0.3s;
}

.mobile-menu-panel.active .mobile-menu-list li:nth-child(6) {
  animation-delay: 0.35s;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 菜单底部按钮渐入动画 */
.mobile-menu-panel.active .mobile-menu-footer {
  animation: fadeIn 0.5s ease 0.4s forwards;
  opacity: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 菜单头部渐入动画 */
.mobile-menu-panel.active .mobile-menu-header {
  animation: fadeIn 0.4s ease 0.05s forwards;
  opacity: 0;
}

/* ═══════════════════════════════════════════════════════════════
   返回顶部按钮
   ═══════════════════════════════════════════════════════════════ */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: #bc994b;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9997;
  transition: all 0.3s ease;
  opacity: 0;
  transform: scale(0);
}

.back-to-top.show {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

.back-to-top:hover {
  background: #a08640;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.back-to-top:active {
  transform: scale(0.95);
}

/* 只在移动端显示返回顶部按钮 */
@media (min-width: 769px) {
  .back-to-top {
    display: none !important;
  }
}
