/* styles.css */

:root {
    --theme-color: #ff771d; /* 定义主题色 */
}

body {
    font-family: Arial, sans-serif;
    margin: 0 auto;
    padding: 0;
    width: 50%;
    background-color: #f9f9f9;
}
        a {
         text-decoration: none;
         color: initial;
       }
.container {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    position: relative; /* 相对定位以便绝对定位头部 */
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    padding: 10px 0;
    position: fixed; /* 相对定位 */
    top: 0;
    z-index: 10; /* 确保在轮播图上方 */
    transition: background-color 0.5s ease-in-out;
    background-color: rgba(255, 255, 255, 0); /* 全透明白色背景 */
    margin: 0 auto; /* 居中对齐 */
}

.header .location {
    font-size: 1.2em;
    display: flex;
    align-items: center;
    padding: 0 10px;
width: 15vw;
}

.header .location img {
    width: 1.5em; /* 定位图标大小为文字的0.9倍 */
    height: 1.5em;
    margin-right: 5px;
}

.header .location .dropdown-icon {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid white; /* 修改为白色 */
    margin-left: 5px;
}

.header .search-bar {
    width: 33.5vw;
    display: flex;
    align-items: center;
}

.header .search-bar input {
    padding: 5px 10px;
    width: 80%;
    border: none;
    border-radius: 4px 0 0 4px;
    background-color: rgba(255, 255, 255, 0.8); /* 输入框背景色半透明 */
    transition: box-shadow 0.3s ease;
}

.header .search-bar button {
    padding: 5px 15px;
    border: none;
    border-radius: 0 4px 4px 0;
    background-color: transparent; /* 使用主题色 */
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 15%;
    border: 1px solid white;
}

.header .search-bar button:hover {
    background-color: darken(var(--theme-color), 10%); /* 深化主题色 */
}

.header .search-bar input:focus {
    outline: none;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* ... 下滑时头部的背景色 ... */
.header.scrolled {
    background-color: #ff771d; /* 增加背景色 */
    transition: background-color 0.3s ease; /* 背景色变化过渡 */
    color: #fff;
}
.header.scrolled .search-bar button{
    background-color:#fff; /* 增加背景色 */    
    color:#ff771d; /* 增加背景色 */    
}



/* 新分类样式 */
.carousel-container {
    position: relative;
    overflow: hidden;
    height: 50vw; /* 宽高一致 */
    width: 100%;
}
.carousel {
    position: relative;
    overflow: hidden;
    height: 100%;
    width: 100%;
}
.carousel-inner {
    display: flex;
    transition: transform 0.5s ease-in-out;
}
.carousel-item {
    min-width: 100%;
    box-sizing: border-box;
}
.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.categories {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(19%, 1fr));
    gap: 10px;
    background-color: rgb(255, 255, 255);
    position: absolute;
    border-radius: 15px 15px 0 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9; /* 确保在幻灯片之下 */
    width: 90%;
    margin: 0 auto;
}
.category-icon {
    display: flex;
    justify-content: center;
}
.category-icon img {
    width: 100%;
}
.category {
    background-color: rgba(255, 255, 255, 0.7); /* 半透明背景 */
    padding: 10px;
    text-align: center;
    border-radius: 5px;
}
/* 确新分类样式结尾 */



.highlight-container {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background-color: #ffffff; /* 白色背景 */
    border-bottom: 2px solid #eee; /* 浅灰色边框 */
}

.highlight-category {
    display: flex;
    align-items: center;
    width: calc(48% - 20px); /* 每行2个项目 */
    padding: 15px;
    background-color: transparent; /* 去掉背景色 */
    margin: 10px;
    box-sizing: border-box;
    transition: transform 0.2s;
}

.highlight-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.highlight-category img {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    border-radius: 8px;
}

.highlight-category .description {
    flex-grow: 1;
}

.ad-container {
    display: flex;
    justify-content: space-between;
    padding: 5px;
    margin-bottom: 5px;
    background-color: transparent; /* 去掉广告容器背景色 */
    border: none; /* 去掉广告容器边框 */
}

.ad-item.ad-item-wide,
.combined-ad-item {
    width: 49.5%; /* 设置两个子容器宽度各为50%减去间距的一半 */
    box-sizing: border-box;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: transparent; /* 设置广告项目背景色 */
    border: none; /* 去掉边框 */
    padding: 0; /* 内边距设为0 */
}

.ad-item.ad-item-wide img,
.combined-ad-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: none; /* 去掉广告图片边框 */
}

.ad-item.ad-item-wide:hover,
.combined-ad-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.combined-ad-item .ad-row {
    display: flex;
    justify-content: space-between;
}



.combined-ad-item .ad-row + img {
    margin-top: 10px; /* 增加上边距 */
    margin-left: 0; /* 删除广告4的左边距 */
}

