/**
 * ============================================================
 * Header Toystore Styles - Riniba 01 Theme
 * ============================================================
 * 头部导航玩具店风格样式
 * 主色调: #FBC270 (暖橙色), #67D4E0 (青色)
 * ============================================================
 */

/* ============================================================
   1. 购物车徽章
   ============================================================ */

.cart-menu-item {
    position: relative;
}

.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: linear-gradient(135deg, #FBC270 0%, #f5a623 100%);
    color: #2C2D2F;
    font-size: 11px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 8px rgba(251, 194, 112, 0.5);
    animation: cartBadgePulse 2s infinite;
}

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

/* ============================================================
   2. 玩具店风格下拉菜单
   ============================================================ */

.toy-dropdown {
    position: relative;
}

.toy-dropdown-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.toy-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.toy-dropdown-toggle .dropdown-text {
    font-size: 14px;
    font-weight: 600;
}

.toy-dropdown-toggle .dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.toy-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* 玩具店子菜单 */
.toy-submenu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    padding: 12px 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(251, 194, 112, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    list-style: none;
    margin: 0;
}

.toy-dropdown:hover .toy-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.toy-submenu li {
    margin: 0;
    transform: none !important;
    opacity: 1 !important;
}

.toy-submenu li a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #2C2D2F !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease;
}

.toy-submenu li a:hover {
    background: linear-gradient(135deg, rgba(103, 212, 224, 0.1) 0%, rgba(251, 194, 112, 0.1) 100%);
    color: #67D4E0 !important;
    padding-left: 24px;
}

.toy-submenu li a i {
    font-size: 16px !important;
    width: 20px;
    color: #67D4E0;
}

/* 语言标识 */
.lang-flag {
    font-size: 18px;
}

/* 主题圆点 */
.theme-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   3. 用户头像样式
   ============================================================ */

.user-avatar-toggle {
    padding: 4px 12px !important;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FBC270 0%, #67D4E0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(251, 194, 112, 0.4);
    transition: all 0.3s ease;
}

.user-avatar.guest {
    background: linear-gradient(135deg, #a0a0a0 0%, #6a6a6a 100%);
}

.toy-dropdown:hover .user-avatar {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(251, 194, 112, 0.5);
}

/* 用户子菜单 */
.user-submenu {
    min-width: 220px;
    right: 0;
}

.user-info-item {
    padding: 16px 20px !important;
    border-bottom: 1px solid #eee;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FBC270 0%, #67D4E0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}

.user-info span {
    font-size: 15px;
    font-weight: 700;
    color: #2C2D2F;
}

.user-submenu .divider {
    height: 1px;
    background: #eee;
    margin: 8px 0;
    padding: 0 !important;
}

.user-submenu .logout-link {
    color: #e74c3c !important;
}

.user-submenu .logout-link:hover {
    background: rgba(231, 76, 60, 0.1) !important;
}

/* 访客子菜单 */
.guest-submenu {
    min-width: 240px;
    padding: 16px !important;
}

.guest-welcome {
    text-align: center;
    padding: 12px 0 !important;
}

.welcome-icon {
    font-size: 32px;
    color: #FBC270;
    margin-bottom: 8px;
}

.guest-welcome span {
    font-size: 14px;
    color: #666;
}

.auth-buttons {
    display: flex;
    gap: 12px;
    padding: 12px 0 !important;
}

.auth-btn {
    flex: 1;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px !important;
    border-radius: 12px;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-align: center;
    transition: all 0.3s ease;
}

.login-btn {
    background: linear-gradient(135deg, #67D4E0 0%, #4bc5d4 100%) !important;
    color: #fff !important;
}

.login-btn:hover {
    background: linear-gradient(135deg, #4bc5d4 0%, #67D4E0 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(103, 212, 224, 0.4);
}

.register-btn {
    background: linear-gradient(135deg, #FBC270 0%, #f5a623 100%) !important;
    color: #2C2D2F !important;
}

.register-btn:hover {
    background: linear-gradient(135deg, #f5a623 0%, #FBC270 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 194, 112, 0.4);
}

/* ============================================================
   4. 移动端样式
   ============================================================ */

.mobile-cart-badge {
    position: relative;
    display: flex;
    align-items: center;
}

.mobile-cart-badge a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 18px;
    position: relative;
}

.mobile-cart-badge .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #FBC270 0%, #f5a623 100%);
    color: #2C2D2F;
    font-size: 10px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.mobile-user-avatar {
    margin-left: 8px;
}

.mobile-user-avatar a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FBC270 0%, #67D4E0 100%);
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(251, 194, 112, 0.4);
}

.mobile-user-avatar.guest a {
    background: linear-gradient(135deg, #a0a0a0 0%, #6a6a6a 100%);
}

/* 移动端导航中的样式 */
.mobile-navar .sub-menu .theme-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mobile-navar .sub-menu .lang-flag {
    margin-right: 8px;
}

.mobile-navar .sub-menu li a i {
    width: 20px;
    margin-right: 8px;
    color: #67D4E0;
}

.mobile-cart-count {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

/* ============================================================
   5. 购物车动态更新样式
   ============================================================ */

#cartBadge.updating,
#mobileCartBadge.updating,
#mobileCartCount.updating {
    animation: cartUpdate 0.5s ease;
}

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

/* 空购物车状态 */
.cart-badge:empty,
#mobileCartBadge:empty,
#mobileCartCount:empty {
    display: none;
}
