/* ========== common.css 全局公共样式 ========== */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial, Helvetica, sans-serif;
}
:root{
    --primary:#222;
    --accent:#c89b63;
    --light:#f7f7f7;
    --gray:#888;
    --border:#e5e5e5;
}
body{
    background:#fff;
    color:#333;
    line-height:1.6;
}
a{
    text-decoration:none;
    color:inherit;
}
ul{list-style:none;}
button{
    cursor:pointer;
    border:none;
    background:none;
}
img{
    max-width:100%;
    display:block;
}
.container{
    max-width:1240px;
    margin:0 auto;
    padding:0 15px;
}

/* ==== Header ==== */
.site-header{
    border-bottom:1px solid var(--border);
    position:sticky;
    top:0;
    background:#fff;
    z-index:99;
}
.header-inner{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:16px 0;
}
.header-search{
    flex:0 1 420px;
    display:flex;
}
.header-search input{
    width:100%;
    border:1px solid var(--border);
    padding:9px 14px;
    border-radius:4px 0 0 4px;
    outline:none;
}
.header-search button{
    background:var(--primary);
    color:white;
    padding:0 16px;
    border-radius:0 4px 4px 0;
}
.header-actions{
    display:flex;
    gap:22px;
    align-items:center;
}
.icon-btn{
    font-size:22px;
    position:relative;
}
.badge{
    position:absolute;
    top:-6px;
    right:-8px;
    background:var(--accent);
    color:#fff;
    font-size:11px;
    border-radius:50%;
    width:18px;height:18px;
    display:flex;
    align-items:center;
    justify-content:center;
}
.nav-menu{
    display:flex;
    gap:28px;
    padding:12px 0;
}
.nav-menu a:hover{
    color:var(--accent);
}

/* === 侧滑弹窗：购物车、收藏 === */
.overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.45);
    z-index:198;
    opacity:0;
    visibility:hidden;
    transition:0.25s;
}
.overlay.active{
    opacity:1;
    visibility:visible;
}
.side-drawer{
    position:fixed;
    top:0;
    right:-420px;
    width:400px;
    max-width:100%;
    height:100vh;
    background:#fff;
    z-index:199;
    transition:right 0.3s ease;
    display:flex;
    flex-direction:column;
}
.side-drawer.active{
    right:0;
}
.drawer-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:18px 20px;
    border-bottom:1px solid var(--border);
}
.drawer-close{
    font-size:24px;
}
.drawer-body{
    flex:1;
    overflow-y:auto;
    padding:16px 20px;
}
.drawer-item{
    display:flex;
    gap:12px;
    padding:12px 0;
    border-bottom:1px solid var(--border);
}
.drawer-item img{
    width:70px;height:70px;
    object-fit:cover;
}
.drawer-item-info h4{
    font-size:14px;margin-bottom:4px;
}
.drawer-item-price{
    color:var(--accent);
    font-weight:bold;
}
.drawer-footer{
    padding:18px 20px;
    border-top:1px solid var(--border);
}
.btn{
    display:block;
    width:100%;
    background:var(--primary);
    color:#fff;
    text-align:center;
    padding:12px;
    border-radius:4px;
}
.btn:hover{
    background:#444;
}

/* ==== Carousel 首页轮播 ==== */
.carousel-wrap{
    position:relative;
    overflow:hidden;
    height:440px;
}
.carousel-list{
    display:flex;
    height:100%;
    transition:transform 0.5s;
}
.carousel-slide{
    min-width:100%;
}
.carousel-slide img{
    width:100%;
    height:100%;
    object-fit:cover;
}
.carousel-arrow{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    width:42px;height:42px;
    background:rgba(255,255,255,0.75);
    border-radius:50%;
    font-size:22px;
    z-index:2;
}
.carousel-prev{left:20px;}
.carousel-next{right:20px;}

