/**
 * Estilos para Grid de Productos de Amazon
 * Sin precios, respetando políticas de Amazon Associates
 */

.mejor-amazon-grid {
    display:none;
    margin: 40px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.mejor-amazon-grid .grid-title {
    font-size: 20px;
    font-weight: 700;
    color: #232f3e;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff9900;
}

/* Grid de productos */
.products-grid {
        display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

/* Card de producto */
.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Imagen del producto */
.product-image {
    position: relative;
    padding: 20px;
    background: #fff;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}

/* Badges */
.badge-prime,
.badge-deal {
    position: absolute;
    top: 10px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.badge-prime {
    right: 10px;
    background: linear-gradient(135deg, #00a8e1, #0073bb);
    color: #fff;
}

.badge-deal {
    left: 10px;
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: #fff;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Info del producto */
.product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #0f1111 !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.4 !important;
    min-height: 40px !important;
}

/* Rating */
.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.product-rating .stars {
    display: flex;
    gap: 2px;
}

.product-rating .star {
    font-size: 14px;
    line-height: 1;
}

.product-rating .star.full {
    color: #ff9900;
}


.product-rating .star.half {
    color: #ff9900;
    opacity: 0.6;
}

.product-rating .star.empty {
    color: #ddd;
}

.reviews-count {
    font-size: 12px;
    color: #007185;
}

/* Botón Ver en Amazon */
.btn-amazon {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(to bottom, #f7dfa5, #f0c14b);
    border: 1px solid #a88734;
    border-radius: 8px;
    color: #111;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: auto;
}

.btn-amazon:hover {
    background: linear-gradient(to bottom, #f5d78e, #edb932);
    color: #111;
    transform: scale(1.02);
}

.btn-amazon:active {
    transform: scale(0.98);
}

/* Responsive */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .product-image {
        min-height: 150px;
        padding: 15px;
    }

    .product-image img {
        max-height: 130px;
    }

    .product-title {
        font-size: 13px;
        min-height: 36px;
    }

    .btn-amazon {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .mejor-amazon-grid {
        padding: 15px;
    }

    .product-info {
        padding: 10px;
    }
}

/* Estados de carga AJAX */
.products-loading,
.products-error,
.products-timeout {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
    margin-top: 20px;
}

/* Spinner de carga */
.loader-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff9900;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.products-loading p {
    font-size: 16px;
    font-weight: 600;
    color: #232f3e;
    margin: 10px 0;
}

.products-loading small {
    font-size: 13px;
    color: #666;
}

/* Mensaje de error */
.products-error p {
    font-size: 15px;
    color: #666;
    margin-bottom: 20px;
}

.products-error .btn-amazon {
    max-width: 300px;
    margin: 0 auto;
}

/* Mensaje de timeout */
.products-timeout p {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
}

.products-timeout .btn-amazon {
    max-width: 300px;
    margin: 20px auto 0;
}