.ad-item.ad-item-wide {
    margin-right: 0; /* 删除广告1的右边距 */
    position: relative;
    overflow: hidden;
}

.ad-item.ad-item-wide img {
    position: absolute;
    animation: scrollImages 15s linear infinite;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes scrollImages {
    0% {
        bottom: -100%;
        left: 0;
    }
    25% {
       bottom: 0;
        left: 0;
    }
    50% {
        top: 0;
        left: -100%;
    }
    75% {
        bottom: 0;
        left: 0;
    }
    100% {
        bottom: -100%;
        left: 0;
    }
}

        .brand {
            background: #fff;
            border-radius: 5px;
            margin-bottom: 10px;
            padding: 10px;
            color: #6c757d;        
            margin-top: 10px;
            align-items: center;
        }
        .brands {
            display: flex;
            overflow-x: scroll;
            scrollbar-width: none; /* Firefox */        
        }
        .brand-name {
            font-weight: bold;
            color: #ff771d;
        }
        .brand-dec {
            font-weight: bold;
            font-size: 14px;
            display: flex;
            justify-content: center;
            padding: 0 5px;
        }
        .brand-details {
    display: flex;
    justify-content:space-between;
    align-items: center;
}
        .bran img {
    width: 15vw; /* 修改产品图的宽度 */
    padding: 5px;
}
        .bran:last-child {
            margin-right: 0; /* 最后一个产品的右边距设为0 */
        }

.products {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    background-color: #f9f9f9;
    margin-bottom: 80px; /* 增加底部外边距 */;
}

.product-card {
    border: 1px solid #ddd;
    border-radius: 8px;   
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    width: 49.5%; /* 每行2个项目 */
    box-sizing: border-box;
    position: relative; /* 相对定位以便绝对定位内部元素 */
    margin-bottom: 10px; /* 增加底部外边距 */;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}
.product-image {
    position: relative;
}

.distance-info {
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    padding: 5px 0;
    font-size: 12px;
    color: #fff;
}
.product-location {
    background-color: rgba(0, 0, 0, 0.5); /* 背景颜色可调整 */
    color: white; /* 可选：设置文字颜色为白色，以便在绿色背景下更清晰 */
    padding: 2px 5px; /* 可选：添加内边距以增加可读性 */
}
.group-button {
    background-color: red;
    color: white;
    padding: 2px 5px;
    display: inline-block;
    height: 100%; /* 使高度与距离信息一致 */
}

.product-time {
    background-color: rgba(0, 0, 0, 0.5); /* 背景颜色可调整 */
    color: white; /* 可选：设置文字颜色为白色，以便在绿色背景下更清晰 */
    padding: 2px 5px; /* 可选：添加内边距以增加可读性 */
}
.product-waimai {
    background-color: #ff771d;
    color: white;
    padding: 2px 5px;
    display: inline-block;
    height: 100%; /* 使高度与距离信息一致 */
}

.product-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    position: relative; /* 相对定位以便绝对定位标签 */
}

.product-image .random-tag {
    position: absolute;
    right: 10px;
    top: 10px;
    background-color: var(--theme-color); /* 使用主题色 */
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
}

.product-details h3 {
    margin: 5px 0 0 5px;
    font-size: 1em;
    color: #333;
}

.additional-info {
    display: flex;
    flex-direction: row; /* 信息垂直排列 */
    align-items: flex-start; /* 信息左对齐 */
    margin-bottom: 10px;
    font-size: 0.9em; /* 调整价格字体大小 */
    margin:5px;
    color: #9c9c9c;
}

.info-item {
    display: flex;
    font-size: 14px;
    justify-content:space-between;
    align-items:flex-end;
    margin: 5px;
}
.info-buy {
    display: flex;
    font-size: 14px;
    justify-content:space-evenly;
    align-items:flex-end;
}
.info-dec {
    font-size: 14px;
    margin:0 5px 0 0;
}

.info-item img {
    width: 16px;
    height: 16px; 
    margin-right: 5px;
}

.price-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.price-button .highlight-prices {
    margin-bottom: 5px;
}

.price-button .highlight-prices span {
    font-size: 1.5em;
}
.strikethrough {
    text-decoration: line-through;
    color: #9c9c9c; /* 你可以根据需要调整颜色 */
    margin-left: 5px;
}

.larger-text {
    font-size: 1.5em;
    color:#ff771d; /* 可以根据需要调整颜色 */
}

.buy-button {
    display: inline-block;
    padding: 2px 8px;
    background-color: #ff771d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.5em;
    align-items: center;
}

.buy-button:hover {
    background-color: #0056b3;
}
.zero-yuan-purchase {
    font-size: 14px;
    color: #9c9c9c; /* 你可以根据需要调整颜色 */
}

a {
    text-decoration: none;
}


