/*
 * VShop Header v6.0 — Mobile-First
 * Stripe-Inspired Premium E-commerce
 */

.gm-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* === Header — A6 顶栏 === */
.gm-header {
  background: #fff;
  border-bottom: 1px solid #e8eef8;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.2s ease;
  padding-bottom: 0;
}
.gm-header.scrolled {
  box-shadow: 0 4px 18px rgba(6, 27, 49, 0.06);
  border-bottom-color: transparent;
}
.gm-topbar {
  background: #0b1224;
  color: #94a3b8;
  font-size: 12px;
}
.gm-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.gm-topbar-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.gm-topbar-links a {
  color: #cbd5e1;
  text-decoration: none;
}
.gm-topbar-links a:hover { color: #fff; }
.gm-topbar-admin-form { display: inline; margin: 0; }
.gm-topbar-admin-form .gm-topbar-admin,
.gm-topbar-links a.gm-topbar-admin {
  color: #c4b5fd;
  font-weight: 700;
  background: none;
  border: 0;
  padding: 0;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.gm-topbar-admin-form .gm-topbar-admin:hover,
.gm-topbar-links a.gm-topbar-admin:hover { color: #fff; }
.gm-header-inner {
  display: flex;
  align-items: center;
  min-height: 68px;
  height: auto;
  gap: 14px;
  padding-top: 10px;
  padding-bottom: 14px;
}

/* === Logo — A6 === */
.gm-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.gm-logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #533afd, #7c3aed);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
}
.gm-logo-text b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: #0b1224;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-decoration: none;
}
.gm-logo-text small {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
  text-decoration: none;
}
.gm-logo-icon svg { width: 28px; height: 28px; transition: transform .2s ease; }
.gm-logo:hover .gm-logo-icon svg { transform: scale(1.04); }
.gm-logo-img { height: 40px; max-width: 140px; width: auto; object-fit: contain; transition: opacity .2s ease; }
.gm-logo:hover .gm-logo-img { opacity: .88; }

/* === Nav — 设计② 深色频道条（主行下方独立一行） === */
.gm-navbar{
  background:#0b1224;
  border-bottom:1px solid #0b1224;
  margin-top: 0;
}
.gm-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 42px;
  overflow-x: auto;
}
@media (min-width: 1024px) {
  .gm-nav {
    gap: 8px;
    overflow: visible;
    position: relative;
  }
}
.gm-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 58px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease;
}
.gm-nav-link::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 0;
  height: 3px;
  background: #7c3aed;
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .18s ease;
}
.gm-nav-link:hover { color: #fff; }
.gm-nav-link:hover::after { transform: scaleX(1); }
.gm-nav-link.active { color: #fff; font-weight: 800; }
.gm-nav-link.active::after { transform: scaleX(1); }
.gm-nav-item-hidden { display: none !important; }

/* 搜索框下热词 */
.gm-search-hots {
  display: none;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-left: 6px;
  font-size: 12px;
  color: #64748d;
}
@media (min-width: 640px) {
  .gm-search-hots { display: flex; }
}
.gm-search-hots a {
  color: #533afd;
  font-weight: 650;
  text-decoration: none;
}
.gm-search-hots a:hover { text-decoration: underline; }
.gm-search-hots span { color: #94a3b8; }

/* === 更多导航 === */
.gm-nav-more { display: none; position: relative; flex-shrink: 0; }
.gm-nav-more-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; font-size: 14px; font-weight: 500;
  color: #64748d; border-radius: 4px; cursor: pointer;
  background: none; border: none; transition: all .2s ease;
}
.gm-nav-more-btn:hover { color: #533afd; background: rgba(83, 58, 253, 0.04); }
.gm-nav-more-dropdown {
  display: none;
  position: absolute; top: 100%; right: 0;
  background: transparent; border: none; z-index: 200;
  min-width: 160px; padding: 0;
  animation: gmSubMenuIn .15s ease;
}
/* 视觉间距用 padding-top 实现，hover 区域无缝衔接 */
.gm-nav-more-dropdown > .gm-nav-more-inner {
  background: #fff; border: 1px solid #e5edf5; border-radius: 6px;
  box-shadow: rgba(50, 50, 93, 0.18) 0px 20px 40px -15px, rgba(0, 0, 0, 0.08) 0px 10px 20px -10px;
  padding: 4px;
}
.gm-nav-more.is-open .gm-nav-more-dropdown,
.gm-nav-more:hover .gm-nav-more-dropdown { display: block; }
.gm-nav-more-dropdown a {
  display: block; padding: 8px 12px; font-size: 13px;
  color: #64748d; border-radius: 4px; transition: all .15s ease; text-decoration: none;
}
.gm-nav-more-dropdown a:hover { background: rgba(83, 58, 253, 0.04); color: #061b31; }
.gm-nav-more-dropdown a.active { color: #533afd; font-weight: 600; }

/* === 子菜单 === */
.gm-nav > a { position: relative; }
.gm-nav-submenu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  background: #fff; border: 1px solid #e5edf5; border-radius: 6px;
  box-shadow: rgba(50, 50, 93, 0.18) 0px 20px 40px -15px, rgba(0, 0, 0, 0.08) 0px 10px 20px -10px;
  min-width: 180px; padding: 4px; z-index: 200;
  animation: gmSubMenuIn .15s ease;
}
@keyframes gmSubMenuIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}
.gm-nav > a:hover > .gm-nav-submenu { display: block; }
.gm-nav-submenu a {
  display: block; padding: 8px 12px; font-size: 13px; color: #64748d;
  border-radius: 4px; transition: all .15s ease;
}
.gm-nav-submenu a:hover { background: rgba(83, 58, 253, 0.04); color: #061b31; }

/* === Search — A6 紫色胶囊（Logo 与操作之间） === */
.gm-search-wrap { flex: 1 1 auto; min-width: 0; display: none; max-width: 640px; margin: 0 8px; }
@media (min-width: 640px) {
  .gm-search-wrap { display: block; }
}
.gm-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f3f5f9;
  border: 2px solid #533afd;
  border-radius: 999px;
  overflow: hidden;
  transition: all .2s ease;
  width: 100%;
  padding: 4px 4px 4px 14px;
}
.gm-search-form:focus-within {
  box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.14);
  background: #fff;
}
.gm-search-icon { width: 16px; height: 16px; color: #64748d; flex-shrink: 0; transition: color .2s ease; }
.gm-search-form:focus-within .gm-search-icon { color: #533afd; }
.gm-search-input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: #061b31; font-size: 13px; padding: 6px 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
}
.gm-search-input::placeholder { color: #94a3b8; }
.gm-search-btn {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: 8px 20px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  background: linear-gradient(135deg, #533afd, #7c3aed);
  color: #fff;
}
.gm-search-btn:hover { filter: brightness(1.05); }

/* === 热词条（A6） === */
.gm-hot-row {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 0 2px 10px;
  font-size: 12px;
  color: #64748d;
  flex-wrap: wrap;
}
@media (min-width: 1024px) {
  .gm-hot-row { display: flex; }
}
.gm-hot-row a {
  color: #533afd;
  font-weight: 650;
  text-decoration: none;
}
.gm-hot-row a:hover { text-decoration: underline; }

/* === 操作胶囊（对齐预览 hact） === */
.gm-act-form { display: inline-flex; margin: 0; }
.gm-act {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 13px;
  border: 1px solid #e5edf5;
  background: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  color: #334155;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
}
.gm-act:hover { border-color: #b9b9f9; color: #533afd; background: #f8f7ff; }
.gm-act-main {
  background: #0b1224;
  color: #fff;
  border-color: transparent;
}
.gm-act-main:hover { background: #1a2238; color: #fff; }
.gm-act-form .gm-act-main { border: 0; }

/* === Header right === */
.gm-header-right {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; margin-left: auto;
}
@media (min-width: 1024px) {
  .gm-header-right { gap: 8px; }
}

/* === User menu === */
.gm-user-menu { position: relative; }
.gm-user-trigger {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; border: none; background: none;
  border-radius: 6px; font: inherit;
  cursor: pointer; transition: background-color .2s ease;
}
.gm-user-trigger:hover { background: rgba(0, 0, 0, 0.03); }
.gm-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #533afd, #7c3aed); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; transition: all .2s ease;
}
.gm-user-trigger:hover .gm-avatar { box-shadow: 0 0 0 2px rgba(83, 58, 253, 0.15); }
.gm-uname { display: none; font-size: 13px; color: #061b31; font-weight: 500; }
@media (min-width: 640px) {
  .gm-uname { display: inline; }
}
.gm-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid #e5edf5; border-radius: 6px;
  box-shadow: rgba(50, 50, 93, 0.18) 0px 20px 40px -15px, rgba(0, 0, 0, 0.08) 0px 10px 20px -10px;
  min-width: 200px; z-index: 200; padding: 4px;
  animation: gmDropIn .15s ease;
}
@keyframes gmDropIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}
.gm-dropdown::before { content: ''; position: absolute; bottom: 100%; left: 0; right: 0; height: 8px; }
.gm-dropdown.is-open { display: block; }
.gm-drop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 4px;
  font-size: 13px; color: #061b31; transition: all .15s ease;
}
.gm-drop-item svg { width: 16px; height: 16px; opacity: .5; transition: opacity .2s ease; }
.gm-drop-item:hover { background: #f6f9fc; color: #533afd; }
.gm-drop-item:hover svg { opacity: .8; }
.gm-drop-admin:hover { color: #533afd; }
.gm-drop-logout:hover { color: #c13515; }
.gm-drop-divider { height: 1px; background: #e5edf5; margin: 4px 0; }

/* === Cart badge on act === */
.gm-act { position: relative; }

/* === Notification bell === */
.gm-notif-btn {
  position: relative;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #e5edf5; border-radius: 999px;
  color: #64748d; transition: all .2s ease; text-decoration: none;
}
.gm-notif-btn svg { width: 17px; height: 17px; }
.gm-notif-btn:hover { color: #533afd; border-color: #b9b9f9; background: #eef2ff; }
.gm-notif-badge {
  position: absolute; top: -6px; right: -6px;
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 10px; min-width: 16px; text-align: center;
  line-height: 14px; box-shadow: 0 1px 3px rgba(239, 68, 68, 0.4);
  animation: gmNotifPulse 2s ease-in-out 1;
}
@keyframes gmNotifPulse {
  0% { transform: scale(1); } 30% { transform: scale(1.2); }
  60% { transform: scale(0.95); } 100% { transform: scale(1); }
}

/* === Auth buttons — A6 胶囊 === */
.gm-auth-btns { display: flex; gap: 8px; }
.gm-btn-login {
  display: inline-flex; align-items: center;
  height: 38px; padding: 0 16px;
  border: 1px solid #e5edf5; color: #334155;
  border-radius: 999px; font-size: 13px; font-weight: 650;
  transition: all .2s ease; background: #fff;
  text-decoration: none;
}
.gm-btn-login:hover { background: #f3f5f9; border-color: #b9b9f9; color: #533afd; }
.gm-btn-register {
  display: inline-flex; align-items: center;
  height: 38px; padding: 0 16px;
  background: linear-gradient(135deg, #533afd, #7c3aed); color: #fff;
  border-radius: 999px; font-size: 13px; font-weight: 700;
  transition: all .2s ease; border: none;
  text-decoration: none;
}
.gm-btn-register:hover { box-shadow: 0 8px 18px rgba(83, 58, 253, 0.28); }

/* === Mobile toggle — 移动端/平板可见 === */
.gm-mobile-toggle {
  display: flex; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
@media (min-width: 1024px) {
  .gm-mobile-toggle { display: none; }
}
.gm-mobile-toggle span {
  display: block; width: 18px; height: 2px;
  background: #061b31; border-radius: 2px; transition: all .2s ease;
  transform-origin: center;
}

/* === Toast === */
.gm-toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%);
  padding: 12px 20px; border-radius: 6px;
  z-index: 9999; font-size: 13px; font-weight: 500;
  animation: gmFadeIn .2s ease; border: 1px solid;
  display: flex; align-items: center; gap: 10px;
  backdrop-filter: blur(8px);
}
@media (max-width: 639px) {
  .gm-toast { left: 8px; right: 8px; transform: none; }
}
.gm-toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.gm-toast-ok { background: rgba(21, 190, 83, 0.1); border-color: rgba(21, 190, 83, 0.3); color: #108c3d; box-shadow: rgba(21, 190, 83, 0.15) 0px 4px 12px; }
.gm-toast-err { background: rgba(193, 53, 21, 0.1); border-color: rgba(193, 53, 21, 0.3); color: #c13515; box-shadow: rgba(193, 53, 21, 0.15) 0px 4px 12px; }
@keyframes gmFadeIn {
  from { opacity:0; transform:translateX(-50%) translateY(-4px); }
  to { opacity:1; transform:translateX(-50%) translateY(0); }
}

/* ── Header mobile-first 增强 ── */
@media (min-width: 1024px) {
  .gm-header-inner { min-height: 72px; gap: 16px; }
  .gm-logo-img { height: 42px; max-width: 150px; }
  .gm-avatar { width: 32px; height: 32px; }
}
@media (max-width: 767px) {
  .gm-topbar { display: none; }
  .gm-header-inner { min-height: 56px; gap: 8px; padding-top: 8px; padding-bottom: 10px; }
  .gm-navbar { margin-top: 4px; }
  .gm-logo-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
  .gm-logo-text b { font-size: 15px; }
  .gm-logo-text small { display: none; }
}
