/* 
 * 幸福西饼大学生实训版样式表 
 * 作者：Trae AI
 * 描述：这是一个简化的电商网站样式，适合学习和参考
 */

/* ================= 重置默认样式 (Reset CSS) ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* 让padding和border包含在宽度内 */
}

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    color: #333;
    background-color: #f5f5f5;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

ul {
    list-style: none;
}

img {
    max-width: 100%; /* 图片自适应宽度 */
    display: block;
}

/* ================= 通用样式类 (Utility Classes) ================= */
.container {
    width: 1200px; /* 版心宽度 */
    margin: 0 auto; /* 水平居中 */
    padding: 0 15px;
}

/* 清除浮动 */
.clearfix::after {
    content: "";
    display: block;
    clear: both;
}

/* ================= 头部样式 (Header) ================= */
.header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    height: 100px;
    display: flex;
    align-items: center; /* 垂直居中 */
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Logo */
.logo img {
    height: 60px;
}

/* 导航菜单 */
.nav ul {
    display: flex;
}

.nav li {
    margin: 0 20px;
}

.nav a {
    font-size: 16px;
    font-weight: bold;
    padding-bottom: 5px;
}

.nav a:hover, .nav li.active a {
    color: #e91e63; /* 品牌色 */
    border-bottom: 2px solid #e91e63;
}

/* 用户操作区 */
.user-actions {
    display: flex;
    align-items: center;
}

.search-box {
    margin-right: 20px;
    display: flex;
}

.search-box input {
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.search-box button {
    background-color: #e91e63;
    color: #fff;
    border: none;
    padding: 5px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.user-actions .icons a {
    margin-left: 15px;
    display: inline-block;
}

/* ================= Banner区域 ================= */
.banner {
    width: 100%;
    overflow: hidden;
}

.banner img {
    width: 100%;
    height: auto;
    object-fit: cover; /* 保持图片比例填充 */
}

/* ================= 分类区域 (Categories) ================= */
.categories {
    background-color: #fff;
    padding: 40px 0;
    margin-bottom: 20px;
}

.categories .container {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.category-item {
    transition: transform 0.3s;
    cursor: pointer;
}

.category-item:hover {
    transform: translateY(-5px); /* 鼠标悬停上浮效果 */
}

.category-item img {
    margin: 0 auto 10px;
    width: 80px;
    height: 80px;
}

.category-item h3 {
    font-size: 18px;
    color: #555;
}

/* ================= 品牌优势区域 (Advantages) ================= */
.advantages {
    background-color: #fff;
    padding: 30px 0;
    margin-bottom: 20px;
    border-top: 1px solid #eee;
}

.advantages .container {
    display: flex;
    justify-content: space-between;
}

.adv-item {
    text-align: center;
    flex: 1; /* 均分宽度 */
    padding: 0 10px;
    border-right: 1px solid #f0f0f0;
}

.adv-item:last-child {
    border-right: none;
}

.adv-item img {
    margin: 0 auto 10px;
    width: 60px;
    height: 60px;
    border-radius: 50%; /* 圆形图标 */
}

.adv-item h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.adv-item p {
    font-size: 12px;
    color: #999;
}

/* ================= 主厨推荐区域 (Chef Recommendation) ================= */
.chef-recommend {
    background-color: #fff;
    padding: 50px 0;
    margin-bottom: 20px;
}

.chef-recommend .container {
    display: flex;
    align-items: center; /* 垂直居中 */
    gap: 40px; /* 左右间距 */
}

.chef-img {
    flex: 1;
}

.chef-img img {
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.chef-info {
    flex: 1;
}

.chef-info h2 {
    color: #e91e63;
    font-size: 24px;
    margin-bottom: 10px;
}

.chef-info h3 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #333;
}

.chef-info .intro {
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
}

.chef-info .features li {
    margin-bottom: 10px;
    font-size: 16px;
    color: #555;
}

.btn-primary {
    display: inline-block;
    background-color: #e91e63;
    color: #fff;
    padding: 12px 30px;
    border-radius: 25px;
    margin-top: 20px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(233, 30, 99, 0.3);
}

.btn-primary:hover {
    background-color: #c2185b;
    transform: translateY(-2px);
}

/* ================= 用户好评区域 (Reviews) ================= */
.reviews {
    padding: 40px 0;
    background-color: #f9f9f9;
}

.review-grid {
    display: flex;
    gap: 20px;
}

.review-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    flex: 1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.user-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
}

.user-meta h4 {
    font-size: 16px;
    color: #333;
}

.user-meta .stars {
    font-size: 12px;
}

.comment {
    color: #666;
    font-style: italic;
    line-height: 1.6;
}

/* ================= 热门产品区域 (Products) ================= */
.products {
    padding: 40px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

.section-title p {
    color: #999;
}

.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* 网格间距 */
}

.product-card {
    background: #fff;
    width: calc(25% - 15px); /* 一行4个 */
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s;
    padding-bottom: 15px;
}

.product-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-img img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.product-info {
    padding: 15px;
    text-align: center;
}

.product-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: #333;
}

.product-info .desc {
    font-size: 14px;
    color: #888;
    margin-bottom: 15px;
    height: 20px; /* 固定高度防止错位 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.price-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.price {
    color: #e91e63;
    font-size: 20px;
    font-weight: bold;
}

.add-cart {
    background-color: #e91e63;
    color: #fff;
    border: none;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.add-cart:hover {
    background-color: #c2185b;
}

/* ================= 底部区域 (Footer) ================= */
.footer {
    background-color: #333;
    color: #fff;
    padding: 50px 0 20px;
    margin-top: 40px;
}

.footer-links {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    border-bottom: 1px solid #444;
    padding-bottom: 30px;
}

.link-group h4, .contact-info h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #fff;
}

.link-group a {
    display: block;
    color: #999;
    margin-bottom: 10px;
}

.link-group a:hover {
    color: #fff;
}

.contact-info p {
    color: #999;
    margin-bottom: 10px;
}

.copyright {
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* ================= 关于我们页面 (About Page) ================= */
.about-content {
    background-color: #fff;
    padding: 40px;
    margin-top: 20px;
    border-radius: 8px;
    line-height: 2;
    color: #555;
}

.about-content h2 {
    color: #333;
    border-bottom: 2px solid #e91e63;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 24px;
}

.about-content p {
    margin-bottom: 15px;
    text-indent: 2em; /* 首行缩进 */
}

.about-content img {
    margin: 20px auto;
    border-radius: 4px;
}