.footer-menu {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #f8f9fa;
    padding: 10px 0;
    border-top: 1px solid #e0e0e0;
    position: fixed;
    width: 50%;
bottom: 0;
z-index: 9;
}

.footer-menu a {
    text-align: center;
    color: #333;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-menu img {
    width: 30px;
    height: 30px;
    margin-bottom: 5px;
}

.footer-menu a span {
    font-size: 14px;
}

@media (max-width: 768px) {
    body {
        width: 100%;
    }

    .header .location {
        width: 40%;
        font-size: 1em;
    }
    .header .location img {
        width: 1.08em;
        height: 1.08em;
    }
    .header .location .dropdown-icon {
        margin-left: 5px;
    }
    .header .search-bar input {
        width: 60%;
    }


    .category-item {
        width: calc(20% - 20px); /* 每行5个项目 */
    }
    .category-item img {
        width: 50px;
        height: 50px;
    }
    
    .highlight-category {
        width: calc(100% - 40px); /* 每行1个项目 */
    }

    .footer-menu {
        width: 100%; /* 小屏幕时宽度调整为100% */
    }
}

@media (max-width: 480px) {
    body {
        width: 100%;
    }
 .header {
        padding: 0px; 
    }
    .header .location {
        font-size: 0.9em; /* 减小字体大小 */
        padding: 10px; 
    }
    .header .location img {
        width: 1.5em;
        height: 1.5em;
    }
    .header .location .dropdown-icon {
        margin-left: 5px;
    }
    .header .search-bar {
         width: 70vw; /* 搜索栏宽度 */
    }
    .header .search-bar input {
        width: 70%; /* 减少输入框宽度 */
        padding: 5px 8px; /* 减少内边距 */
    }
    .header .search-bar button {
        padding: 4px 10px; /* 减少按钮内边距 */
        width: 15vw;    
        margin-right: 5px;
    }
    .carousel-container {
        height: 100%; /* 进一步调整高度 */
    }


        .categories {
            padding: 5px;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(18%, 2fr));
            gap: 0;
            bottom: 0;
        }
       .category {
            font-size: 0.9em;
            padding: 0;
        }
       .category-icon img {
            width: 60px;
            height: 100%;
        }
.highlight-container {
    display: flex;
    justify-content: space-around;
    padding: 0;
    background-color: #ffffff; /* 白色背景 */
    border-bottom: 2px solid #eee; /* 浅灰色边框 */
}
 .highlight-category {
        width: 100%;
        font-size: 14px;
        margin: 5px;
        border-radius: 5px;
    }
.highlight-category img {
    width: 45px;
    height: 45px;
    margin-right: 10px;
    border-radius: 8px;
}

.highlight-category .description {
    flex-grow: 1;
}
.highlight-category .description h4 {
        width: 100%; 
        font-size: 14px;
        margin: 5px;
        border-radius: 5px;
}
.highlight-category .description p {
        width: 100%; 
        font-size: 12px;
        margin: 5px;
        border-radius: 5px;
        color: #9c9c9c;
}


           .bran img {
                width: 28.5vw;
            }

    .product-image img {
        width: 100%; /* 图片宽度占满整个卡片 */
        height: auto;
    }
    .product-image .random-tag {
        right: 5px;
        top: 5px;
        padding: 2px 5px;
        font-size: 0.7em; /* 减小标签字体大小 */
    }
    .product-details h3 {
        font-size: 1em; /* 保持标题字体大小不变 */
        line-height: 0.8;
        margin: 5px 0 0 5px;
    }
    .additional-info {
        display: flex;
        flex-direction: row; /* 信息垂直排列 */
        align-items: flex-start; /* 信息左对齐 */
        margin-bottom: 10px;
        font-size: 0.9em; /* 调整价格字体大小 */
        margin:5px;
        color: #9c9c9c;
    }

    .info-dec {
        font-size: 14px;
        margin:0 5px 0 0;
    }

    .info-item img {
        width: 16px;
        height: 16px;
        margin-right: 5px;
    }
    .price-button {
        width: 90%; /* 价格按钮卡片 */
       text-align: center;
    }

    .price-button .highlight-prices span {
        font-size: 1em; /* 调整价格字体大小 */
    }
.strikethrough {
    text-decoration: line-through;
    color: #9c9c9c; /* 你可以根据需要调整颜色 */
    margin-left: 5px;
}
.products {
    margin: 0 2%;
}

/* 放大文字 */
.larger-text {
    font-size: 1.5em;
    color:#ff771d; /* 可以根据需要调整颜色 */
}

   .brands,.products {
        scrollbar-width: none; /* Firefox */
    }
   .brands::-webkit-scrollbar,.products::-webkit-scrollbar {
        width: 0; /* WebKit 浏览器滚动条宽度设为 0 */
    }


.footer-menu {
    padding: 5px 0;
}



    .footer-menu a span {
        font-size: 12px;
    }
}