/**
 * Produktraster-Styles
 */

/* Produktraster-Container */
.products {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 576px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .products {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

/* Produktkarte */
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

/* Produktbild-Container */
.product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background-color: #f9fafb;
}

/* Produktbild */
.product-thumbnail {
    width: 100%;
    height: 100%;
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

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

/* Produktdetails */
.product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

/* Produkttitel */
.woocommerce-loop-product__title {
    font-size: 1rem !important;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.5;
    height: 3rem;
}

/* Produktpreis */
.price {
    font-weight: 600;
    color: var(--primary-color);
    margin-top: auto;
}

.price del {
    color: var(--text-tertiary-color);
    font-weight: normal;
    margin-right: 0.5rem;
}

.price ins {
    text-decoration: none;
    color: var(--accent-color);
}

/* Verkaufsschild */
.onsale {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background-color: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    z-index: 10;
}

/* Produktaktionen */
.product-actions {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
}

/* Produktkategorien und Bewertung */
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.75rem;
}

.product-categories {
    color: var(--text-tertiary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.product-rating {
    display: flex;
    align-items: center;
}

.product-rating .star-rating {
    float: none;
    margin-right: 0.25rem;
}

/* Responsive Anpassungen für kleinere Bildschirme */
@media (max-width: 576px) {
    .product-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .product-categories {
        margin-bottom: 0.25rem;
        max-width: 100%;
    }
}
