/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

/* 顶部导航栏 */
.top-bar {
    background-color: #ff0036;
    height: 40px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 100px;
    z-index: 100;
}

.logo {
    font-size: 20px;
    font-weight: bold;
}

/* 搜索容器 */
.search-container {
    display: flex;
    width: 600px;
    margin: 20px auto;
    position: relative;
}

.search-box {
    flex: 1;
    height: 40px;
    padding: 10px;
    border: 2px solid #ff0036;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-box:hover,
.search-box:focus {
    border-color: #cc002c;
}

.search-btn {
    width: 80px;
    height: 40px;
    background-color: #ff0036;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: #cc002c;
}

/* 搜索建议 */
.search-suggestions {
    position: absolute;
    width: 100%;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    display: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    top: 100%; /* 修改为 100%，使其在搜索框下方显示 */
    left: 0; /* 确保与搜索框对齐 */
}

.search-suggestions li {
    padding: 6px 10px;
    cursor: pointer;
    background-color: #f8f8f8;
    border-radius: 3px;
    font-size: 13px;
    transition: all 0.2s;
}

.search-suggestions li:hover {
    background-color: #ff0036;
    color: white;
}

/* 主容器样式调整 */
.main-container {
    width: 1270px; /* 修改宽度为 1270px */
    margin: 20px auto;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
/* 视频容器样式 */
.video-container {
    width: 250px;
    height: 300px;
    overflow: hidden; /* 隐藏超出容器的部分 */
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 确保视频覆盖整个容器 */
    object-position: center; /* 确保视频居中 */
    border-radius: 5px;
}
/* 分类菜单栏 */
.category-menu {
    width: 250px; /* 修改宽度为 250px */
    background: linear-gradient(135deg, #fff9f9 0%, #ffffff 100%);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(255, 0, 54, 0.1);
    overflow: hidden;
    height: 400px;
    border: 1px solid #ffe6e6;
}

.menu-header {
    background-color: #ff0036;
    padding: 12px 15px;
    color: white;
}

.menu-list li {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative; /* 添加相对定位 */
}


.menu-list li:hover {
    background-color: #fff0f0;
    transform: translateX(3px);
}


.category-icon {
    font-size: 18px;
    margin-right: 10px;
    width: 24px;
    text-align: center;
}

.category-name {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.arrow-right {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/></svg>') no-repeat center;
    opacity: 0.5;
    transition: all 0.3s;
}

.menu-list li:hover .arrow-right {
    opacity: 1;
    transform: translateX(3px);
}
/* 轮播图和视频的共同容器 */
.carousel-video-container {
    display: flex;
    gap: 20px;
    width: calc(750px + 250px + 20px); /* 轮播图宽度 + 视频宽度 + 间距 */
    height: 400px;
    flex-wrap: wrap; /* 关键：允许内容换行 */
    align-content: flex-start; /* 顶部对齐 */
}


/* 轮播图容器调整 */
.banner-container {
    width: 750px; /* 修改宽度为 750px */
    height: 300px; /* 保持高度不变 */
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
/* 四张图片行 - 严格放置在下方 */
.four-images-row {
    display: flex;
    width: 1200px; /* 与父容器同宽 */
    height: 100px;
    gap: 20px;
    margin-top: 0; /* 紧贴在上方元素下方 */
    position: relative; /* 确保定位正确 */
    top: 0; /* 重置定位 */
}

.promo-image {
    width: 240px; /* 250px (1000px/4) */
    height: 100%;
    object-fit: cover;
    border: 1px solid #f0f0f0;
    transition: transform 0.3s;
}

.promo-image:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.banner {
    display: flex;
    width: 100%; /* 修改宽度 */
    height: 100%;
    transition: transform 0.5s ease;
}

.banner img {
    width: 100%; /* 修改宽度 */
    height: 100%;
    object-fit: cover; /* 确保图片覆盖整个容器 */
    object-position: center; /* 确保图片居中 */
    border-radius: 5px;
}
.banner-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.banner-control:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.banner-control.prev {
    left: 0;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

.banner-control.next {
    right: 0;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

.banner-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    z-index: 10;
}

.banner-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.banner-indicator.active {
    background-color: #ff0036;
}

/* 商品分类区域 */
.category-tabs {
    width: 1000px;
    margin: 30px auto;
}

.tab-header {
    display: flex;
    border-bottom: 2px solid #ff0036;
}

.tab-item {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #f5f5f5;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.tab-item.active {
    background-color: #ff0036;
    color: white;
}

.tab-content {
    display: none;
    padding: 20px;
    background-color: white;
    min-height: 300px;
}

.tab-content.active {
    display: block;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    border: 1px solid #eee;
    padding: 10px;
    transition: transform 0.3s;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-img {
    width: 100%;
    height: 180px;
    object-fit: contain;
}

.product-title {
    margin: 10px 0;
    font-size: 14px;
    height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    color: #ff0036;
    font-size: 18px;
    font-weight: bold;
}

/* 页脚 */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    background-color: #ff0036;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 999;
}