/* ============================================================================
   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;
}

.lang-dropdown-btn {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-dropdown-btn:hover {
  background: rgba(255,255,255,.18);
}

.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: #f5f7fb;
  color: #165DFF;
}

.lang-dropdown-menu a.active {
  background: #eef2ff;
  color: #165DFF;
  font-weight: 700;
}

/* 用户头像下拉菜单 */
.user-avatar-dropdown {
  position: relative;
  display: inline-block;
}

/* 页面居中容器 */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 14px;
}

.user-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  border: 2px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  transition: background .2s;
  user-select: none;
}
.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: #f5f7fb; }
#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:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;}
.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;
  }
}
