/* 头部组件样式文件 */

/* 简化分类菜单样式 */
.jd-category-menu {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 180px;
    height: 50vh;
    max-height: 50vh;
    min-height: 50vh;
    overflow-y: auto;
}

/* 分类列表布局 */
.jd-categories-list {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

/* 滚动条样式 */
.jd-category-menu::-webkit-scrollbar {
    width: 6px;
}

.jd-category-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.jd-category-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.jd-category-menu::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 子菜单样式 */
.jd-submenu {
    position: fixed !important;
    background: white !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    z-index: 1001 !important;
    width: 180px !important;
    height: 50vh !important;
    max-height: 50vh !important;
    min-height: 50vh !important;
    overflow-y: auto !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.jd-submenu-list {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.jd-submenu-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

.jd-submenu-item:last-child {
    border-bottom: none;
}

.jd-submenu-item:hover {
    background-color: #f9fafb;
    transform: translateX(4px);
}

/* 子菜单滚动条样式 */
.jd-submenu::-webkit-scrollbar {
    width: 6px;
}

.jd-submenu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.jd-submenu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.jd-submenu::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 分类项基础样式 */
.jd-category-item {
    position: relative;
    padding: 12px 20px;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

.jd-category-item:last-child {
    border-bottom: none;
}

.jd-category-item:hover {
    background-color: #f9fafb;
    transform: translateX(4px);
}

.jd-category-item.active {
    background-color: #fef2f2;
    transform: translateX(4px);
}

/* 分类内容样式 */
.jd-category-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* 分类名称样式 */
.jd-category-name {
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jd-category-item:hover .jd-category-name {
    color: #dc2626;
}

/* 箭头样式 */
.jd-category-arrow {
    color: #9ca3af;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.jd-category-item:hover .jd-category-arrow {
    color: #dc2626;
    transform: translateX(2px);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .jd-category-menu {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .jd-category-menu {
        width: 180px;
    }
    
    .jd-category-item {
        padding: 10px 16px;
    }
    
    .jd-category-name {
        font-size: 13px;
    }
    
    .jd-category-arrow {
        width: 14px;
        height: 14px;
    }
}

/* 导航菜单样式 */
.nav-hover-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* 点击显示catalogue菜单 */
.nav-hover-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 悬浮显示catalogue菜单 */
li:hover .nav-hover-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 分类菜单样式 */
.category-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-item:hover {
    background-color: #f9fafb;
    transform: translateX(4px);
}

.category-item:last-child {
    border-bottom: none;
}

/* 分类内容布局 */
.category-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

/* 分类信息容器 */
.category-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

/* 分类名称 */
.category-name {
    font-weight: 500;
    color: #374151;
}

/* 分类数量 */
.category-count {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 400;
}

/* 箭头图标 */
.category-arrow {
    transition: transform 0.2s ease;
    flex-shrink: 0;
    color: #9ca3af;
}

.category-item:hover .category-arrow {
    transform: rotate(90deg);
    color: #6b7280;
}

/* 无限分类菜单样式 */
.category-menu {
    position: relative;
}

.category-item {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-item:hover {
    background-color: #f9fafb;
}

/* 子分类下拉菜单 - 默认隐藏 */
.subcategory-dropdown {
    position: absolute;
    left: 100%;
    top: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    max-width: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 50;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    /* 确保菜单不会超出视口 */
    max-height: 80vh;
    /* 确保默认不显示 */
    display: none;
}

/* 主分类菜单 */
.main-category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 250px;
    overflow-y: visible;
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* 悬浮显示子菜单 - 只显示直接子菜单 */
.category-item:hover > .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    display: block !important;
}

/* 确保catalogue菜单只显示第一级子菜单 */
.main-category-dropdown .category-item:hover > .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    display: block !important;
}

.subcategory-item:hover > .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    display: block !important;
}

/* 多级子菜单悬浮显示 - 只显示直接子菜单 */
.subcategory-item:hover > .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    display: block !important;
}

/* 确保所有层级的子菜单都能正确显示 - 使用更通用的选择器 */
.subcategory-dropdown .subcategory-item:hover > .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    display: block !important;
}

/* 三级菜单显示 */
.subcategory-dropdown .subcategory-dropdown .subcategory-item:hover > .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    display: block !important;
}

/* 四级菜单显示 */
.subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-item:hover > .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    display: block !important;
}

