/* common.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}
a {
    text-decoration: none;
    color: #333;
}
ul {
    list-style: none;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}
/* Header */
header {
    background:#fff;
    box-shadow:0 1px 4px #ddd;
    position:sticky;
    top:0;
    z-index:999;
}
.header-top {
    padding:8px 0;
    background:#f7f7f7;
    font-size:13px;
}
.header-top .container {
    display:flex;
    justify-content:space-between;
}
.header-main {
    padding:16px 0;
    display:flex;
    align-items:center;
    justify-content:space-between;
}
.logo-area {
    font-size:22px;
    font-weight:bold;
}
.search-box {
    flex:0 1 450px;
    display:flex;
}
.search-box input {
    flex:1;
    padding:10px 12px;
    border:1px solid #ddd;
    border-right:none;
    outline:none;
}
.search-box button {
    padding:0 16px;
    background:#222;
    color:#fff;
    border:none;
    cursor:pointer;
}
.header-icons {
    display:flex;
    gap:20px;
    font-size:20px;
}
.header-icons span {
    cursor:pointer;
    position:relative;
}
.badge {
    position:absolute;
    top:-8px;
    right:-8px;
    background:#e53935;
    color:#fff;
    border-radius:50%;
    width:18px;
    height:18px;
    font-size:11px;
    display:flex;
    align-items:center;
    justify-content:center;
}
nav.main-nav {
    background:#222;
}
.main-nav ul {
    display:flex;
    gap:24px;
    padding:12px 0;
}
.main-nav a {
    color:#fff;
}
.main-nav a:hover {
    color:#ffc107;
}

/* 侧边弹窗 购物车 / 收藏 */
.side-drawer {
    position:fixed;
    top:0;
    right:-380px;
    width:380px;
    height:100vh;
    background:#fff;
    box-shadow:-2px 0 10px #0003;
    z-index:1000;
    transition:right 0.3s ease;
    overflow-y:auto;
}
.side-drawer.open {
    right:0;
}
.drawer-header {
    padding:16px;
    border-bottom:1px solid #eee;
    display:flex;
    justify-content:space-between;
    align-items:center;
}
.drawer-close {
    cursor:pointer;
    font-size:22px;
}
.drawer-body {
    padding:16px;
}
.drawer-footer {
    padding:16px;
    border-top:1px solid #eee;
}
.overlay {
    position:fixed;
    inset:0;
    background:#0005;
    z-index:999;
    display:none;
}
.overlay.show {
    display:block;
}
.cart-item, .wish-item {
    display:flex;
    gap:12px;
    padding:12px 0;
    border-bottom:1px solid #eee;
}
.cart-item img, .wish-item img {
    width:70px;
    height:70px;
    object-fit:cover;
}
.item-info {
    flex:1;
}
.item-name {
    font-size:14px;
}
.item-price {
    color:#e53935;
    margin:4px 0;
}
.qty-wrap {
    display:flex;
    align-items:center;
    gap:8px;
}
.qty-wrap button {
    width:24px;height:24px;
    border:1px solid #ddd;
    background:#fff;
    cursor:pointer;
}
.remove-btn {
    color:#e53935;
    cursor:pointer;
    font-size:14px;
}

/* 首页轮播 */
.banner-slider {
    height:420px;
    background:#f2f2f2;
    position:relative;
    overflow:hidden;
}
.slide-item {
    position:absolute;
    inset:0;
    opacity:0;
    transition:opacity 0.5s;
    background:#ddd;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:32px;
}
.slide-item.active {
    opacity:1;
}
.slider-arrow {
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    font-size:30px;
    color:#fff;
    background:#0004;
    padding:8px 12px;
    cursor:pointer;
    z-index:10;
}
.slider-prev {left:16px;}
.slider-next {right:16px;}

/* 产品通用样式 */
.section-title {
    margin:40px 0 20px;
    font-size:24px;
    border-bottom:2px solid #222;
    padding-bottom:8px;
}
.product-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
    gap:24px;
}
.product-card {
    border:1px solid #eee;
    border-radius:6px;
    overflow:hidden;
    transition:0.2s;
}
.product-card:hover {
    box-shadow:0 4px 12px #0001;
}
.product-card-img {
    height:280px;
    background:#f7f7f7;
    position:relative;
}
.product-card-img img {
    width:100%;
    height:100%;
    object-fit:cover;
}
.card-action {
    position:absolute;
    bottom:0;
    left:0;
    right:0;
    background:#0007;
    display:flex;
    justify-content:center;
    gap:12px;
    padding:8px 0;
    opacity:0;
    transition:0.2s;
}
.product-card:hover .card-action {
    opacity:1;
}
.card-action button {
    background:#fff;
    border:none;
    width:32px;height:32px;
    border-radius:50%;
    cursor:pointer;
}
.product-card-body {
    padding:12px;
}
.product-name {
    font-size:15px;
    margin-bottom:6px;
}
.product-price {
    color:#e53935;
    font-weight:bold;
}

