/* 手机端头部布局样式 */

/* 手机端头部容器 */
.mheader {
    display: none;
}

/* 手机端显示 */
@media (max-width: 768px) {
    .mheader {
        display: block !important;
    }
    
    /* 隐藏桌面端头部 */
    .container .header {
        display: none !important;
    }
}

/* 手机端头部布局 */
.header-mb {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 15px !important;
    background-color: #ffffff !important;
    border-bottom: 1px solid #e6e6e6 !important;
    position: relative !important;
}

/* 左侧汉堡菜单 */
.hearleft {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
}

/* 汉堡菜单图标 */
.hamburger-icon {
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    cursor: pointer !important;
}

.hamburger-icon .icon-line {
    width: 100% !important;
    height: 3px !important;
    background-color: #333333 !important;
    border-radius: 2px !important;
    transition: all 0.3s ease !important;
}

/* 中间logo区域 */
.header-center {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 10px !important;
}

/* 手机端logo */
.header-logo-mobile {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.header-logo-mobile h1 {
    margin: 0 !important;
    padding: 0 !important;
}

.header-logo-mobile .logo-img {
    display: block !important;
    text-decoration: none !important;
}

.header-logo-mobile img {
    max-height: 40px !important;
    width: auto !important;
    height: auto !important;
}

/* 右侧按钮区域 */
.header-right-mobile {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

/* 搜索按钮 */
.sousuo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sousuo .icon-search {
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #333333 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.sousuo .icon-search:hover {
    color: #333333 !important;
}

.sousuo svg {
    width: 20px !important;
    height: 20px !important;
    fill: currentColor !important;
}

/* 购物车按钮 */
.cart-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

.cart-icon a {
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #333333 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.cart-icon a:hover {
    color: #333333 !important;
}

.cart-icon svg {
    width: 20px !important;
    height: 20px !important;
    fill: currentColor !important;
}

/* 购物车数量徽章 */
.cartCount {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    background-color: #e51f14 !important;
    color: #ffffff !important;
    font-size: 10px !important;
    font-weight: bold !important;
    min-width: 16px !important;
    height: 16px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 4px !important;
    line-height: 1 !important;
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .header-mb {
        padding: 8px 12px !important;
    }
    
    .header-right-mobile {
        gap: 12px !important;
    }
    
    .hamburger-icon,
    .sousuo .icon-search,
    .cart-icon a {
        width: 22px !important;
        height: 22px !important;
    }
    
    .hamburger-icon .icon-line {
        height: 2px !important;
    }
    
    .sousuo svg,
    .cart-icon svg {
        width: 18px !important;
        height: 18px !important;
    }
    
    .header-logo-mobile img {
        max-height: 35px !important;
    }
}

/* 小屏幕优化 */
@media (max-width: 375px) {
    .header-mb {
        padding: 6px 10px !important;
    }
    
    .header-right-mobile {
        gap: 10px !important;
    }
    
    .hamburger-icon,
    .sousuo .icon-search,
    .cart-icon a {
        width: 20px !important;
        height: 20px !important;
    }
    
    .sousuo svg,
    .cart-icon svg {
        width: 16px !important;
        height: 16px !important;
    }
    
    .header-logo-mobile img {
        max-height: 30px !important;
    }
}

/* 平板端适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .mheader {
        display: none !important;
    }
    
    .container .header {
        display: block !important;
    }
}

/* 确保桌面端头部正常显示 */
@media (min-width: 1025px) {
    .mheader {
        display: none !important;
    }
    
    .container .header {
        display: block !important;
    }
}

/* 动画效果 */
.header-mb {
    animation: slideDown 0.3s ease-out !important;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%) !important;
        opacity: 0 !important;
    }
    to {
        transform: translateY(0) !important;
        opacity: 1 !important;
    }
}

/* 悬停效果 */
.hamburger-icon:hover .icon-line {
    background-color: #16336b !important;
}

.sousuo .icon-search:hover svg {
    transform: none !important;
    transition: none !important;
}

.cart-icon a:hover svg {
    transform: none !important;
    transition: none !important;
}

/* 焦点状态 */
.hamburger-icon:focus,
.sousuo .icon-search:focus,
.cart-icon a:focus {
    outline: none !important;
    outline-offset: 0 !important;
    border-radius: 0 !important;
}

/* 触摸设备优化 */
@media (hover: none) {
    .hamburger-icon:active .icon-line {
        background-color: #16336b !important;
    }
    
    .sousuo .icon-search:active svg {
        transform: none !important;
    }
    
    .cart-icon a:active svg {
        transform: none !important;
    }
}

/* 确保在所有设备上的可用性 */
.header-mb * {
    box-sizing: border-box !important;
}

/* 防止内容溢出 */
.header-mb {
    overflow: hidden !important;
    white-space: nowrap !important;
}

/* 确保logo居中 */
.header-center {
    text-align: center !important;
}

/* 响应式间距调整 */
@media (max-width: 480px) {
    .header-center {
        padding: 0 5px !important;
    }
}

/* 确保按钮可点击区域足够大 */
.hamburger-icon,
.sousuo .icon-search,
.cart-icon a {
    min-width: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 购物车徽章位置调整 */
@media (max-width: 480px) {
    .cartCount {
        top: -6px !important;
        right: -6px !important;
        min-width: 14px !important;
        height: 14px !important;
        font-size: 9px !important;
    }
} 