/* Chanping Product Grid Styles */

.chanping-product-grid {
    width: 100%;
    margin: 0 auto;
}

.chanping-product-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 0;
}

.chanping-product-item {
    background: #ffffff;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Image Container */
.chanping-product-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.chanping-product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.chanping-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
    display: block;
}

.chanping-product-item:hover .chanping-product-image img {
    transform: scale(1.1);
}

/* Product Title */
.chanping-product-title {
    text-align: center;
    margin: 15px 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
}

.chanping-product-title a {
    color: #333333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.chanping-product-title a:hover {
    color: #666666;
}

/* Product Button */
.chanping-product-button-wrapper {
    text-align: center;
    margin-top: auto;
}

.chanping-product-button {
    display: inline-block;
    padding: 10px 30px;
    background: transparent;
    color: #666666;
    text-decoration: none;
    border: 1px solid #666666;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chanping-product-item:hover .chanping-product-button {
    background: #333333;
    color: #ffffff;
    border-color: #333333;
}

/* Pagination */
.chanping-pagination {
    margin-top: 40px;
    text-align: center;
}

.chanping-pagination .page-numbers {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.chanping-pagination .page-numbers li {
    display: inline-block;
}

.chanping-pagination .page-numbers a,
.chanping-pagination .page-numbers span {
    display: inline-block;
    padding: 8px 15px;
    background: #f5f5f5;
    color: #666666;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.chanping-pagination .page-numbers a:hover,
.chanping-pagination .page-numbers span.current {
    background: #333333;
    color: #ffffff;
}

/* Responsive Design */

/* Tablet - 3 columns */
@media (max-width: 1024px) {
    .chanping-product-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile - 2 columns */
@media (max-width: 768px) {
    .chanping-product-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .chanping-product-title {
        font-size: 14px;
        margin: 10px 0;
    }
    
    .chanping-product-button {
        padding: 8px 20px;
        font-size: 12px;
    }
    
    .chanping-pagination {
        margin-top: 30px;
    }
    
    .chanping-pagination .page-numbers a,
    .chanping-pagination .page-numbers span {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Very Small Mobile - 1 column */
@media (max-width: 480px) {
    .chanping-product-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Loading State */
.chanping-product-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Empty State */
.chanping-product-grid .no-products {
    text-align: center;
    padding: 60px 20px;
    color: #999999;
    font-size: 16px;
}

/* Fix for WooCommerce default styles */
.chanping-product-image .attachment-woocommerce_thumbnail {
    width: 100% !important;
    height: 100% !important;
}

/* Elementor Preview Mode */
.elementor-editor-active .chanping-product-grid {
    min-height: 400px;
}