/* 列表视图 */
.product-list-view {
    display:flex;
    flex-direction:column;
    gap:16px;
}
.list-item {
    display:flex;
    border:1px solid #eee;
    padding:12px;
    gap:16px;
}
.list-item-img {
    width:120px;height:120px;
}
.list-item-img img {
    width:100%;height:100%;object-fit:cover;
}
.list-item-info {
    flex:1;
}

/* 产品列表页筛选栏 */
.filter-bar {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
    flex-wrap:wrap;
    gap:12px;
}
.filter-group {
    display:flex;
    gap:10px;
    align-items:center;
}
.filter-group select {
    padding:8px 10px;
    border:1px solid #ddd;
}
.view-switch button {
    padding:8px 12px;
    border:1px solid #ddd;
    background:#fff;
    cursor:pointer;
}
.view-switch button.active {
    background:#222;
    color:#fff;
}

/* 分页 */
.pagination {
    display:flex;
    justify-content:center;
    margin:30px 0;
    gap:8px;
}
.pagination button {
    padding:8px 14px;
    border:1px solid #ddd;
    background:#fff;
    cursor:pointer;
}
.pagination button.active {
    background:#222;
    color:#fff;
    border-color:#222;
}

/* 产品详情页 */
.detail-wrap {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:32px;
    margin:30px 0;
}
.detail-img-wrap {
    background:#f7f7f7;
    min-height:450px;
}
.detail-img-wrap img {
    width:100%;height:100%;object-fit:cover;
}
.detail-info h1 {
    font-size:26px;
    margin-bottom:12px;
}
.detail-price {
    font-size:24px;
    color:#e53935;
    margin:16px 0;
}
.detail-desc {
    line-height:1.6;
    color:#555;
    margin-bottom:24px;
}
.detail-buttons {
    display:flex;
    gap:12px;
}
.detail-buttons button {
    padding:12px 24px;
    border:none;
    cursor:pointer;
    font-size:16px;
}
.btn-addcart {
    background:#222;
    color:#fff;
}
.btn-wish {
    border:1px solid #222;
    background:#fff;
}
.reviews-section {
    margin:40px 0;
}
.review-item {
    padding:16px 0;
    border-bottom:1px solid #eee;
}
.review-name {
    font-weight:bold;
}
.review-text {
    margin-top:6px;
    color:#555;
}

/* 页面通用内容页 about / contact / policy */
.content-page {
    padding:40px 0;
}
.content-page h2 {
    margin-bottom:20px;
}
.content-page p {
    line-height:1.7;
    margin-bottom:14px;
}
.contact-form {
    max-width:600px;
}
.contact-form input,.contact-form textarea {
    width:100%;
    padding:12px;
    margin-bottom:14px;
    border:1px solid #ddd;
}
.contact-form button {
    padding:12px 24px;
    background:#222;
    color:#fff;
    border:none;
    cursor:pointer;
}

/* Footer */
footer {
    background:#222;
    color:#fff;
    padding:40px 0 20px;
    margin-top:60px;
}
.footer-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:24px;
    margin-bottom:30px;
}
.footer-col h4 {
    margin-bottom:16px;
    font-size:17px;
}
.footer-col ul li {
    margin-bottom:8px;
}
.footer-col a {
    color:#ccc;
}
.footer-col a:hover {
    color:#fff;
}
.payment-img {
    max-width:240px;
    margin-top:12px;
}
.copyright {
    text-align:center;
    padding-top:20px;
    border-top:1px solid #444;
    font-size:13px;
    color:#aaa;
}

/* 历史浏览记录 */
.history-wrap {
    margin:20px 0;
}
.history-list {
    display:flex;
    gap:12px;
    overflow-x:auto;
    padding-bottom:8px;
}
.history-item {
    width:120px;
    flex-shrink:0;
}
.history-item img {
    width:100px;height:100px;object-fit:cover;
}

/* 响应式简单适配 */
@media(max-width:768px) {
    .header-main {
        flex-direction:column;
        gap:12px;
    }
    .search-box {
        width:100%;
    }
    .detail-wrap {
        grid-template-columns:1fr;
    }
    .side-drawer {
        width:100%;
        right:-100%;
    }
}
