/* Estilos para las cards de productos recomendados */

.products-results {
    margin-top: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

.results-header {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

.results-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.results-header p {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 300;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Grid de productos - 4 por fila para 8 productos (4x2) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

/* Card individual de producto */
.product-card {
    background: var(--background-white);
    border-radius: 20px;
    box-shadow: 0 15px 35px var(--shadow-light);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 0; /* Permite que las cards se reduzcan */
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px var(--shadow-medium);
    border-color: var(--accent-color);
}

/* Imagen del producto */
.product-image {
    width: 100%;
    height: 300px;
    background: var(--background-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-radius: 20px 20px 0 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 20px 20px 0 0;
}

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

.product-image .placeholder {
    font-size: 3rem;
    color: var(--text-light);
    opacity: 0.5;
}

/* Contenido de la card */
.product-content {
    padding: 1.5rem;
}

.product-name {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.3;
    min-height: 3.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    min-height: 4.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.product-price {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.product-stock {
    color: var(--text-light);
    padding: 0.3rem 0.8rem;
    background: var(--background-light);
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Botón de acción */
.product-action {
    width: 100%;
    background: var(--gradient-primary);
    color: var(--accent-text);
    border: none;
    padding: 1rem;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-action:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--shadow-medium);
}

.product-action:active {
    transform: translateY(0);
}

/* Promoción exclusiva */
.exclusive-promotion {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6, #1e40af);
    border-radius: 25px;
    padding: 2rem 3rem;
    margin: 3rem auto;
    text-align: center;
    box-shadow: 0 20px 40px rgba(30, 58, 138, 0.4);
    position: relative;
    overflow: hidden;
    max-width: 600px;
    animation: pulse 2s infinite;
}

.exclusive-promotion::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
}

.promotion-badge {
    background: rgba(255, 255, 255, 0.95);
    color: #1e3a8a;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid #1e3a8a;
    animation: bounce 1s infinite;
}

.promotion-icon {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.promotion-title {
    color: #fbbf24;
    font-size: 3.5rem;
    font-weight: 900;
    margin: 0;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.8s ease-out;
}

/* Botón de reiniciar quiz */
.results-actions {
    text-align: center;
}

.restart-btn {
    background: var(--secondary-color);
    color: var(--accent-text);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.restart-btn:hover {
    background: #8a6b3a;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(158, 122, 70, 0.3);
}

/* Estados de carga y error */
.product-card.loading {
    position: relative;
}

.product-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(67, 89, 149, 0.4), transparent);
    animation: loading 1.5s infinite;
}

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

.product-card.error {
    border-color: #ff6b6b;
}

.product-card.error .product-content {
    opacity: 0.7;
}

/* Desktop - Pantallas grandes */
@media (min-width: 1200px) {
    .products-grid {
        max-width: 1800px;
        gap: 2.5rem;
    }
    
    .product-image {
        height: 350px;
    }
    
    .results-header {
        max-width: 1800px;
    }
    
    .results-header p {
        max-width: 900px;
    }
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        margin: 0 1rem 3rem 1rem;
        max-width: 1000px;
    }
    
    .product-content {
        padding: 1.2rem;
    }
    
    .product-name {
        font-size: 1.2rem;
        min-height: 2.8rem;
    }
    
    .product-description {
        font-size: 0.9rem;
        min-height: 4rem;
    }
    
    .exclusive-promotion {
        padding: 1.5rem 2rem;
        margin: 2rem 1rem;
        max-width: 500px;
    }
    
    .promotion-title {
        font-size: 2.8rem;
    }
}

/* Responsive - Mobile grande */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        margin: 0 1rem 3rem 1rem;
        max-width: 800px;
    }
    
    .results-header h2 {
        font-size: 1.8rem;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-content {
        padding: 1.2rem;
    }
    
    .product-name {
        font-size: 1.1rem;
        min-height: 2.8rem;
    }
    
    .product-description {
        font-size: 0.9rem;
        min-height: 4rem;
    }
    
    .restart-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .exclusive-promotion {
        padding: 1rem 1.5rem;
        margin: 1.5rem 0.5rem;
        border-radius: 20px;
        max-width: 400px;
    }
    
    .promotion-title {
        font-size: 2.2rem;
    }
    
    .promotion-badge {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }
}

/* Responsive - Mobile pequeño */
@media (max-width: 480px) {
    .products-results {
        margin-top: 2rem;
    }
    
    .results-header {
        margin-bottom: 2rem;
    }
    
    .results-header h2 {
        font-size: 1.6rem;
    }
    
    .results-header p {
        font-size: 1rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 0 0.5rem 2rem 0.5rem;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-content {
        padding: 1rem;
    }
    
    .product-name {
        font-size: 1rem;
        min-height: 2.4rem;
    }
    
    .product-description {
        font-size: 0.85rem;
        min-height: 3.5rem;
    }
    
    .product-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .restart-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .exclusive-promotion {
        padding: 0.8rem 1rem;
        margin: 1rem 0.3rem;
        border-radius: 15px;
        max-width: 300px;
    }
    
    .promotion-title {
        font-size: 1.8rem;
    }
    
    .promotion-badge {
        padding: 0.5rem 1rem;
        font-size: 0.7rem;
    }
}

/* Responsive - Mobile muy pequeño */
@media (max-width: 360px) {
    .products-grid {
        margin: 0 0.3rem 2rem 0.3rem;
        gap: 1rem;
    }
    
    .product-content {
        padding: 0.8rem;
    }
    
    .product-name {
        font-size: 0.95rem;
    }
    
    .product-description {
        font-size: 0.8rem;
    }
    
    .product-action {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 20px 40px rgba(255, 107, 53, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 25px 50px rgba(255, 107, 53, 0.5);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.product-card {
    animation: fadeInUp 0.6s ease-out;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
.product-card:nth-child(7) { animation-delay: 0.7s; }
.product-card:nth-child(8) { animation-delay: 0.8s; }
