/* eBay Widget Styles */

.ebay-widget-section {
    margin: 2.5rem 0;
    padding: 1.5rem;
    background: var(--bg-secondary, #f5f5f5);
    /* Fallback */
    border-radius: 8px;
    border: 1px solid var(--border-color, #e0e0e0);
}

/* Theme Support Integration */
/* Inherit from existing CSS variables where possible */
[data-theme="dark"] .ebay-widget-section {
    background: #2d2d2d;
    border-color: #404040;
}

[data-theme="90s"] .ebay-widget-section {
    background: #c0c0c0;
    border: 2px outset #ffffff;
    border-radius: 0;
}

.ebay-widget-section h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    border-bottom: 2px solid var(--accent-color, #0055aa);
    padding-bottom: 0.5rem;
}

.ebay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.ebay-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #dddddd);
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    color: inherit;
}

[data-theme="dark"] .ebay-card {
    background: #383838;
    border-color: #505050;
}

.ebay-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    /* Override global link styles */
}

.ebay-thumb {
    height: 160px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ebay-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ebay-card:hover .ebay-thumb img {
    transform: scale(1.05);
}

.ebay-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ebay-title {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 0.5rem;

    /* Truncate to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main, #333);
}

[data-theme="dark"] .ebay-title {
    color: #e0e0e0;
}

.ebay-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color, #003459);
    /* Price color */
    margin-top: auto;
    /* Push to bottom */
}

.ebay-cta {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ebay-attribution {
    margin-top: 1rem;
    text-align: right;
    color: #888;
    font-size: 0.75rem;
}

/* Loading State */
.ebay-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--accent-color, #0055aa);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .ebay-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on mobile */
        gap: 0.75rem;
    }

    .ebay-thumb {
        height: 120px;
    }

    .ebay-info {
        padding: 0.75rem;
    }
}