.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  height: var(--header-height);
  transition: var(--transition);
}

.header-inner {
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 3rem);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-glass {
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.125rem;
  font-weight: var(--fw-bold);
  color: var(--primary-dark);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-logo img {
  height: 28px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  /*position: relative;*/
  padding: 0 1.125rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.nav-link {
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-item.active .nav-link {
  color: #1138D4;
}

.nav-link .arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.625rem;
  transition: var(--transition-fast);
}

.nav-item:hover .arrow {
  transform: rotate(180deg);
}

.mega-menu {
  position: fixed;      /* 修改点1：改为 fixed 定位，彻底脱离父级排版限制 */
  top: var(--header-height);
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  max-width: 95vw;
  background: var(--bg-white);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-8px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s;
  border-top: 2px solid var(--accent);
}

.nav-item:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.mega-menu-group h4 {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: rgba(17, 56, 212, 1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.mega-menu-group a {
  display: block;
  padding: 0.375rem 0;
  font-size: var(--fs-small);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.mega-menu-group a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-contact-btn {
  padding: 0.5rem 1.25rem;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  background: #1138D4;
  color: white;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.header-contact-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* 默认状态：三条横杠 */
.mobile-toggle {
  display: none; /* 默认桌面端隐藏 */
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1001; /* 确保在最上层 */
  padding: 10px;
}

.mobile-toggle span {
  width: 25px;
  height: 2px;
  background-color: var(--primary-dark);
  transition: all 0.3s ease-in-out;
  display: block;
}

/* 激活状态：变成 X */
.mobile-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

.mobile-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  padding: 2rem;
  z-index: 1000;
  
  /* 初始隐藏状态：位移到右侧或渐隐 */
  opacity: 0;
  visibility: hidden;
  transform: translateX(100%); 
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0); /* 点击后滑入 */
}

/* 移动端菜单内的链接样式 */
.mobile-nav a {
  display: block;
  padding: 1.25rem 0;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid #eee;
  text-decoration: none;
}

@media (max-width: 960px) {
  /* 1. 隐藏桌面导航栏 */
  .header-nav {
    display: none !important;
  }

  /* 2. 彻底禁用 Mega Menu，防止代码冲突 */
  .mega-menu {
    display: none !important;
  }

  /* 3. 显示汉堡按钮 */
  .mobile-toggle {
    display: flex;
  }

  /* 4. 调整 Logo 尺寸（可选） */
  .header-logo img {
    height: 28px;
  }

  /* 5. 隐藏桌面端的 Contact Us 按钮（如果空间不够的话） */
  /* .header-cta { display: none; } */
}
/* ─── Sale Notification Popup ─── */
@keyframes popupSlideUp {
  0% { opacity: 0; transform: translateX(-20px) scale(0.9); }
  15% { opacity: 1; transform: translateX(0) scale(1); }
  85% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(-20px) scale(0.9); }
}

@keyframes popupPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255,255,255,0.3); }
  50% { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22), 0 4px 16px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255,255,255,0.4); }
}

@keyframes liveBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes shimmerMove {
  0% { left: -75%; }
  100% { left: 125%; }
}

@keyframes countJump {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.sale-popup {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 300px;
  z-index: 9999;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-20px) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
  /* 新增以下两行 */
  border-radius: 20px; /* 与内部圆角保持一致 */
  overflow: hidden;    /* 强制裁切多余的矩形背景 */
}

.sale-popup.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
  animation: popupPulse 3s ease-in-out infinite;
}

.sale-popup-inner {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  padding: 10px 12px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.sale-popup-inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  pointer-events: none;
  animation: shimmerMove 2s ease-in-out infinite;
}

.sale-popup-badge {
  position: absolute;
  top: 8px;
  right:10px;
  z-index: 2;
}

/* LIVE badge: positioned top-right of the card, outside the close button's zone (right: 36px) */
.sale-popup-fire {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #ff4d4f, #ff7875);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  animation: liveBounce 1.5s ease-in-out infinite;
  box-shadow: 0 2px 8px rgba(255, 77, 79, 0.35);
}

.sale-popup-close {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(91, 126, 254, 0.318);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
  z-index: 3;
}

.sale-popup-close:hover {
  background: rgba(0, 0, 0, 0.15);
}

.sale-popup-img-wrap {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f4ff, #e8eeff);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(17, 56, 212, 0.12);
  flex-shrink: 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.sale-popup-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sale-popup-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sale-popup-body {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sale-popup-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: -2px;
  margin-top: 0px;
  animation: countJump 2s ease-in-out infinite;
}

.sale-popup-text {
  font-size: 11.5px;
  color: #374151;
  line-height: 1.45;
  margin: 0;
}

.sale-popup-timer {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
  color: #6b7280;
}

.sale-popup-countdown {
  font-weight: 700;
  color: #ef4444;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.sale-popup-drone-name {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .sale-popup {
    bottom: 16px;
    left: 12px;
    width: 280px;
  }
}
