/* assets/css/style.css */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #fff;
    --border-radius: 8px;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 商品网格布局 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.product-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger-color);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3rem;
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8rem;
}

.product-price {
    color: var(--danger-color);
    font-size: 1.3rem;
    font-weight: bold;
    margin: 1rem 0;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.product-actions .btn {
    flex: 1;
    text-align: center;
    padding: 0.7rem 0;
    font-size: 0.9rem;
}

/* 商品详情页样式 */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.product-detail-image {
    background: #f5f5f7;
    border-radius: var(--border-radius);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.product-detail-image i {
    font-size: 8rem;
    color: #ccc;
}

.product-detail-info h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.product-price-large {
    font-size: 2.5rem;
    color: var(--danger-color);
    font-weight: bold;
    margin: 1.5rem 0;
}

.product-meta {
    display: flex;
    gap: 2rem;
    margin: 1.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.meta-item {
    text-align: center;
}

.meta-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.meta-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: var(--white);
    border-radius: 4px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
}