/* 五级菜单显示 */
.subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-item:hover > .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    display: block !important;
}

/* 通用规则：确保所有层级的子菜单都能显示 */
.subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-item:hover > .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    display: block !important;
}

/* 最通用的规则：支持任意深度的子菜单 */
.subcategory-dropdown .subcategory-item:hover > .subcategory-dropdown,
.subcategory-dropdown .subcategory-dropdown .subcategory-item:hover > .subcategory-dropdown,
.subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-item:hover > .subcategory-dropdown,
.subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-item:hover > .subcategory-dropdown,
.subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-item:hover > .subcategory-dropdown,
.subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-item:hover > .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    display: block !important;
}

/* 只显示直接子菜单 - 修复全部显示的问题 */
.subcategory-item:hover > .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    display: block !important;
}

/* 确保三级菜单特别能显示 - 只显示直接子菜单 */
.subcategory-dropdown .subcategory-dropdown .subcategory-item:hover > .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    display: block !important;
}

/* 强制隐藏所有嵌套的子菜单 - 防止显示所有子菜单 */
.subcategory-dropdown .subcategory-dropdown {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
}

/* 确保头部组件不影响页面布局 */
header-component {
    display: block;
    width: 100%;
}

/* 确保菜单不会影响页面布局 */
.nav-hover-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* 确保轮播图正确显示 */
.banner {
    width: 100%;
    height: 500px; /* 设置固定高度 */
    position: relative;
    overflow: hidden;
}

.banner .swiper-wrapper {
    height: 100%;
    width: 100%;
}

.banner .swiper-slide {
    height: 100%;
    width: 100%;
    position: relative;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 确保轮播图内容正确显示 */
.banner .text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 100%;
    max-width: 1200px;
}

/* 轮播图分页器样式 */
.banner .swiper-pagination {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

.banner .swiper-pagination-bullet {
    width: 14px;
    height: 14px;
    border-radius: 14px;
    background-color: #9EA0A4;
    opacity: 1;
    transition: 0.5s;
    margin: 0 5px;
}

.banner .swiper-pagination-bullet-active {
    width: 35px;
    background-color: #F00A29 !important;
}

/* 轮播图导航按钮样式 */
.banner .btns {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 20;
    pointer-events: none;
}

.banner .btns .content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.banner .btns .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 49px;
    height: 49px;
    font-size: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
}

.banner .btns .btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

/* 确保页面内容正确显示 */
.popular, .Products, .Brands {
    width: 100%;
    clear: both;
}

/* 商品区域样式修复 */
.Products {
    background-color: #f9fafb;
    padding: 4rem 0;
}

.Products .wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.Products h2 {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    color: #111827;
    margin-bottom: 3rem;
}

