/* ============================================================================
   header.css — 全局头部布局样式（从 header.php 内联抽取）
   ============================================================================ */

/* 修复导航栏遮挡问题 */
html, body {
  margin: 0;
  padding: 0;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.container {
  margin-top: 0;
  padding-top: 0;
}

/* 语言/货币组合下拉菜单样式 */
.lang-dropdown {
  position: relative;
  display: inline-block;
}

/* 头部通用动作按钮（货币下拉、登录文字按钮等），与 .icon-btn 保持等高 40px */
.header-action,
.lang-dropdown-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
  gap: 6px;
  line-height: 1;
}

.header-action:hover,
.lang-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* 文字按钮（登录/注册等）需要更宽的内边距以容纳 2~4 个汉字 */
.header-action.header-action-text {
  padding: 0 18px;
}

/* 货币下拉里的图标稍大一点（与 .icon-btn 内的 20px 视觉重量一致） */
.lang-dropdown-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.lang-dropdown-btn #lang-display {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.lang-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 200px;
  display: none;
  z-index: 1000;
  margin-top: 4px;
  padding: 10px;
}

.lang-dropdown-menu.show {
  display: block;
}

.lang-dropdown-menu .dropdown-section {
  margin-bottom: 8px;
}
.lang-dropdown-menu .dropdown-section:last-child {
  margin-bottom: 0;
}
.lang-dropdown-menu .dropdown-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 6px;
  letter-spacing: 0.5px;
}
.lang-dropdown-menu .dropdown-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 6px 0;
}

.lang-dropdown-menu a {
  display: block;
  padding: 8px 10px;
  color: #0f172a;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s;
  border-radius: 6px;
}

.lang-dropdown-menu a:hover {
  background: #f6f5f1;
  color: #C8A24B;
}

.lang-dropdown-menu a.active {
  background: #F7EFDC;
  color: #C8A24B;
  font-weight: 700;
}

/* 用户头像下拉菜单 */
.user-avatar-dropdown {
  position: relative;
  display: inline-block;
}

/* 页面居中容器（与 app.css 一致；body 已是 flex column，此处仅作 max-width 居中） */
.app-container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 14px;
  overflow: visible;
}

.user-avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  transition: background .2s;
  user-select: none;
  flex-shrink: 0;
}
.user-avatar-btn:hover {
  background: rgba(255,255,255,0.32);
}

#user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 160px;
  z-index: 1001;
  overflow: hidden;
}
#user-menu.show { display: block !important; }
#user-menu a, #user-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: #0f172a;
  text-decoration: none;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
}
#user-menu a:last-child, #user-menu button:last-child { border-bottom: none; }
#user-menu a:hover { background: #f6f5f1; }
#user-menu button:hover { background: #fff1f0; color: #dc2626; }
#user-menu .menu-header {
  padding: 10px 14px 8px;
  border-bottom: 1px solid #f0f0f0;
  background: #f8fafc;
}
#user-menu .menu-header .menu-name {
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
}
#user-menu .menu-header .menu-level {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

/* ============================================================================
   Toast 组件
   ============================================================================ */
