/* Frontend Styles for PrestaShop Products Display */

.ppd-collection-wrapper {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

/* Grid layouts */
.ppd-collection-wrapper.ppd-style-grid.ppd-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.ppd-collection-wrapper.ppd-style-grid.ppd-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.ppd-collection-wrapper.ppd-style-grid.ppd-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.ppd-collection-wrapper.ppd-style-grid.ppd-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* List layout */
.ppd-collection-wrapper.ppd-style-list {
    grid-template-columns: 1fr;
}

.ppd-collection-wrapper.ppd-style-list .ppd-product-card {
    display: flex;
    flex-direction: row;
}

.ppd-collection-wrapper.ppd-style-list .ppd-product-image-wrapper {
    width: 200px;
    flex-shrink: 0;
}

/* Product Card - Style inspired by the image */
.ppd-product-card {
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.ppd-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.ppd-product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.ppd-product-image-wrapper {
    position: relative;
    background: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.ppd-product-image {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

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

.ppd-product-no-image {
    width: 100%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ddd;
    font-size: 48px;
}

/* Cart Icon - Circular button in bottom right */
.ppd-cart-icon {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    background: #d86636;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(216, 102, 54, 0.3);
}

.ppd-product-card:hover .ppd-cart-icon {
    background: #c45428;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(216, 102, 54, 0.5);
}

.ppd-cart-icon svg {
    width: 22px;
    height: 22px;
}

/* Product Info */
.ppd-product-info {
    padding: 20px;
    background: #f5f5f5;
}

.ppd-product-reference {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 500;
}

.ppd-product-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    line-height: 1.4;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ppd-product-card:hover .ppd-product-title {
    color: #d86636;
}

.ppd-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

/* No products message */
.ppd-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .ppd-collection-wrapper.ppd-style-grid.ppd-columns-5 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .ppd-collection-wrapper.ppd-style-grid.ppd-columns-4,
    .ppd-collection-wrapper.ppd-style-grid.ppd-columns-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ppd-collection-wrapper.ppd-style-grid.ppd-columns-3,
    .ppd-collection-wrapper.ppd-style-grid.ppd-columns-4,
    .ppd-collection-wrapper.ppd-style-grid.ppd-columns-5 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ppd-collection-wrapper.ppd-style-list .ppd-product-card {
        flex-direction: column;
    }
    
    .ppd-collection-wrapper.ppd-style-list .ppd-product-image-wrapper {
        width: 100%;
    }
    
    .ppd-product-image-wrapper {
        min-height: 200px;
    }
    
    .ppd-product-image {
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    .ppd-collection-wrapper.ppd-style-grid {
        grid-template-columns: 1fr;
    }
    
    .ppd-collection-wrapper {
        gap: 15px;
    }
    
    .ppd-product-info {
        padding: 15px;
    }
    
    .ppd-cart-icon {
        width: 45px;
        height: 45px;
        bottom: 10px;
        right: 10px;
    }
    
    .ppd-cart-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* Animation for loading */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ppd-product-card {
    animation: fadeIn 0.5s ease-out;
}

/* Hover effects for better UX */
.ppd-product-link {
    position: relative;
}

.ppd-product-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* Print styles */
@media print {
    .ppd-cart-icon {
        display: none;
    }
    
    .ppd-product-card {
        break-inside: avoid;
    }
}