/* ==== Product Card 产品卡片 ==== */
.product-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(240px, 1fr));
    gap:24px;
    margin:30px 0;
}
.product-card{
    border:1px solid var(--border);
    border-radius:6px;
    overflow:hidden;
    transition:0.2s;
}
.product-card:hover{
    box-shadow:0 4px 14px rgba(0,0,0,0.08);
}
.card-img-wrap{
    position:relative;
    height:220px;
}
.card-img-wrap img{
    width:100%;height:100%;
    object-fit:cover;
}
.card-action{
    position:absolute;
    bottom:0;
    left:0;right:0;
    background:rgba(0,0,0,0.55);
    display:flex;
    justify-content:center;
    gap:10px;
    padding:8px 0;
    opacity:0;
    transition:0.2s;
}
.product-card:hover .card-action{
    opacity:1;
}
.card-action button{
    background:#fff;
    padding:6px 10px;
    border-radius:3px;
    font-size:13px;
}
.card-body{
    padding:14px;
}
.card-title{
    font-size:15px;
    margin-bottom:6px;
}
.card-price{
    color:var(--accent);
    font-weight:bold;
    font-size:17px;
}

/* === 历史浏览模块 === */
.history-section{
    margin:40px 0;
}
.history-list{
    display:flex;
    gap:16px;
    overflow-x:auto;
    padding-bottom:8px;
}
.history-item{
    min-width:140px;
}
.history-item img{
    width:100%;height:120px;
    object-fit:cover;
}

/* === Product List Page Filter === */
.filter-bar{
    display:flex;
    gap:16px;
    align-items:center;
    margin:24px 0;
    flex-wrap:wrap;
}
.filter-bar input{
    padding:7px 10px;
    border:1px solid var(--border);
    width:110px;
}
.pagination{
    display:flex;
    gap:8px;
    margin:40px 0;
    justify-content:center;
}
.pagination button{
    border:1px solid var(--border);
    width:36px;height:36px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:3px;
}
.pagination button.active{
    background:var(--primary);
    color:white;
    border-color:var(--primary);
}

/* === Product Detail Page === */
.detail-wrap{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:40px;
    margin:40px 0;
}
.detail-img{
    height:480px;
}
.detail-img img{
    width:100%;height:100%;
    object-fit:cover;
}
.detail-price{
    font-size:26px;
    color:var(--accent);
    margin:14px 0;
}
.detail-desc{
    margin:20px 0;
    color:#555;
}
.detail-buttons{
    display:flex;
    gap:12px;
    margin-top:30px;
}
.detail-buttons button{
    flex:1;
    padding:13px;
    border-radius:4px;
}
.btn-cart{
    background:var(--primary);
    color:white;
}
.btn-wish{
    border:1px solid var(--border);
}

/* === Page Content (about / contact / policy pages) === */
.page-content{
    padding:40px 0 60px;
    max-width:900px;
}
.page-content h1{
    margin-bottom:24px;
    font-size:28px;
}
.page-content p{
    margin-bottom:14px;
    color:#444;
}
.contact-info li{
    margin:10px 0;
}

/* === Footer === */
.site-footer{
    background:#1a1a1a;
    color:#bbb;
    padding:45px 0 25px;
}
.footer-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(220px,1fr));
    gap:30px;
    margin-bottom:35px;
}
.footer-col h4{
    color:#fff;
    margin-bottom:16px;
}
.footer-col a{
    display:block;
    margin:8px 0;
    font-size:14px;
}
.footer-bottom{
    border-top:1px solid #333;
    padding-top:20px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap:12px;
}
.payment-icons img{
    height:28px;
}

/* 响应式 */
@media(max-width:768px){
    .header-inner{
        flex-direction:column;
        gap:12px;
    }
    .detail-wrap{
        grid-template-columns:1fr;
    }
    .side-drawer{
        width:100%;
        right:-100%;
    }
    .carousel-wrap{
        height:260px;
    }
}