/* 侧边栏组件样式 */

.sidebar-widget {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
}

.product-widget {
    padding: 1rem 1rem 0.5rem 1rem;
}

.product-widget .product-item {
    margin: 0 -0.25rem 0.75rem -0.25rem;
    padding: 0.75rem;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.product-widget .product-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
}

.product-widget .product-item:last-child {
    margin-bottom: 0;
}

.sidebar-widget h6 {
    margin-bottom: 1rem;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-list li {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-list a {
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
    display: block;
}

.sidebar-list a:hover {
    color: var(--primary-color);
}

.sidebar-meta {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.25rem;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.category-item:last-child {
    border-bottom: none;
}

.category-item a {
    color: #333;
    text-decoration: none;
    flex-grow: 1;
}

.category-item a:hover {
    color: var(--primary-color);
}

.category-count {
    background: #e9ecef;
    color: #6c757d;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-item {
    background: #f8f9fa;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.tag-item:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-color: var(--primary-color);
}

.contact-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.contact-widget h6 {
    color: white;
    border-bottom-color: rgba(255,255,255,0.3);
}

.contact-widget .btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    margin-top: 1rem;
}

.contact-widget .btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    color: white;
}

.newsletter-widget {
    background: #f8f9fa;
}

.newsletter-widget .form-control {
    border: 1px solid #dee2e6;
    margin-bottom: 0.75rem;
}

.newsletter-widget .btn {
    width: 100%;
}

.stats-widget {
    text-align: center;
}

.stat-item {
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-widget img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 1rem;
}

.product-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto;
    gap: 0.75rem 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.product-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.product-item:last-child {
    margin-bottom: 0;
}

.product-widget img {
    grid-row: 1 / 3;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.sidebar-product-placeholder {
    grid-row: 1 / 3;
    width: 80px;
    height: 80px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.product-info {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.product-info h6 {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    line-height: 1.3;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-info h6 a {
    color: #333;
    transition: color 0.3s ease;
}

.product-info h6 a:hover {
    color: var(--primary-color);
}

.product-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    white-space: nowrap;
}

.original-price {
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
    font-size: 0.7rem;
    margin-left: 0.4rem;
}

.product-stats {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-sales-badge {
    background: var(--primary-color);
    color: white;
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-weight: 500;
}

.product-sales-badge i {
    font-size: 0.6rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar-widget {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
        font-size: 1rem;
    }
    
    .sidebar-widget h6 {
        font-size: 1.1rem;
        margin-bottom: 1.25rem;
    }
    
    .sidebar-list a {
        font-size: 1rem;
        padding: 0.75rem 0;
        line-height: 1.5;
    }
    
    .sidebar-list li {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }
    
    .category-item {
        padding: 0.75rem 0;
        font-size: 1rem;
    }
    
    .category-count {
        font-size: 0.85rem;
        padding: 0.4rem 0.7rem;
    }
    
    .product-item {
        grid-template-columns: 90px 1fr auto;
        padding: 1rem;
        margin-bottom: 1.25rem;
    }
    
    .product-widget img {
        width: 90px;
        height: 90px;
    }
    
    .sidebar-product-placeholder {
        width: 90px;
        height: 90px;
    }
    
    .product-info h6 {
        font-size: 1rem;
        margin-bottom: 0.4rem;
        line-height: 1.4;
        max-height: 2.8em;
    }
    
    .product-price {
        font-size: 0.9rem;
    }
    
    .original-price {
        font-size: 0.8rem;
    }
    
    .product-sales-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }
    
    .tag-cloud {
        justify-content: flex-start;
        gap: 0.75rem;
    }
    
    .tag-item {
        font-size: 0.9rem;
        padding: 0.4rem 0.9rem;
        border-radius: 18px;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    .contact-widget .btn {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    .newsletter-widget .form-control {
        font-size: 1rem;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .newsletter-widget .btn {
        font-size: 1rem;
        padding: 0.75rem;
    }
}
