// Product Compatibility Widget Styles

.product-compatibility-widget {
    margin-top: -25px !important;
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;

    .widget-title {
        font-size: 24px;
        font-weight: 600;
        margin-bottom: 20px;
        color: #333;
        text-align: center;
    }

    .compatibility-filter-container {
        background: #fff;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        overflow: visible;
    }

    // Mobile filter toggle button - hidden on desktop
    .mobile-filter-toggle {
        display: none;
        width: 100%;
        padding: 12px 15px;
        background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
        color: #fff;
        border: none;
        border-radius: 4px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 15px;
        align-items: center;
        justify-content: space-between;

        .toggle-icon {
            transition: transform 0.3s ease;
        }

        &.expanded .toggle-icon {
            transform: rotate(180deg);
        }
    }

    .filter-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        margin-bottom: 30px;
        align-items: flex-end;
        overflow: visible;

        .filter-group {
            flex: 1;
            min-width: 150px;
            overflow: visible;

            label {
                display: block;
                margin-bottom: 5px;
                font-weight: 600;
                color: #555;
                font-size: 14px;
            }

            .filter-select {
                width: 100%;
                padding: 10px 15px;
                border: 1px solid #ddd;
                border-radius: 4px;
                font-size: 14px;
                background-color: #fff;
                cursor: pointer;
                transition: border-color 0.3s ease;
                height: 50px;
                position: relative;
                z-index: auto;

                &:hover:not(:disabled) {
                    border-color: #999;
                }

                &:focus {
                    outline: none;
                    border-color: #007bff;
                    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
                }

                &:disabled {
                    background-color: #f5f5f5;
                    cursor: not-allowed;
                    opacity: 0.6;
                }
            }

            .reset-btn {
                padding: 10px 20px;
                border: none;
                border-radius: 4px;
                font-size: 14px;
                font-weight: 600;
                cursor: pointer;
                transition: all 0.3s ease;
                background-color: #6c757d;
                color: #fff;
                height:50px;
                
                &:hover {
                    background-color: #5a6268;
                    transform: translateY(-1px);
                }

                &:active {
                    transform: translateY(0);
                }
            }
        }
    }

    .loading-indicator {
        text-align: center;
        padding: 40px 20px;
        color: #666;
        font-size: 16px;

        span {
            display: inline-block;
            animation: pulse 1.5s ease-in-out infinite;
        }
    }

    .selection-prompt {
        text-align: center;
        padding: 40px 20px;
        color: #666;
        font-size: 16px;
        background: #f8f9fa;
        border-radius: 4px;
        margin-top: 20px;

        p {
            margin: 0;
        }
    }

    .products-results {
        .results-count {
            margin-bottom: 20px;
            padding: 10px 15px;
            background: #e9ecef;
            border-radius: 4px;
            font-weight: 600;
            color: #495057;
        }

        .products-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 20px;
            margin-bottom: 20px;
        }

        .product-card {
            background: #fff;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            padding: 20px;
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            position: relative;

            &:hover {
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
                transform: translateY(-2px);
            }

            .product-image-wrapper {
                display: block;
                width: 100%;
                height: 200px;
                overflow: hidden;
                margin-bottom: 15px;
                text-align: center;

                .product-image {
                    width: 100%;
                    height: 100%;
                    object-fit: contain;
                    display: block;
                }
            }

            .product-info {
                flex: 1;

                .product-name {
                    font-size: 18px;
                    font-weight: 600;
                    margin-bottom: 10px;
                    line-height: 1.4;
                    min-height: 130px;

                    a {
                        color: #333;
                        text-decoration: none;
                        transition: color 0.3s ease;

                        &:hover {
                            color: #007bff;
                        }
                    }
                }

                .product-badge {
                    display: inline-block;
                    padding: 4px 12px;
                    font-size: 11px;
                    font-weight: 700;
                    text-transform: uppercase;
                    border-radius: 3px;
                    margin-bottom: 10px;
                    letter-spacing: 0.5px;

                    &.product-badge-limited-stock {
                        background: linear-gradient(135deg, #ff6f00 0%, #ff8f00 100%);
                        color: #fff;
                        box-shadow: 0 2px 4px rgba(255, 111, 0, 0.3);
                    }

                    &.product-badge-placeholder {
                        visibility: hidden;
                    }
                }

                .product-details {
                    .detail-row {
                        display: flex;
                        justify-content: space-between;
                        padding: 8px 0;
                        border-bottom: 1px solid #f0f0f0;

                        &:last-child {
                            border-bottom: none;
                        }

                        .label {
                            font-weight: 600;
                            color: #666;
                            font-size: 13px;
                        }

                        .value {
                            color: #333;
                            font-size: 13px;

                            &.price {
                                font-weight: 700;
                                color: #28a745;
                                font-size: 16px;
                            }
                        }
                    }
                }
            }

            .product-actions {
                margin-top: 15px;
                padding-top: 15px;
                border-top: 1px solid #f0f0f0;

                .view-product {
                    display: inline-block;
                    width: 100%;
                    padding: 10px 20px;
                    background-color: #007bff;
                    color: #fff;
                    text-align: center;
                    text-decoration: none;
                    border-radius: 4px;
                    font-weight: 600;
                    transition: all 0.3s ease;

                    &:hover {
                        background-color: #0056b3;
                        transform: translateY(-1px);
                        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
                    }

                    &:active {
                        transform: translateY(0);
                    }
                }
            }
        }

        .no-results {
            text-align: center;
            padding: 40px 20px;
            color: #666;
            font-size: 16px;

            p {
                margin: 0;
            }
        }
    }
}
.product-compatibility-widget {
    // Product Labels - Circular badges
    .product-label {
            display: flex;
    align-items: center;
    -webkit-box-pack: center;
    justify-content: center;
    position: absolute;
    top: 1rem;
    right: 0.5rem;
    z-index: 4;
    width: 5.8rem;
    height: 2.5rem;
    font-size: 9px;
    background: rgb(215, 57, 57);
    border-radius: 0.8rem 0px 0px 0.8rem;

        &.product-label-new {
            background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
            box-shadow: 0 4px 15px rgba(40, 167, 69, 0.5);
        }

        &.product-label-sale {
            background: linear-gradient(135deg, #dc3545 0%, #ff6b6b 100%);
            box-shadow: 0 4px 15px rgba(220, 53, 69, 0.5);
            font-size: 15px;
        }

        &.product-label-super-deal {
            background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%);
            box-shadow: 0 4px 15px rgba(255, 152, 0, 0.5);
            color: #fff;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
            font-size: 8px;
        }

        &.product-label-bestseller {
            background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
            box-shadow: 0 4px 15px rgba(255, 193, 7, 0.5);
            font-size: 7px;
        }

        &.product-label-limited {
            background: linear-gradient(135deg, #ff6f00 0%, #ff8f00 100%);
            box-shadow: 0 4px 15px rgba(255, 111, 0, 0.5);
        }
    }
}
// Responsive styles
@media (max-width: 768px) {
    .product-compatibility-widget {
        padding: 15px;

        .compatibility-filter-container {
            padding: 15px;
        }

        // Show toggle button on mobile
        .mobile-filter-toggle {
            display: flex;
        }

        .filter-controls {
            flex-direction: column;
            transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
            max-height: 1000px;
            opacity: 1;
            overflow: hidden;

            &.collapsed {
                max-height: 0;
                opacity: 0;
                padding: 0;
                margin: 0;
            }

            .filter-group {
                width: 100%;
                min-width: auto;
            }
        }

        .products-results {
            .products-grid {
                grid-template-columns: 1fr;
            }
        }
    }
}

@media (max-width: 480px) {
    .product-compatibility-widget {
        .widget-title {
            font-size: 20px;
        }

        .product-card {
            padding: 15px;

            .product-info {
                .product-name {
                    font-size: 16px;
                }
            }
        }
    }
}

// Animation for loading indicator
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
