/**
 * Yoowan Product List Widget Styles
 */

/* Main Wrapper */
.yoowan-product-list-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Product Grid - All Products Display */
.yoowan-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 40px;
}

/* Product Grid Items */
.yoowan-product-grid .yoowan-product-item {
    background: #fff;
    border-radius: 0;
    overflow: visible !important;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.yoowan-product-grid .yoowan-product-item:hover {
    transform: translateY(-3px);
}

.yoowan-product-grid .yoowan-product-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 比例，参考网站样式 */
    overflow: hidden;
    background: #f8f8f8;
}

.yoowan-product-grid .yoowan-product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.yoowan-product-grid .yoowan-product-item:hover .yoowan-product-image {
    transform: scale(1.05);
}

/* Product Titles */
.yoowan-product-grid .yoowan-product-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 20px 15px !important;
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-align: center !important;
    line-height: 1.4 !important;
    background: #fff !important;
    color: #333 !important;
    min-height: 60px !important;
    height: auto !important;
    position: relative !important;
    z-index: 10 !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
}

.yoowan-product-grid .yoowan-product-title a {
    display: inline-block !important;
    color: #333 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
    width: 100% !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.yoowan-product-grid .yoowan-product-title a:hover {
    color: #8b7355 !important;
}

/* Pagination */
.yoowan-product-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
    padding: 20px 0;
}

.yoowan-product-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #ddd;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.yoowan-product-pagination .page-numbers:hover {
    background: #8b7355;
    color: #fff;
    border-color: #8b7355;
}

.yoowan-product-pagination .page-numbers.current {
    background: #8b7355;
    color: #fff;
    border-color: #8b7355;
}

.yoowan-product-pagination .page-numbers.prev,
.yoowan-product-pagination .page-numbers.next {
    font-weight: bold;
}

/* Image Magnification Overlay */
.yoowan-magnify-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}

.yoowan-magnify-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.yoowan-magnify-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    z-index: 100000;
}

.yoowan-magnify-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

.yoowan-magnify-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.yoowan-magnify-close:hover {
    color: #8b7355;
}

body.yoowan-magnify-active {
    overflow: hidden;
}

/* Empty State */
.yoowan-product-list-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* Error State */
.yoowan-product-list-error {
    text-align: center;
    padding: 40px 20px;
    color: #d9534f;
    font-size: 14px;
    background: #f9ecec;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .yoowan-product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .yoowan-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .yoowan-product-grid .yoowan-product-title {
        font-size: 14px;
        padding: 15px 10px;
    }
}

@media (max-width: 480px) {
    .yoowan-product-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .yoowan-product-pagination .page-numbers {
        min-width: 35px;
        height: 35px;
        font-size: 13px;
    }
}
