/* Product Card Styles - Componente Reutilizable */
/* 
 * Este archivo contiene todos los estilos para el componente product_card.html
 * Incluir en templates que usen {% include 'product_card.html' %}
 */

/* Product Grid and Carousel Styles */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

/* Infinite Carousel Styles */
.products-carousel-container {
    position: relative;
    overflow: hidden;
    margin: 20px 0 0 0;
}

.products-carousel {
    display: flex;
    gap: 25px;
    animation: infiniteScroll 12s linear infinite;
}

@keyframes infiniteScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.products-carousel .product-card {
    flex: 0 0 250px;
    min-width: 250px;
}

/* Estilos específicos para product-card en el carousel */
.carousel-slide .product-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.carousel-slide .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Asegurar que el contenido del carousel se vea igual que el grid */
.carousel-slide .product-card .product-info {
    display: flex;
    flex-direction: column;
}

.carousel-slide .product-card .add-to-cart {
    text-align: center;
    margin-top: 15px;
}

.product-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    position: relative;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
}

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

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s;
}

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

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #82358C;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: all 0.3s;
}

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

.product-actions a {
    width: 36px;
    height: 36px;
    background-color: white;
    color: #82358C;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    text-decoration: none;
}

.product-actions a:hover {
    background-color: #82358C;
    color: white;
    transform: scale(1.1);
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 16px;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #333333;
    font-weight: 600;
}

.product-price {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.current-price {
    font-size: 18px;
    font-weight: bold;
    color: #82358C;
}

.original-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-left: 10px;
}

.add-to-cart {
    width: 100%;
    background-color: #82358C;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.add-to-cart::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.add-to-cart:hover::before {
    width: 300px;
    height: 300px;
}

.add-to-cart:hover {
    background-color: #4C2673;
    transform: translateY(-2px);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .product-image {
        height: 170px;
    }
    
    .product-title {
        font-size: 14px;
        height: 38px;
    }
    
    .current-price {
        font-size: 16px;
    }
    
    .original-price {
        font-size: 13px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .add-to-cart {
        padding: 9px;
        font-size: 14px;
    }
}

@media (max-width: 640px) {
    .product-image {
        height: 160px;
    }
    
    .product-title {
        font-size: 13px;
        height: 36px;
    }
    
    .current-price {
        font-size: 15px;
    }
    
    .product-info {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .product-image {
        height: 150px;
    }
    
    .product-title {
        font-size: 13px;
        height: 34px;
    }
    
    .current-price {
        font-size: 14px;
    }
    
    .original-price {
        font-size: 12px;
    }
    
    .product-actions {
        opacity: 1; /* Always visible on mobile */
    }
    
    .product-actions a {
        width: 30px;
        height: 30px;
        margin-bottom: 6px;
        font-size: 12px;
    }
    
    .add-to-cart {
        padding: 8px;
        font-size: 13px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .discount-badge {
        font-size: 11px;
        padding: 4px 8px;
    }
}

@media (max-width: 360px) {
    .product-image {
        height: 140px;
    }
    
    .product-title {
        font-size: 12px;
        height: 32px;
    }
    
    .current-price {
        font-size: 13px;
    }
    
    .original-price {
        font-size: 11px;
    }
    
    .product-info {
        padding: 8px;
    }
    
    .add-to-cart {
        padding: 7px;
        font-size: 12px;
    }
    
    .product-actions a {
        width: 28px;
        height: 28px;
        margin-bottom: 5px;
        font-size: 11px;
    }
}

@media (max-width: 320px) {
    .product-image {
        height: 130px;
    }
    
    .product-title {
        font-size: 11px;
        height: 30px;
    }
    
    .current-price {
        font-size: 12px;
    }
    
    .original-price {
        font-size: 10px;
    }
    
    .product-info {
        padding: 8px;
    }
    
    .add-to-cart {
        padding: 6px;
        font-size: 11px;
    }
    
    .discount-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* Responsive Styles for Product Grid and Carousel */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .products-carousel .product-card {
        flex: 0 0 200px;
        min-width: 200px;
    }
    
    .products-carousel {
        gap: 20px;
        animation: infiniteScroll 11s linear infinite;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 15px;
    }
    
    .products-carousel .product-card {
        flex: 0 0 170px;
        min-width: 170px;
    }
    
    .products-carousel {
        gap: 15px;
        animation: infiniteScroll 10s linear infinite;
    }
}

@media (max-width: 360px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
        gap: 12px;
    }
    
    .products-carousel .product-card {
        flex: 0 0 155px;
        min-width: 155px;
    }
    
    .products-carousel {
        gap: 12px;
        animation: infiniteScroll 9s linear infinite;
    }
}

@media (max-width: 320px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
        gap: 10px;
    }
    
    .products-carousel .product-card {
        flex: 0 0 145px;
        min-width: 145px;
    }
    
    .products-carousel {
        gap: 10px;
        animation: infiniteScroll 8s linear infinite;
    }
}