/* 商品网格布局 */
.Products .grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 640px) {
    .Products .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .Products .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 商品卡片样式 */
.Products .bg-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.Products .bg-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* 商品图片容器 */
.Products .aspect-square {
    aspect-ratio: 1;
    width: 100%;
    position: relative;
    background-color: #f9fafb;
}

.Products .img {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.Products .img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.Products .bg-card:hover .img img {
    transform: scale(1.05);
}

/* 商品标签 */
.Products .absolute {
    position: absolute;
}

.Products .top-3 {
    top: 0.75rem;
}

.Products .left-3 {
    left: 0.75rem;
}

.Products .right-3 {
    right: 0.75rem;
}

.Products .flex {
    display: flex;
}

.Products .flex-col {
    flex-direction: column;
}

.Products .gap-2 {
    gap: 0.5rem;
}

/* 商品信息区域 */
.Products .info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.Products .text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.Products .text-gray-500 {
    color: #6b7280;
}

.Products .text-gray-900 {
    color: #111827;
}

.Products .font-medium {
    font-weight: 500;
}

.Products .mb-1 {
    margin-bottom: 0.25rem;
}

.Products .mb-2 {
    margin-bottom: 0.5rem;
}

.Products .mb-3 {
    margin-bottom: 0.75rem;
}

.Products .mb-4 {
    margin-bottom: 1rem;
}

/* 商品标题 */
.Products .line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 价格样式 */
.Products .text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.Products .text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.Products .font-semibold {
    font-weight: 600;
}

.Products .line-through {
    text-decoration: line-through;
}

/* 按钮样式 */
.Products button {
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.Products .bg-brand-red {
    background-color: #dc2626;
}

.Products .bg-brand-red:hover {
    background-color: #b91c1c;
}

.Products .text-white {
    color: white;
}

.Products .rounded-md {
    border-radius: 0.375rem;
}

.Products .h-9 {
    height: 2.25rem;
}

.Products .px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.Products .py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.Products .w-full {
    width: 100%;
}

/* 商品评分样式 */
.Products .flex-col-center {
    display: flex;
    align-items: center;
}

.Products .flex-row-center {
    display: flex;
    justify-content: center;
}

.Products .gap-2 {
    gap: 0.5rem;
}

.Products .gap-1 {
    gap: 0.25rem;
}

/* 商品标签样式 */
.Products .rounded-md {
    border-radius: 0.375rem;
}

.Products .border {
    border-width: 1px;
}

.Products .font-medium {
    font-weight: 500;
}

.Products .w-fit {
    width: fit-content;
}

.Products .overflow-hidden {
    overflow: hidden;
}

.Products .text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.Products .px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.Products .py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.Products .text-white {
    color: white;
}

.Products .bg-blue-600 {
    background-color: #2563eb;
}

.Products .hover\\:bg-blue-700:hover {
    background-color: #1d4ed8;
}

.Products .bg-brand-red {
    background-color: #dc2626;
}

.Products .hover\\:bg-brand-red-hover:hover {
    background-color: #b91c1c;
}

/* 收藏按钮样式 */
.Products .opacity-0 {
    opacity: 0;
}

.Products .group:hover .opacity-0 {
    opacity: 1;
}

.Products .transition-opacity {
    transition: opacity 0.2s ease;
}

.Products .h-8 {
    height: 2rem;
}

.Products .w-8 {
    width: 2rem;
}

.Products .p-0 {
    padding: 0;
}

.Products .bg-white {
    background-color: white;
}

.Products .hover\\:bg-white:hover {
    background-color: white;
}

.Products .hover\\:text-brand-red:hover {
    color: #dc2626;
}

.Products .shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.Products .h-4 {
    height: 1rem;
}

.Products .w-4 {
    width: 1rem;
}

/* 免费配送标签 */
.Products .text-green-600 {
    color: #059669;
}

.Products .h-3 {
    height: 0.75rem;
}

.Products .w-3 {
    width: 0.75rem;
}

/* 价格区域 */
.Products .flex-col-center {
    display: flex;
    align-items: center;
}

.Products .text-gray-500 {
    color: #6b7280;
}

.Products .line-through {
    text-decoration: line-through;
}

/* 按钮样式 */
.Products .text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.Products .font-medium {
    font-weight: 500;
}

.Products .transition-all {
    transition: all 0.2s ease;
}

.Products .h-9 {
    height: 2.25rem;
}

.Products .px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.Products .py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.Products .w-full {
    width: 100%;
}

.Products .bg-brand-red {
    background-color: #dc2626;
}

.Products .hover\\:bg-brand-red-hover:hover {
    background-color: #b91c1c;
}

.Products .text-white {
    color: white;
}

.Products .flex {
    display: flex;
}

.Products .flex-col-center {
    display: flex;
    align-items: center;
}

.Products .flex-row-center {
    display: flex;
    justify-content: center;
}

.Products .gap-2 {
    gap: 0.5rem;
}

/* Footer 底部样式修复 */
footer {
    background-color: #111827;
    color: white;
    width: 100%;
}

footer .wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1rem;
}

/* Footer 网格布局 */
footer .grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 768px) {
    footer .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Footer 内容区域 */
footer h3 {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: white;
}

footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

footer ul li {
    margin-bottom: 0.5rem;
}

footer ul li a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.2s ease;
}

footer ul li a:hover {
    color: white;
}

/* Footer 底部版权区域 */
footer .border-t {
    border-top: 1px solid #374151;
    margin-top: 3rem;
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    footer .border-t {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

footer .text-gray-400 {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* 支付方式区域 */
footer .flex-col-center {
    display: flex;
    align-items: center;
    gap: 1rem;
}

footer .gap-4 {
    gap: 1rem;
}

footer .gap-2 {
    gap: 0.5rem;
}

footer .mt-4 {
    margin-top: 1rem;
}

@media (min-width: 768px) {
    footer .md\\:mt-0 {
        margin-top: 0;
    }
}

/* 支付卡片样式 */
footer .w-10 {
    width: 2.5rem;
}

footer .h-6 {
    height: 1.5rem;
}

footer .rounded {
    border-radius: 0.25rem;
}

footer .text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

footer .flex {
    display: flex;
}

footer .justify-center {
    justify-content: center;
}

footer .text-white {
    color: white;
}

footer .bg-blue-600 {
    background-color: #2563eb;
}

footer .bg-red-600 {
    background-color: #dc2626;
}

footer .bg-green-600 {
    background-color: #059669;
}

footer .bg-purple-600 {
    background-color: #7c3aed;
}

/* 确保Footer响应式布局正确 */
@media (max-width: 767px) {
    footer .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    footer .wrapper {
        padding: 2rem 1rem;
    }
    
    footer h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    footer .border-t {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
}

/* 确保Footer链接样式正确 */
footer .space-y-2 > * + * {
    margin-top: 0.5rem;
}

footer .hover\\:text-white:hover {
    color: white;
}

/* 确保Footer网格在中等屏幕上正确显示 */
@media (min-width: 768px) and (max-width: 1023px) {
    footer .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* 确保Footer在大屏幕上正确显示 */
@media (min-width: 1024px) {
    footer .grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* Popular Categories 轮播样式 */
.popular {
    position: relative;
}

.popular .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.popular-slide {
    width: 280px !important;
    height: auto;
    flex-shrink: 0;
}

.popular .swiper-slide {
    width: 280px !important;
    height: auto;
    flex-shrink: 0;
}

/* 确保卡片正确显示 */
.popular .text-card-foreground {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.popular .aspect-square {
    aspect-ratio: 1;
    width: 100%;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .popular-slide {
        width: 240px !important;
    }
    
    .popular .swiper-slide {
        width: 240px !important;
    }
}

@media (min-width: 1024px) {
    .popular-slide {
        width: 300px !important;
    }
    
    .popular .swiper-slide {
        width: 300px !important;
    }
}

/* 确保网格布局正确 */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .sm\\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Popular Categories 导航按钮样式 */
.popular .button-prev,
.popular .button-next {
    position: static;
    margin: 0;
    transform: none;
    background: white;
    border: 1px solid #e5e7eb;
    color: #374151;
    transition: all 0.2s ease;
}

.popular .button-prev:hover,
.popular .button-next:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

.popular .button-prev:disabled,
.popular .button-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.popular .button-prev:disabled:hover,
.popular .button-next:disabled:hover {
    background: white;
    border-color: #e5e7eb;
    color: #374151;
}

/* 确保只有直接子菜单在悬浮时显示 */
.subcategory-dropdown .subcategory-dropdown .subcategory-item:hover > .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* 京东风格分类菜单样式 */
.jd-category-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 180px;
    height: 50vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.jd-category-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.jd-menu-container {
    display: flex;
    min-height: 400px;
    max-height: 500px;
}

/* 左侧主分类列表 */
.jd-main-categories {
    width: 200px;
    background: #f8f9fa;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
}

.jd-main-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
    position: relative;
}

.jd-main-category-item:hover {
    background: #e3f2fd;
    color: #1976d2;
}

.jd-main-category-item.active {
    background: #1976d2;
    color: white;
}

.jd-main-category-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid #1976d2;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.jd-category-name {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.jd-category-arrow {
    color: #6b7280;
    transition: transform 0.2s ease;
}

.jd-main-category-item:hover .jd-category-arrow {
    transform: translateX(2px);
}

/* 右侧子分类详情 */
.jd-sub-categories {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: white;
}

.jd-sub-category-section {
    width: 100%;
}

.jd-sub-category-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1976d2;
}

.jd-sub-category-grid {
    display: block;
    width: 100%;
}

.jd-sub-category-item {
    padding: 12px;
    border: 1px solid #f1f3f4;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafbfc;
}

.jd-sub-category-item:hover {
    border-color: #1976d2;
    background: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.1);
}

.jd-sub-category-content {
    width: 100%;
}

.jd-sub-category-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.4;
}

.jd-sub-category-children {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.jd-sub-category-child {
    font-size: 12px;
    color: #6b7280;
    padding: 2px 6px;
    background: #f1f3f4;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.jd-sub-category-child:hover {
    background: #1976d2;
    color: white;
}

.jd-more-indicator {
    font-size: 12px;
    color: #9ca3af;
    padding: 2px 6px;
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .jd-category-menu {
        width: 180px;
        left: 0;
    }
    
    .jd-menu-container {
        flex-direction: column;
        min-height: auto;
    }
    
    .jd-main-categories {
        width: 100%;
        max-height: 200px;
    }
    
    .jd-sub-category-grid {
        grid-template-columns: 1fr;
    }
}

/* 确保菜单在悬浮时显示 */
li:hover .jd-category-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 7级菜单样式支持 */
.jd-sub-category-item {
    position: relative;
    margin-bottom: 8px;
}

/* 不同级别的样式 */
.jd-sub-category-item.level-1 {
    font-weight: 500;
    font-size: 14px;
}

.jd-sub-category-item.level-2 {
    font-weight: 400;
    font-size: 13px;
    margin-left: 10px;
}

.jd-sub-category-item.level-3 {
    font-weight: 400;
    font-size: 12px;
    margin-left: 20px;
}

.jd-sub-category-item.level-4 {
    font-weight: 400;
    font-size: 11px;
    margin-left: 30px;
}

.jd-sub-category-item.level-5 {
    font-weight: 400;
    font-size: 10px;
    margin-left: 40px;
}

.jd-sub-category-item.level-6 {
    font-weight: 400;
    font-size: 10px;
    margin-left: 50px;
}

.jd-sub-category-item.level-7 {
    font-weight: 400;
    font-size: 9px;
    margin-left: 60px;
}

/* 级别指示器 */
.jd-level-indicator {
    color: #1976d2;
    font-size: 12px;
    margin-left: 4px;
    opacity: 0.7;
}

/* 子分类容器样式 */
.jd-sub-category-children {
    margin-top: 8px;
    padding-left: 16px;
    border-left: 2px solid #e5e7eb;
    margin-left: 8px;
    display: block;
}

/* 不同级别的子分类容器 */
.jd-sub-category-children.level-1-children {
    border-left-color: #1976d2;
}

.jd-sub-category-children.level-2-children {
    border-left-color: #42a5f5;
}

.jd-sub-category-children.level-3-children {
    border-left-color: #66bb6a;
}

.jd-sub-category-children.level-4-children {
    border-left-color: #ffa726;
}

.jd-sub-category-children.level-5-children {
    border-left-color: #ef5350;
}

.jd-sub-category-children.level-6-children {
    border-left-color: #ab47bc;
}

.jd-sub-category-children.level-7-children {
    border-left-color: #78909c;
}

/* 悬停效果 */
.jd-sub-category-item:hover {
    background: #f8f9ff;
    border-radius: 4px;
    transform: translateX(2px);
}

/* 不同级别的悬停效果 */
.jd-sub-category-item.level-1:hover {
    background: #e3f2fd;
    border-left: 3px solid #1976d2;
    padding-left: 8px;
}

.jd-sub-category-item.level-2:hover {
    background: #f3e5f5;
    border-left: 2px solid #42a5f5;
    padding-left: 6px;
}

.jd-sub-category-item.level-3:hover {
    background: #e8f5e8;
    border-left: 2px solid #66bb6a;
    padding-left: 6px;
}

.jd-sub-category-item.level-4:hover {
    background: #fff3e0;
    border-left: 2px solid #ffa726;
    padding-left: 6px;
}

.jd-sub-category-item.level-5:hover {
    background: #ffebee;
    border-left: 2px solid #ef5350;
    padding-left: 6px;
}

.jd-sub-category-item.level-6:hover {
    background: #fce4ec;
    border-left: 2px solid #ab47bc;
    padding-left: 6px;
}

.jd-sub-category-item.level-7:hover {
    background: #f5f5f5;
    border-left: 2px solid #78909c;
    padding-left: 6px;
}

/* 响应式设计 - 7级菜单 */
@media (max-width: 1200px) {
    .jd-category-menu {
        width: 180px;
    }
    
    .jd-sub-category-item.level-6,
    .jd-sub-category-item.level-7 {
        display: none; /* 在小屏幕上隐藏深层级 */
    }
}

@media (max-width: 768px) {
    .jd-category-menu {
        width: 180px;
    }
    
    .jd-sub-category-item.level-4,
    .jd-sub-category-item.level-5,
    .jd-sub-category-item.level-6,
    .jd-sub-category-item.level-7 {
        display: none; /* 在移动设备上只显示前3级 */
    }
}

/* 滚动条样式 */
.jd-sub-categories {
    max-height: 500px;
    overflow-y: auto;
}

.jd-sub-categories::-webkit-scrollbar {
    width: 6px;
}

.jd-sub-categories::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.jd-sub-categories::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.jd-sub-categories::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 只有悬浮时才显示直接子菜单 */
.subcategory-item:hover > .subcategory-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    display: block !important;
}

/* 防止菜单重叠的间距调整 */
.subcategory-dropdown {
    margin-left: 5px; /* 添加小间距避免重叠 */
}

/* 确保子菜单项有足够的间距 */
.subcategory-item {
    position: relative;
    margin-bottom: 2px;
}

/* 改善菜单项的视觉分离 */
.subcategory-item:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
}

/* 确保菜单不会超出屏幕右边界 */
.subcategory-dropdown {
    /* 如果菜单会超出右边界，则向左显示 */
    right: auto;
    left: 100%;
}

/* 当菜单接近右边界时的调整 */
.subcategory-dropdown.right-aligned {
    left: auto;
    right: 100%;
    transform: translateX(10px);
}

li:hover .main-category-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 子分类项样式 */
.subcategory-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    position: relative;
    min-height: 44px; /* 确保足够的点击区域 */
}

.subcategory-item:hover {
    background-color: #f9fafb;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subcategory-item:last-child {
    border-bottom: none;
}

/* 改善菜单项的视觉层次 */
.subcategory-item[data-level="1"] {
    font-weight: 500;
}

.subcategory-item[data-level="2"] {
    font-weight: 400;
    padding-left: 20px;
}

.subcategory-item[data-level="3"] {
    font-weight: 400;
    padding-left: 30px;
    font-size: 0.9em;
}

.subcategory-item[data-level="4"] {
    font-weight: 400;
    padding-left: 40px;
    font-size: 0.85em;
}

/* 分类名称和箭头容器 */
.category-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* 箭头图标 */
.category-arrow {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.category-item:hover .category-arrow {
    transform: rotate(90deg);
}

/* 导航悬浮菜单样式 */
.nav-hover-menu {
    position: absolute;
    top: 100%;
    left: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

/* 悬浮显示菜单 */
li:hover .nav-hover-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 多级子菜单的z-index递增 - 确保正确的层级 */
.subcategory-dropdown .subcategory-dropdown {
    z-index: 60;
}

.subcategory-dropdown .subcategory-dropdown .subcategory-dropdown {
    z-index: 70;
}

.subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-dropdown {
    z-index: 80;
}

.subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-dropdown .subcategory-dropdown {
    z-index: 90;
}

/* 响应式处理 */
@media (max-width: 768px) {
    .subcategory-dropdown {
        left: 0;
        top: 100%;
        transform: translateY(-10px);
    }

    .category-item:hover .subcategory-dropdown {
        transform: translateY(0);
    }

    .main-category-dropdown {
        min-width: 300px;
    }
}

/* 滚动条样式 */
.main-category-dropdown::-webkit-scrollbar,
.subcategory-dropdown::-webkit-scrollbar {
    width: 6px;
}

.main-category-dropdown::-webkit-scrollbar-track,
.subcategory-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.main-category-dropdown::-webkit-scrollbar-thumb,
.subcategory-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.main-category-dropdown::-webkit-scrollbar-thumb:hover,
.subcategory-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* GST切换样式 */
.choose_tax {
    background-color: var(--color-gray-100);
}

.choose_tax .relative {
    cursor: pointer;
}

.choose_tax .relative:hover {
    opacity: 0.8;
}

/* 搜索框样式 */
.search input {
    color: var(--foreground);
    border-radius: calc(var(--radius) - 2px);
    background-color: var(--input-background);
}

.search input::placeholder {
    color: var(--muted-foreground);
}

.search button {
    color: var(--primary-foreground);
    border-radius: 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0;
    position: absolute;
    top: 0;
    right: 0;
}

/* 头部顶部样式 */
.top .slogan {
    font-size: var(--text-base);
    line-height: var(--tw-leading, var(--text-base--line-height));
    font-weight: var(--font-weight-bold);
    transition-duration: .2s;
    cursor: pointer;
}

.top .slogan:hover {
    opacity: 0.8;
}

/* Logo样式 */
.logo {
    display: block;
}

.logo img {
    display: block;
    width: auto;
}

/* 导航链接样式 */
.links a {
    transition: all 0.2s ease;
}

.links a:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}