/* 通用布局类 */
.layui-flex {
    display: flex;
}

.layui-flex-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

/* 间距类 */
.layui-margin-left-10 {
    margin-left: 10px;
}

.layui-padding-vertical-large {
    padding-top: 50px;
    padding-bottom: 50px;
}

.layui-padding-top-20 {
    padding-top: 20px;
}

/* 文本居中 */
.text-center {
    text-align: center;
}

/* 空状态文本 */
.empty-text {
    color: #888;
    font-size: 1.1rem;
}

/* 模块标题 */
.section-title-text {
    width: 100px;
    display: inline-block;
}

/* 覆盖layui默认边距 */
.layui-margin-bottom {
    margin-bottom: 1rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .layui-padding-vertical-large {
        padding-top: 30px;
        padding-bottom: 30px;
    }
}

/* 头部导航样式 */
.header-area {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.top-header {
    background: #f8f9fa;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.header-left-content, 
.header-right-content {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-left-content li,
.header-right-content li {
    margin-right: 20px;
}

.header-left-content a,
.header-right-content a {
    color: #666;
    text-decoration: none;
    font-size: 13px;
}

.header-left-content a:hover,
.header-right-content a:hover {
    color: #ff6b6b;
}

/* 顶部栏右侧内容靠右对齐 */
.top-header .header-right-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
}

.top-header .header-right-content ul {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

.middle-header {
    padding: 20px 0;
}

/* 中间栏布局调整 */
.middle-header-row {
    display: flex;
    align-items: center;
}

.middle-header-logo {
    display: flex;
    align-items: center;
}

.middle-header-search {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

.middle-header-cart {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.logo a {
    display: block;
}

.logo img {
    max-height: 50px;
}

/* 搜索框样式 */
.search-box {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 600px; /* 限制搜索框最大宽度 */
}

.search-box .layui-input-group {
    width: 100%;
}

/* 搜索框样式优化 */
.search-box .layui-input {
    border: 2px solid #e0e0e0 !important;
    border-right: 1px solid #e0e0e0 !important; /* 减少右侧边框宽度，便于连接 */
    border-radius: 30px 0 0 30px !important;
    padding: 14px 24px !important;
    height: 52px !important;
    box-sizing: border-box;
    font-size: 16px;
    background: transparent !important;
    color: #333;
    transition: all 0.3s ease;
}

.search-box .layui-btn-normal {
    border: 2px solid #ff6b6b !important;
    border-left: 1px solid #ff6b6b !important; /* 减少左侧边框宽度，便于连接 */
    border-radius: 0 30px 30px 0 !important;
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e) !important;
    color: white !important;
    padding: 0 32px !important;
    height: 52px !important;
    margin-left: -2px; /* 负边距使边框重叠 */
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.search-box .layui-btn-normal:hover {
    background: #ff5252 !important;
    border-color: #ff5252 !important;
}

.search-input-group:hover .layui-input {
    border-color: #ff6b6b !important;
}

.search-input-group:hover .layui-btn-normal {
    border-color: #ff6b6b !important;
    background: linear-gradient(135deg, #ff5252, #ff7b7b) !important;
}

/* 焦点状态 */
.search-box .layui-input:focus {
    border-color: #ff6b6b !important;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.1) !important;
}

.wish-cart {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.wish-cart .cart {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 4px;
    transition: background 0.3s;
}

.wish-cart .cart:hover {
    background: #e9ecef;
}

.wish-icon {
    position: relative;
}

.wish-icon .layui-badge {
    position: absolute;
    top: -8px;
    right: -8px;
}

.navbar-area {
    background: #fff;
    border-top: 1px solid #eee;
}

.nav-container {
    display: flex;
    align-items: center;
}

.navbar-category {
    position: relative;
}

.navbar-category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 200px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 10px 0;
    z-index: 1000;
    display: none;
}

.navbar-category:hover .navbar-category-dropdown {
    display: block;
}

.goods-cate {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cate-one {
    position: relative;
}

.cate-one > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s;
}

.cate-one > a:hover {
    background: #f8f9fa;
}

.cate-menu {
    position: absolute;
    top: 0;
    left: 100%;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 10px;
    min-width: 500px;
    display: none;
    z-index: 1001;
}

.cate-one:hover .cate-menu {
    display: block;
}

.header-sub-menu {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
}

.header-sub-menu li {
    flex: 0 0 calc(25% - 10px);
    text-align: center;
}

.cate-name {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* 导航菜单样式 - 优化选中状态 */
.nav-menu .layui-nav {
    background: none;
    padding: 0;
}

.nav-menu .layui-nav-item {
    line-height: 50px;
    position: relative;
}

.nav-menu .layui-nav-item a {
    color: #333;
    padding: 0 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu .layui-nav-item a:hover {
    color: #ff6b6b;
}

/* 选中状态 - 使用更明确的颜色 */
.nav-menu .layui-nav-item.layui-this a,
.nav-menu .layui-nav-item.layui-this a:hover,
.nav-menu .layui-nav-item.layui-this a:focus {
    color: #ff6b6b !important;
    font-weight: 600;
}

/* 添加下划线指示器 */
.nav-menu .layui-nav-item.layui-this a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    height: 3px;
    background: #ff6b6b;
    border-radius: 2px 2px 0 0;
}

/* 简化JS代码，移除可能冲突的样式 */
.nav-menu .layui-nav-item.active a {
    color: #ff6b6b;
}

/* 确保鼠标悬停时也能显示红色 */
.nav-menu .layui-nav-item a:hover {
    color: #ff6b6b;
}

/* 移除可能冲突的覆盖样式 */
.nav-menu .layui-nav-item.layui-this {
    background: none;
}

/* 购物车样式微调 */
.middle-header-cart .wish-cart {
    justify-content: flex-end;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .middle-header .layui-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .logo, .search-box, .wish-cart {
        width: 100%;
    }
    
    .wish-cart {
        justify-content: center;
    }
    
    .nav-container {
        flex-direction: column;
    }
    
    .navbar-category {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .navbar-category button {
        width: 100%;
    }
    
    /* 中等屏幕响应式调整 */
    .middle-header-row {
        flex-wrap: wrap;
    }
    
    .middle-header-logo,
    .middle-header-search,
    .middle-header-cart {
        justify-content: center;
        padding: 10px 0;
    }
    
    .middle-header-search {
        order: 3;
        width: 100%;
        padding: 10px 0;
    }
    
    .middle-header-logo {
        justify-content: flex-start;
    }
    
    .middle-header-cart {
        justify-content: flex-end;
    }
    
    .search-box {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .home-slider .layui-carousel {
        height: 300px !important;
    }
    
    .news-card-header {
        height: 140px;
    }
    
    .middle-header-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .middle-header-logo,
    .middle-header-search,
    .middle-header-cart {
        width: 100%;
        justify-content: center;
        padding: 0;
    }
    
    .middle-header-logo {
        order: 1;
    }
    
    .middle-header-search {
        order: 2;
    }
    
    .middle-header-cart {
        order: 3;
    }
}

@media (max-width: 576px) {
    .home-slider .layui-carousel {
        height: 200px !important;
    }
    
    .news-card-header {
        height: 120px;
    }
    
    .top-header .layui-col-xs6 {
        width: 100%;
    }
    
    .top-header .header-right-content {
        justify-content: center;
        margin-top: 5px;
    }
    
    .top-header .header-left-content {
        justify-content: center;
    }
}

/* 菜单样式 */
.user-address-menu {
    margin-bottom: 20px;
}

.menu-box {
    margin-bottom: 15px;
}

.menu-box .layui-card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.menu-box .layui-nav-tree {
    background: none;
    border: none;
}

.menu-box .layui-nav-item a {
    color: #666;
}

.menu-box .layui-nav-item.layui-this a {
    color: #ff6b6b;
    background: #fff5f5;
}

/* 搜索框居中布局 */
@media (min-width: 768px) {
    .middle-header .layui-row {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    .middle-header .layui-col-md3:first-child {
        flex: 0 0 auto !important;
    }
    
    .middle-header .layui-col-md7 {
        flex: 1 1 auto !important;
        display: flex !important;
        justify-content: center !important;
        padding: 0 20px !important;
    }
    
    .middle-header .layui-col-md2:last-child {
        flex: 0 0 auto !important;
    }
    
    .search-box {
        width: 100% !important;
        max-width: 600px !important;
    }
}

/* 全部分类下拉菜单选中状态样式 */
.cate-one > a.active,
.cate-one > a:hover,
.cate-name.active,
.cate-name:hover {
    color: #ff6b6b !important;
}

/* 一级分类选中状态 */
.cate-one > a.active {
    background-color: #fff5f5 !important;
    border-right: 3px solid #ff6b6b;
}

/* 二级分类选中状态 */
.cate-name.active {
    font-weight: 600;
    color: #ff6b6b !important;
}

/* 全部分类按钮样式（保持原有） */
#categoryButton.layui-btn-danger {
    background-color: #ff6b6b !important;
    border-color: #ff6b6b !important;
}

/* 下拉菜单项悬停效果 */
.cate-one > a:hover {
    background-color: #f8f9fa;
}

/* 二级分类菜单项样式 */
.header-sub-menu li a.cate-name {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.header-sub-menu li a.cate-name:hover,
.header-sub-menu li a.cate-name.active {
    color: #ff6b6b !important;
}