/* ===================== 全局公共样式 common.css ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
:root {
    --primary: #2563eb;
    --dark: #1f2937;
    --light: #f3f4f6;
    --gray: #6b7280;
    --danger: #ef4444;
    --white: #ffffff;
}
body {
    color: var(--dark);
    background-color: #fff;
    line-height: 1.6;
}
ul {
    list-style: none;
}
a {
    text-decoration: none;
    color: inherit;
}
button, input {
    font-family: inherit;
}
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.site-header {
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 99;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.nav-list {
    display: flex;
    gap: 28px;
}
.nav-list a {
    font-weight: 500;
    transition: color 0.2s;
}
.nav-list a:hover {
    color: var(--primary);
}
.header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}
.icon-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    position: relative;
}
.badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

/* 轮播 */
.slider-wrap {
    width: 100%;
    height: 420px;
    overflow: hidden;
    position: relative;
}
.slider-item {
    width: 100%;
    height: 100%;
    display: none;
}
.slider-item.active {
    display: block;
}
.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.7);
    border: none;
    cursor: pointer;
    font-size: 20px;
}
.slider-prev { left:20px; }
.slider-next { right:20px; }

/* 区块标题 */
.section-title {
    font-size: 26px;
    margin:40px 0 24px;
    text-align: center;
}

/* 商品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
    gap:24px;
    margin-bottom:40px;
}
.product-card {
    border:1px solid #eee;
    border-radius:8px;
    overflow:hidden;
    transition: 0.3s;
}
.product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.product-img-box {
    height:200px;
    overflow:hidden;
}
.product-img-box img {
    width:100%;
    height:100%;
    object-fit:cover;
    transition:0.4s;
}
.product-card:hover .product-img-box img {
    transform: scale(1.05);
}
.product-info {
    padding:14px;
}
.product-name {
    font-size:15px;
    margin-bottom:8px;
}
.product-price {
    color: var(--danger);
    font-weight:600;
    font-size:17px;
}
.product-buttons {
    display:flex;
    gap:8px;
    margin-top:12px;
}
.btn {
    padding:8px 12px;
    border-radius:4px;
    border:none;
    cursor:pointer;
    font-size:14px;
}
.btn-primary {
    background: var(--primary);
    color:#fff;
}
.btn-outline {
    background:transparent;
    border:1px solid var(--primary);
    color:var(--primary);
}

/* 分页 */
.pagination {
    display:flex;
    gap:8px;
    justify-content:center;
    margin:30px 0;
}
.page-btn {
    padding:6px 12px;
    border:1px solid #ddd;
    background:#fff;
    cursor:pointer;
}
.page-btn.active {
    background:var(--primary);
    color:#fff;
    border-color:var(--primary);
}

/* 侧边弹窗通用 */
.overlay {
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.5);
    z-index:1000;
    display:none;
}
.overlay.show {
    display:block;
}
.sidebar-drawer {
    position:fixed;
    top:0;
    right:-400px;
    width:380px;
    height:100%;
    background:#fff;
    transition:right 0.3s ease;
    z-index:1001;
    padding:20px;
    overflow-y:auto;
}
.sidebar-drawer.open {
    right:0;
}
.drawer-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}
.drawer-close {
    border:none;
    background:transparent;
    font-size:24px;
    cursor:pointer;
}
.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;
}

/* 详情页布局 */
.detail-wrap {
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap:40px;
    margin:40px 0;
}
.detail-img-main {
    width:100%;
    height:420px;
    object-fit:cover;
}

/* Footer */
.site-footer {
    background: var(--dark);
    color:#ccc;
    padding:50px 0 20px;
    margin-top:60px;
}
.footer-inner {
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
    gap:30px;
}
.footer-title {
    color:#fff;
    font-size:18px;
    margin-bottom:16px;
}
.footer-links li {
    margin-bottom:8px;
}
.footer-links a:hover {
    color:#fff;
}
.payment-img {
    margin-top:16px;
    max-width:260px;
}
.copyright {
    text-align:center;
    margin-top:40px;
    padding-top:20px;
    border-top:1px solid #374151;
}

/* 页面通用区块 */
.page-content {
    padding:40px 0;
    min-height: calc(100vh - 400px);
}
.page-content h1 {
    margin-bottom:24px;
    font-size:28px;
}
.page-content p {
    margin-bottom:14px;
}

#detail-img{
    width:100%;
    height:420px;
    object-fit: contain;
    object-position: center;
    background:#f7f7f7;
}