/* Header Grid Layout */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas: "nav-toggle logo main-nav header-actions";
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Grid Areas */
.nav-toggle {
    grid-area: nav-toggle;
    justify-self: start;
}

.site-logo {
    grid-area: logo;
    justify-self: center;
}

.site-logo img {
    max-height: 60px; /* 增加LOGO高度 */
    width: auto;
    height: auto;
}

.main-nav {
    grid-area: main-nav;
    justify-self: center;
}

.header-actions {
    grid-area: header-actions;
    justify-self: end;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-inner {
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "nav-toggle logo header-actions";
        gap: 15px;
        padding: 10px 15px;
    }
    
    .main-nav {
        display: none; /* 隐藏主导航，使用移动端侧边栏 */
    }
    
    .site-logo img {
        max-height: 50px; /* 移动端也相应增加LOGO高度 */
        width: auto;
    }
}

/* 移动端侧边栏样式 */
.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #fff;
    z-index: 1001;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.mobile-nav-drawer.active {
    left: 0;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 汉堡菜单按钮样式 */
.nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    transition: all 0.3s ease;
}

/* 购物车样式 */
.header-cart {
    position: relative;
    color: #333;
    text-decoration: none;
    font-size: 18px;
    padding: 8px;
}

.cart-count-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}
