/**
 * Product Cards and Grid Styles
 * Shared styles for product cards used across multiple pages
 */

/* Product Grid */
.product-grid,
.watchlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .product-grid,
    .watchlist-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Product Cards */
.product-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Product Image */
.product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    background: var(--background-light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.2s;
}

.product-image a:hover img {
    transform: scale(1.05);
}

/* Product Badges */
.product-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    z-index: 10;
}

.pending-badge {
    background: var(--accent-warning);
    color: white;
}

.linked-badge {
    background: var(--accent-success);
    color: white;
}

/* Product Header */
.product-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.product-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.product-name:hover {
    color: var(--primary-color);
}

.product-url {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-url:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Price Section */
.price-section {
    background: var(--background-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.current-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.current-price.success {
    color: var(--accent-success);
}

.price-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.target-price {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Product Meta */
.product-meta {
    display: flex;
    gap: 1rem;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Product Actions */
.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .product-card {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .product-image {
        height: 180px;
        max-width: 100%;
        min-height: 180px;
    }

    .product-image a {
        max-width: 100%;
        overflow: hidden;
    }

    .product-image img {
        max-width: 100%;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center;
    }

    .price-section {
        padding: 0.75rem;
        width: 100%;
        box-sizing: border-box;
    }

    .current-price {
        font-size: 1.5rem;
        word-break: break-word;
    }

    .price-label {
        font-size: var(--font-size-xs);
    }

    .target-price {
        font-size: var(--font-size-xs);
    }

    .product-actions {
        flex-direction: column;
        width: 100%;
    }

    .product-actions .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: var(--font-size-base);
    }

    .product-actions .btn-bell {
        width: 100%;
        justify-content: center;
    }

    .product-name {
        font-size: var(--font-size-base);
    }

    .product-url {
        font-size: var(--font-size-xs);
    }

    .product-meta {
        font-size: var(--font-size-xs);
    }
}

