/**
 * Yoowan Featured Grid Widget Styles
 */

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

/* Featured Grid - 4 Images Special Layout */
.yoowan-product-featured-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    height: 500px;
}

.yoowan-featured-left {
    flex: 1;
    height: 100%;
    min-height: 500px;
}

.yoowan-featured-right {
    flex: 1;
    height: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.yoowan-featured-top {
    flex: 1;
    height: calc(50% - 10px);
    min-height: 240px;
}

.yoowan-featured-bottom {
    flex: 1;
    height: calc(50% - 10px);
    min-height: 240px;
    display: flex;
    gap: 20px;
}

.yoowan-featured-bottom-left,
.yoowan-featured-bottom-right {
    flex: 1;
    height: 100%;
    min-height: 220px;
}

/* Product Items in Featured Grid */
.yoowan-product-featured-grid .yoowan-product-item {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    background: #fff !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    position: relative !important;
}

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

.yoowan-product-featured-grid .yoowan-product-image-wrapper {
    flex: 1 !important;
    min-height: 0 !important;
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

.yoowan-product-featured-grid .yoowan-product-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.5s ease !important;
    display: block !important;
    z-index: 1 !important;
}

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

/* Ensure consistent heights */
.yoowan-featured-left,
.yoowan-featured-right {
    height: 500px !important;
    min-height: 500px !important;
    max-height: 500px !important;
}

.yoowan-featured-left .yoowan-product-item {
    height: 100%;
    min-height: 480px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.yoowan-featured-top .yoowan-product-item,
.yoowan-featured-bottom-left .yoowan-product-item,
.yoowan-featured-bottom-right .yoowan-product-item {
    height: 100%;
    min-height: 230px;
    display: flex;
    flex-direction: column;
}

/* Product Link */
.yoowan-product-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 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/Error States */
.yoowan-featured-grid-empty,
.yoowan-featured-grid-error {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

.yoowan-featured-grid-error {
    color: #d9534f;
    background: #f9ecec;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .yoowan-product-featured-grid {
        height: 450px;
    }
}

@media (max-width: 768px) {
    .yoowan-product-featured-grid {
        flex-direction: column;
        gap: 15px;
        height: auto;
    }
    
    .yoowan-featured-left {
        height: 300px;
    }
    
    .yoowan-featured-right {
        height: auto;
        flex-direction: column;
    }
    
    .yoowan-featured-top {
        height: 300px;
    }
    
    .yoowan-featured-bottom {
        height: 300px;
        flex-direction: column;
    }
    
    .yoowan-featured-bottom-left,
    .yoowan-featured-bottom-right {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .yoowan-featured-bottom {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .yoowan-featured-bottom-left,
    .yoowan-featured-bottom-right {
        height: 250px;
    }
}

