/**
 * Product Card Styles
 *
 * @package LightSolutions
 */

/* Product Card - hairline style shared with hiluxled.dk */
.product-card {
    background-color: var(--paper);
    border: 1px solid var(--hair);
    border-radius: var(--radius-lg);
    box-shadow: none;
    overflow: hidden;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: var(--orange);
    box-shadow: none;
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: var(--light-gray);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

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

.product-category-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background-color: var(--orange-soft);
    color: var(--orange-deep);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.product-sku-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background-color: var(--paper);
    border: 1px solid var(--hair);
    color: var(--ink-2);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-family: monospace;
    letter-spacing: 0.04em;
}

.product-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card .product-title {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-title a {
    color: var(--dark-gray);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.product-card .product-title a:hover {
    color: var(--primary-orange);
}

.product-excerpt {
    color: var(--medium-gray);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

.product-specs {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--hair);
    border-bottom: 1px solid var(--hair);
}

.product-card .spec-item {
    font-size: 0.75rem;
    color: var(--ink);
    font-weight: var(--font-weight-normal);
}

.product-card .spec-item strong {
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-right: 0.35rem;
}

.product-card .product-price {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 1rem;
}

.product-card .product-price .price-label {
    font-size: 0.65rem;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.product-card .product-price .price-amount {
    font-size: 1.35rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.01em;
    color: var(--ink);
}

.product-card .product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    width: 100%;
}

.product-card .product-actions .btn {
    flex: 1 1 0;
    /* min-width:0 lets both buttons shrink to an equal share; without it the
       flex-item default min-width:auto pins each to its text width, so the
       longer "View Details" label ends up wider than "Copy SKU" (looks off-centre). */
    min-width: 0;
    text-align: center;
    justify-content: center;
    font-size: 0.875rem;
    width: auto;
}

/* Responsive Product Cards */
@media (max-width: 768px) {
    .product-image {
        height: 180px;
    }

    .product-content {
        padding: 1rem;
    }

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

    .product-card .product-actions .btn {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center;
        text-align: center;
        flex: none;
        box-sizing: border-box;
    }
}

/* No Products Message */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background-color: var(--light-gray);
    border-radius: var(--radius-lg);
}

.no-products h3 {
    color: var(--dark-gray);
    margin-bottom: 1rem;
}

.no-products p {
    color: var(--medium-gray);
    margin-bottom: 2rem;
}

/* Loading States */
.product-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.product-card.loading .product-image {
    background: linear-gradient(90deg, var(--light-gray) 25%, rgba(255, 255, 255, 0.5) 50%, var(--light-gray) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Placeholder Image */
.product-image img[src*="placeholder"] {
    opacity: 0.6;
    filter: grayscale(100%);
}
