/*your custom css goes here*/

/* 产品卡片样式 */
.modern-product-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 8px 8px 16px 8px;
    padding: 12px;
}

.modern-product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.discount-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #ff4757;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.discount-text {
    font-size: 10px;
    line-height: 1;
}

.discount-percentage {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.product-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    margin-bottom: 8px;
}

.product-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.modern-product-card:hover .product-image {
    transform: scale(1.05);
}

.wholesale-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #2ed573;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
}

.product-actions {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-product-card:hover .product-actions {
    opacity: 1;
}

.action-btn {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.action-btn:hover {
    background: #007bff;
    color: white;
    transform: scale(1.1);
}

.action-btn i {
    font-size: 16px;
}

.product-content {
    padding: 8px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-pricing {
    margin-bottom: 8px;
}

.original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 14px;
    margin-right: 8px;
}

.current-price {
    color: #ff4757;
    font-size: 18px;
    font-weight: 700;
}

.product-rating {
    margin-bottom: 8px;
}

/* 评级星星颜色样式 */
.product-rating .las.la-star {
    color: #ddd !important;
    font-size: 14px !important;
    margin-right: 2px;
}

.product-rating .las.la-star.active {
    color: #ffc107 !important;
}

.product-rating .las.la-star.half {
    color: #ddd !important;
    position: relative;
}

.product-rating .las.la-star.half::before {
    content: '\f005';
    position: absolute;
    left: 0;
    width: 50%;
    overflow: hidden;
    color: #ffc107;
}

.product-title {
    margin: 0;
    flex: 1;
}

.product-title-link {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title-link:hover {
    color: #007bff;
}

.club-point-info {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.club-point-value {
    font-weight: 600;
    color: #007bff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modern-product-card {
        margin: 6px 6px 12px 6px;
        border-radius: 6px;
        padding: 10px;
    }
    
    .product-content {
        padding: 6px 0;
    }
    
    .current-price {
        font-size: 14px;
    }
    
    .original-price {
        font-size: 12px;
    }
    
    .product-title-link {
        font-size: 12px;
        line-height: 1.3;
    }
    
    .action-btn {
        width: 28px;
        height: 28px;
    }
    
    .action-btn i {
        font-size: 12px;
    }
    
    .discount-badge {
        padding: 2px 6px;
        font-size: 10px;
    }
    
    .discount-text {
        font-size: 8px;
    }
    
    .discount-percentage {
        font-size: 12px;
    }
    
    .wholesale-badge {
        padding: 2px 6px;
        font-size: 9px;
    }
    
    .product-rating {
        margin-bottom: 6px;
    }
    
    .product-rating .las.la-star {
        font-size: 12px !important;
    }
    
    .club-point-info {
        font-size: 10px;
        margin-top: 6px;
    }
}

/* 超小屏幕优化 - 两列布局 */
@media (max-width: 480px) {
    .modern-product-card {
        margin: 4px 4px 8px 4px;
        padding: 8px;
    }
    
    .product-content {
        padding: 4px 0;
    }
    
    .current-price {
        font-size: 13px;
    }
    
    .original-price {
        font-size: 11px;
    }
    
    .product-title-link {
        font-size: 11px;
        line-height: 1.2;
    }
    
    .action-btn {
        width: 24px;
        height: 24px;
    }
    
    .action-btn i {
        font-size: 10px;
    }
    
    .discount-badge {
        padding: 1px 4px;
        font-size: 9px;
    }
    
    .discount-text {
        font-size: 7px;
    }
    
    .discount-percentage {
        font-size: 10px;
    }
    
    .wholesale-badge {
        padding: 1px 4px;
        font-size: 8px;
    }
    
    .product-rating {
        margin-bottom: 4px;
    }
    
    .product-rating .las.la-star {
        font-size: 11px !important;
    }
    
    .club-point-info {
        font-size: 9px;
        margin-top: 4px;
    }
}

/* 确保网格布局在小屏幕上正确显示 - 两列布局 */
@media (max-width: 576px) {
    .row-cols-2 > * {
        flex: 0 0 50%;
        max-width: 50%;
        padding-left: 5px;
        padding-right: 5px;
    }
}

/* 手机端两列布局优化 */
@media (max-width: 480px) {
    .row-cols-2 > * {
        flex: 0 0 50%;
        max-width: 50%;
        padding-left: 4px;
        padding-right: 4px;
    }
}

/* 修复可能的布局问题 */
.modern-product-card {
    min-height: 280px;
    margin: 8px 8px 16px 8px !important;
}

@media (max-width: 768px) {
    .modern-product-card {
        min-height: 240px;
        margin: 6px 6px 12px 6px !important;
    }
}

@media (max-width: 480px) {
    .modern-product-card {
        min-height: 220px;
        margin: 4px 4px 8px 4px !important;
    }
}

/* 页面容器优化 */
@media (max-width: 768px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .row.gutters-5 {
        margin-left: -5px;
        margin-right: -5px;
    }
    
    .row.gutters-5 > * {
        padding-left: 5px;
        padding-right: 5px;
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .row.gutters-5 {
        margin-left: -4px;
        margin-right: -4px;
    }
    
    .row.gutters-5 > * {
        padding-left: 4px;
        padding-right: 4px;
    }
}

/* 标题优化 */
@media (max-width: 768px) {
    .h2.my-5 {
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
        font-size: 1.5rem;
    }
}

/* 分页优化 */
@media (max-width: 768px) {
    .aiz-pagination {
        margin-top: 2rem !important;
    }
    
    .aiz-pagination .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
}