.shop-toast {
  display:flex;align-items:center;gap:10px;
  padding:12px 18px;border-radius:12px;
  font-size:14px;font-weight:600;line-height:1.4;
  box-shadow:0 8px 28px rgba(0,0,0,.16);
  pointer-events:auto;cursor:default;
  animation:toastIn .28s cubic-bezier(.34,1.56,.64,1) both;
  max-width:100%;word-break:break-word;
}
.shop-toast.toast-success{background:#f0fdf4;color:#15803d;border:1px solid #bbf7d0;}
.shop-toast.toast-error  {background:#fff1f2;color:#be123c;border:1px solid #fecdd3;}
.shop-toast.toast-info   {background:#F7EFDC;color:#1A364D;border:1px solid #ecd9b8;}
.shop-toast.toast-warning{background:#fffbeb;color:#b45309;border:1px solid #fde68a;}
.shop-toast.toast-out    {animation:toastOut .22s ease forwards;}
@keyframes toastIn  {from{opacity:0;transform:translateY(-14px) scale(.96)}to{opacity:1;transform:none}}
@keyframes toastOut {from{opacity:1;transform:none}to{opacity:0;transform:translateY(-10px) scale(.96)}}

/* ============================================================================
   手机端响应式
   ============================================================================ */
.mobile-welcome {
  display: none;
}

@media (max-width: 860px) {
  .desktop-welcome {
    display: none !important;
  }

  .desktop-nav-links {
    display: none !important;
  }

  .desktop-logout {
    display: none !important;
  }

  .mobile-welcome {
    display: flex !important;
    align-items: center;
    flex: 1;
    min-width: 0;
    margin-right: 8px;
  }

  .mobile-welcome-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0;
  }

  .mobile-welcome-text {
    font-size: 12px;
    color: rgba(255,255,255,0.88);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
  }

  .mobile-welcome-text strong {
    color: #fff;
    font-weight: 800;
  }

  .appbar .row {
    flex-wrap: nowrap;
    margin-bottom: 0 !important;
    justify-content: space-between !important;
    align-items: center;
  }

  .searchbar {
    max-width: 100% !important;
    margin-left: -14px !important;
    margin-right: -14px !important;
    padding: 0 14px !important;
  }
}

/* ============================================================================
   主导航（桌面端悬停下拉二级菜单）
   ============================================================================ */
.hb-topnav-desktop { display:flex; align-items:center; margin:0 20px; }
.hb-topnav { display:flex; align-items:center; gap:2px; list-style:none; margin:0; padding:0; }
.hb-topnav-item { position:relative; display:flex; align-items:center; }
.hb-topnav-link {
    display:inline-flex; align-items:center; gap:4px;
    color:#fff; text-decoration:none; font-size:13px; font-weight:600;
    padding:7px 12px; border-radius:8px; opacity:.85;
    line-height:1; box-sizing:border-box;
    transition:background .2s, opacity .2s;
}
.hb-topnav-item:hover > .hb-topnav-link { opacity:1; background:rgba(255,255,255,.14); }
/* 激活项：仅用背景高亮，不再显示底部下划线（去掉选中后的底部阴影效果） */
/* 激活项：金字 + 金色下划线，与普通项（白字半透底）明显区分 */
.hb-topnav-item.is-active > .hb-topnav-link { opacity:1; color:#E6C77A; background:rgba(200,162,75,.18); box-shadow:inset 0 -2px 0 #C8A24B; }
.hb-topnav-item.open > .hb-topnav-link { opacity:1; background:rgba(255,255,255,.14); }
.hb-caret { transition:transform .2s; flex-shrink:0; }
.hb-has-sub:hover > .hb-topnav-link .hb-caret,
.hb-has-sub.open > .hb-topnav-link .hb-caret { transform:rotate(180deg); }

.hb-subnav {
    position:absolute; top:100%; left:0; min-width:190px;
    background:#fff; border-radius:10px; box-shadow:0 14px 34px rgba(15,23,42,.20);
    padding:6px; margin:8px 0 0; list-style:none; z-index:200;
    opacity:0; visibility:hidden; transform:translateY(6px); transition:all .18s ease;
}
.hb-has-sub:hover > .hb-subnav,
.hb-has-sub.open > .hb-subnav { opacity:1; visibility:visible; transform:none; }
.hb-subnav li a {
    display:block; padding:9px 12px; color:#334155; text-decoration:none;
    font-size:13px; font-weight:500; border-radius:7px; white-space:nowrap;
}
.hb-subnav li a:hover { background:#f1f5f9; color:#0f172a; }

/* ============================================================================
   移动端：隐藏桌面端主导航（手机端不显示菜单）
   ============================================================================ */
@media (max-width: 860px) {
  .hb-topnav-desktop { display:none !important; }
}
