/* 全局样式 */
body {
    touch-action: pan-y; /* 允许垂直滚动，禁用水平滚动 */
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 50px 0 80px; /* 添加顶部和底部内边距 */
    background-color: #f4f4f4;
    color: #333;
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
    padding: 0 10px;
}

h1, h2, h3 {
    color: #333;
    margin-bottom: 10px;
	
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    color: #0056b3;
}

/* 头部样式 */
header {
    background: #333;
    color: #fff;
    padding: 20px 0;
    border-bottom: 3px solid #007bff;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header #branding img {
    width: 250px; /* 调整Logo宽度 */
}

header #search {
    flex: 1;
    margin-left: 20px;
    margin-right: 20px;
    display: flex;
    align-items: center; /* 垂直居中 */
}

header #search input[type="text"] {
    width: 80%; /* 增加宽度 */
    padding: 10px; /* 增加内边距 */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px; /* 增大字体 */
    outline: none; /* 移除获得焦点时的轮廓 */
}

header #search button {
    background-color: #007bff;
    color: #fff;
    padding: 10px 15px; /* 调整按钮内边距 */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px; /* 增大字体 */
    margin-left: 10px; /* 增加按钮与输入框的间距 */
}

header #search input[type="text"]:focus {
    outline: none; /* 移除点击时的轮廓 */
    border-color: #007bff; /* 点击时改变边框颜色，可根据需要调整 */
    box-shadow: none; /* 移除点击时的阴影效果 */
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* 使导航项在一行 */
    align-items: center; /* 垂直居中 */
}

header nav li {
    display: inline;
    margin-left: 20px;
}

header nav a {
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 16px;
}

/* 语言选择样式 */
header nav select {
    background-color: #555;
    color: #fff;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23FFFFFF" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/></svg>');
    background-repeat: no-repeat;
    background-position-x: 95%;
    background-position-y: 50%;
    padding-right: 25px;
}

/* 搜索栏样式 */
#search-section {
    padding-top: 100px; /* 调整搜索栏和顶部导航栏之间的距离 */
    text-align: center;
    margin-bottom: 0 px;
}

#search-section .container {
    width: 60%;
}

/* 瀑布流样式 */
#products .container .waterfall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, auto));
    grid-gap: 15px;
    padding: 10px;
    justify-content: center;
}

.waterfall-item {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    word-wrap: break-word;
}

.waterfall-item img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

/* 购物车商品列表样式 */
#cart-items .container {
    padding: 20px;
}

#cart-items h2 {
    margin-bottom: 20px;
    text-align: center;
}

.cart-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
}

.cart-item-image img {
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
    border-radius: 5px;
}

.cart-item-details {
    flex: 1;
    margin-left: 20px;
}

.cart-item-details h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.cart-item-details p {
    font-size: 14px;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.cart-item-actions a {
    margin-top: 10px;
}

/* 更新数量表单 */
.update-form {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 10px;
}

.update-form label {
    font-weight: normal;
    margin-bottom: 5px;
}

.update-form input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 5px;
}

/* 购物车总计 */
.cart-total {
    text-align: right;
    font-size: 20px;
    margin-top: 20px;
    font-weight: bold;
}

/* 结算按钮 */
#cart-items form[action="checkout.asp"] input[type="submit"] {
    background-color: #007bff;
    color: #fff;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: block;
    margin-left: auto;
}

/* 底部导航栏样式 */
footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 10px 0;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

footer .container {
    padding: 0;
}

footer #bottom-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: space-around;
}

footer #bottom-nav li {
    display: inline;
}

footer #bottom-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 20px;
    padding: 10px;
    display: block; /* 使链接填充整个 li 元素 */
}

footer #bottom-nav i {
    font-size: 24px;
    display: block;
    margin-bottom: 5px;
}

/* 图标样式 */
i {
    margin-right: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        width: 95%;
    }

    header .container {
        flex-direction: row; /* 水平排列 */
        justify-content: space-between; /* 两端对齐 */
        align-items: center; /* 垂直居中 */
    }

    header #branding img {
        width: 180px; /*  logo 在移动端的尺寸 */
    }

    header #search {
        margin-top: 10px;
        width: 100%; /* 占据整行 */
    }

    header #search input[type="text"] {
        width: 100%; /* 搜索框占据整行 */
    }

    header nav select {
        margin-top: 10px; /*  语言选择器 */
		margin-right: 10px; /*  语言选择器 */
    }

    footer {
        position: fixed;
        font-size: 24px
    }

    footer #bottom-nav a {
        font-size: 18px;
        padding: 8px;
    }

    footer #bottom-nav i {
        font-size: 18px;
        margin-bottom: 3px;
    }

    #products .container .waterfall {
        justify-content: center;
    }
	 #cart-items .cart-list {
        padding: 0 10px;
    }

    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .cart-item-image {
        margin-bottom: 10px;
    }

    .cart-item-details {
        margin-left: 0;
        margin-bottom: 10px;
    }

    .cart-item-actions {
        align-items: flex-start;
    }

    #products .container .waterfall {
        justify-content: center;
    }

}